c++ - Okcupid.com(无需访问数据库即可找到匹配项!?)

标签 c++ mysql database webserver

我正在一个名为:OkCupid 的热门交友网站上做一个研究项目。
我想说说数据库的使用方法。
看完网站 union 创始人的解释后,我变得非常困惑。
声明:

when a user performs a match search on OkCupid, we have to do the following:

-Retrieve (from somewhere not the DB) their question answers, their ideal match's answers, and their question importances. On average, each user on OkCupid has 250 questions answered in 3 parts.
-Figure out who qualifies for their search, typically a very complicated query across a few million users. On average, tens of thousands of people qualify, and we need to figure out who they are without hitting the DB.

他们如何在不咨询数据库的情况下完成所有这些工作?
Here is a link to the post
我很感激任何关于他们如何在那里做事的解释

最佳答案

对于经常访问的信息,它可能由数据库支持,但也存储在分布式内存缓存中(例如 Memcached)。

当用户更新他们的答案或回答新问题时,它会更新缓存和数据库,这样就永远不必查询数据库。

他们可以以某种方式访问​​用户的答案或基于缓存键的特定答案,并异步查询大量用户并比较答案。

虽然只是猜测。

关于c++ - Okcupid.com(无需访问数据库即可找到匹配项!?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9145723/

相关文章:

sql-server - asp.net mvc 连接数据库的最佳方式

php - 需要国家/地区-州/城市数据库

c++ - 变量模板的部分特化

php - mysql 和 php 中的限制查询之间的区别

php - 数据库自动更新

MySQL 从特定表中选择列

ruby-on-rails - 点击兑换优惠

c++ - _mm_cmpistri 反向

c++ - 声明为 volatile 的 InterlockedIncrement 参数有什么影响

c++ - Boost::python - 在 python 类的对象上填充指针的 C++ vector