Tutorial :Social Networking backend architecture



Question:

Ideally, where would an application like Facebook store its "Friends" data? In a database table? in an xml file?


Solution:1

From Facebooks engineering page:

"Already, we are the second most-trafficked PHP site in the world (Yahoo is #1), and one of the largest MySQL installations anywhere, running thousands of databases."

and

"We've built a lightweight but powerful multi-language RPC framework that allows us to seamlessly and easily tie together subsystems written in any language, running on any platform. Facebook is built in PHP, C++, Perl, Python, Erlang, Java, and even a little bit of MLâ€"and it all works together. * We are the largest user in the world of memcached, an open-source caching system. Originally developed by LiveJournal, we've since made so many scalability improvements and performance upgrades that we will be the primary contributor of features in the next major release. * We've created a custom-built search engine serving millions of queries a day, completely distributed and entirely in-memory, with real-time updates."


Solution:2

Relational databases?


Solution:3

check out this blog: http://highscalability.com/ many real-world examples of systems architecures to learn from


Solution:4

"Friends" data is well-described in a graph database. Neo4j is an example, though I know it's not the way Facebook stores this information.

Facebook uses a number of database technologies that may be involved:


Solution:5

Most probably it should contain some other mechanism. As an example a search engine does not keep its index as a database or XML file. To obtain a maximum performance generally they keep some tree (Binary search tree or more complicated one) and store them on disk in performance effective manner. So I guess such mechanism.


Solution:6

Certainly not in a XML file.

Yes, in a database, in one or several tables. And for the precise exemple of facebook, on several server.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »