Facebook's architecture analysis---reproduced in foreign languagesFrom various readings and conversations I had, my understanding of Facebook's current architecture are:
- Web front-end written in PHP. Facebook ' s HipHop Compiler [1] then converts it to C + + and compiles it using g++, thus providing a high performance TEMPLA Ting and Web logic execution layer.
- Because of the limitations of relying entirely on static compilation, Facebook's started to work on a HIPHOP interpreter [ 2] as well as a HipHop vsan which translate PHP code to HIPHOP bytecode [3].
- Business logic is exposed as services using Thrift [4]. Some of these services is implemented in PHP, C + + or Java depending on service requirements (Some other languages is pro Bably used ...)
- Services implemented in Java don ' t usual enterprise application server but rather use Facebook's custom Applicatio N Server. At first this can look as wheel reinvented but as these services is exposed and consumed only (or mostly) using Thrift, T He overhead of Tomcat, or even Jetty, was probably too high with no significant added value for their need.
- Persistence is-done using MySQL, Memcached [5], Hadoop's HBase [6]. Memcached is used as a cache for MySQL as well as a general purpose cache.
- Offline processing is done using Hadoop and Hive.
- Data such as logging, clicks and feeds transit using Scribe [7] and is aggregating and stored in HDFS using Scribe-hdfs [ 8], thus allowing extended analysis using MapReduce
- Bigpipe [9] is their custom technology to accelerate page rendering using a pipelining logic
- Varnish Cache [ten] is used for HTTP proxying. They ' ve prefered it for its high performance and efficiency [11].
- The storage of the billions of photos posted by the users are handled by Haystack, a ad-hoc storage solution developed by Facebook which brings low level optimizations and Append-only writes [12].
- Facebook Messages is using it own architecture which is notably based on infrastructure sharding and dynamic cluster mana Gement. Business logic and persistence are encapsulated in so-called ' Cell '. Each Cell handles a part of the users; New Cells can be added as popularity grows [13]. Persistence is achieved using HBase [14].
- Facebook Messages ' search engine is built with a inverted index stored in HBase [15]
- Facebook Search Engine ' s implementation details is unknown as far as I know
- The Typeahead search uses a custom storage and retrieval logic [16]
- Chat is based on a epoll server developed in Erlang and accessed using Thrift [17]
- They ' ve built an automated system then responds to monitoring alerts by launching the appropriated repairing workflow, or Escalating to humans if the outage couldn ' t is overcome [18].
About the resources provisioned in these components, some information and numbers is known:
- Facebook is estimated to own more than 60,000 servers [18]. Their recent datacenter in Prineville, Oregon are based on entirely self-designed hardware [+] that was recently unveiled As Open Compute Project [20].
- TB of data is stored in Memcached processes [21]
- Their Hadoop and Hive cluster is made of the servers with 8 cores, up to GB RAM, TB disks that's a total of 24k cores, 9 6 TB RAM and PB disks [22]
- Billion hits per day, billion photos, 3 trillion objects cached, $ TB of logs per day as of July 2010 [22]
[1]
HipHop for PHP:Http://developers.facebook.com/b ...
[2]
Making Hphpi Faster:Http://www.facebook.com/note.php ...
[3]
The HipHop Virtual Machine:Http://www.facebook.com/note.php ...
[4]
Thrift:http://thrift.apache.org/
[5]
Memcached:http://memcached.org/
[6]
HBase:http://hbase.apache.org/
[7]
Scribe:Https://github.com/facebook/scribe
[8]
Scribe-hdfs:HTTP://HADOOPBLOG.BLOGSPOT.COM/2 ...
[9]
Bigpipe:Http://www.facebook.com/notes/fa ...
[10]
Varnish Cache:http://www.varnish-cache.org/
[11]
Facebook goes for Varnish:http://www.varnish-software.com/...
[12]
Needle in a haystack: Efficient storage of billions of photos:Http://www.facebook.com/note.php ...
[13]
Scaling The Messages application back End:Http://www.facebook.com/note.php ...
[14]
The underlying technology of Messages:https://www.facebook.com/note.ph ...
[15]
The underlying technology of Messages Tech Talk:http://www.facebook.com/video/vi ...
[16]
Facebook ' s Typeahead search architecture : http:// Www.facebook.com/video/vi ...
[17]
Facebook Chat : http://www.facebook.com/note.php ...
[18]
who have the most Web Servers? : http:// Www.datacenterknowledge.c ...
[+] B
uilding efficient Data Centers with the Open Compute Project : http:// Www.facebook.com/note.php ...
[20]
Open Compute Project : http://opencompute.org/
[21]
Facebook ' s architecture presentation at Devoxx : http:// Www.devoxx.com
[22]
Scaling Facebook to millions users and beyond :
Facebook's architecture analysis---reproduced in foreign languages