In this presentation filmed during QCon SF 2008, Aditya Agarwal discusses Facebook’s architecture, more exactly the software stack used, presenting the advantages and disadvantages of its major components: LAMP (PHP, MySQL), Memcache, Thrift, Scribe.
Watch: Facebook: Science and the Social Graph (1h)
Facebook is using LAMP stack (Linux, Apache, MySQL, PHP) plus Memcache to run their web servers. The scripting language of choice is PHP. Beside those, there are a number of services: AdServer, Search, Network Selector, News Feed, Blogfeeds, CSSParser, Mobile, ShareScraper. The services are built using a common framework made of Thrift and Scribe, plus some tools: SMC, ODS. The resulting numbers are impressive: 120M+ users, 50B+ page views per month, 50K+ applications and 400K+ developers for those applications.
Agarwal explains why they are using MySQL, PHP, Memcache, Thrift, their strengths and their weaknesses. He also shares lessons learned along the way. For example, PHP has an extensive library support for web development and works well for rapid iterations, but it does not scale well for large code bases. The extension framework is so difficult to use that developers usually avoid it. Among the advantages of using MySQL, Agarwal mentions speed and reliability. He said that Facebook hasn’t lost any data yet.
Agarwal also explains the process of servicing a page request, a feed and a search. He also answers many questions from the audience.