how facebook design resolves the performance issue to fetch friend list?
I have a web design issue regarding to performance to ask advice. On a web site, there are many personalized information, for example the friends of a user of facebook. Personalized I mean different users have different friend list.
Suppose friend list is stored in database like Oracle or Mysql, each time the user clicks Home of his/her facebook page or login, we need to read database again. Each time the user add/remove friend, the database needs some update operations.
My question is, I think the performance capability (e.g. concurrency of transactions of read/write) of database is limited, and if faceb开发者_运维百科ook is using database to store friend list, it is hard to implement the good performance. But if not using database (e.g. MySql or Oracle), how did Facebook implement such personalization function?
This is a pretty good article about the technology behind facebook.
As Justin said, it looks like a combination of Memcached and Cassandra.
Facebook and other large sites typically use a caching layer to store that kind of data so that you don't have to make a round trip to the database each time you need to fetch it.
One of the most popular is Memcached (which, last I remember reading, is used by Facebook).
You could also check out how some sites are using NoSQL databases as their caching layer. I actually just read an article yesterday about how StackOverflow utilizes Redis to handle their caching.
From what I can gather they use a MySQL cluster and memcached and lots of custom written software. They open source plenty of it: http://developers.facebook.com/opensource/
the solution is to use a super-fast NoSQL-style database. Start with Simon Willison's excellent tutorial on redis, and it will all begin to become clear :)
精彩评论