Social Networking backend architecture

前端 未结 6 993
鱼传尺愫
鱼传尺愫 2021-02-06 19:04

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

相关标签:
6条回答
  • 2021-02-06 19:29

    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."

    0 讨论(0)
  • 2021-02-06 19:29

    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.

    0 讨论(0)
  • 2021-02-06 19:38

    Relational databases?

    0 讨论(0)
  • 2021-02-06 19:41

    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.

    0 讨论(0)
  • 2021-02-06 19:42

    "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:

    • a patched version of MySQL
    • Cassandra
    • Hadoop
    • ... others
    0 讨论(0)
  • 2021-02-06 19:45

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

    0 讨论(0)
提交回复
热议问题