Facebook Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.Anti-spam check. Do not fill this in! === Technical aspects === The site's primary color is blue as Zuckerberg is [[color blindness|red–green colorblind]], a realization that occurred after a test taken around 2007.<ref>{{cite journal|title=Generation Why?|url=http://www.nybooks.com/articles/archives/2010/nov/25/generation-why/?pagination=false|journal=The New York Review of Books|access-date=February 15, 2014|first=Zadie|last=Smith|date=November 25, 2010| volume=57 | issue=18 |archive-date=October 23, 2015|archive-url=https://web.archive.org/web/20151023213313/http://www.nybooks.com/articles/archives/2010/nov/25/generation-why/?pagination=false|url-status=live}}</ref><ref>{{cite magazine|title=LETTER FROM PALO ALTO: THE FACE OF FACEBOOK|url=https://www.newyorker.com/reporting/2010/09/20/100920fa_fact_vargas?currentPage=all|magazine=[[The New Yorker]]|publisher=Condé Nast|access-date=February 15, 2014|author=Jose Antonio Vargas|date=September 20, 2010|archive-date=June 26, 2014|archive-url=https://web.archive.org/web/20140626160148/http://www.newyorker.com/reporting/2010/09/20/100920fa_fact_vargas?currentPage=all|url-status=live}}</ref> Facebook was initially built using [[PHP]], a popular scripting language designed for web development.<ref>https://engineering.fb.com/2020/05/08/web/facebook-redesign/</ref> PHP was used to create dynamic content and manage data on the server side of the Facebook application. Zuckerberg and co-founders chose PHP for its simplicity and ease of use, which allowed them to quickly develop and deploy the initial version of Facebook. As Facebook grew in user base and functionality, the company encountered scalability and performance challenges with PHP. In response, Facebook engineers developed tools and technologies to optimize PHP performance. One of the most significant was the creation of the HipHop Virtual Machine ([[HHVM]]). This significantly improved the performance and efficiency of PHP code execution on Facebook's servers. ==== 2012 architecture ==== Facebook is developed as one monolithic application. According to an interview in 2012 with Facebook build engineer Chuck Rossi, Facebook compiles into a 1.5 GB binary blob which is then distributed to the servers using a custom [[BitTorrent]]-based release system. Rossi stated that it takes about 15 minutes to build and 15 minutes to release to the servers. The build and release process has zero downtime. Changes to Facebook are rolled out daily.<ref name="Ars Technica BTS">{{cite web|first=Ryan|last=Paul|title=Exclusive: a behind-the-scenes look at Facebook release engineering|url=https://arstechnica.com/business/2012/04/exclusive-a-behind-the-scenes-look-at-facebook-release-engineering/|website=[[Ars Technica]]|publisher=[[Condé Nast]]|date=April 5, 2012|access-date=June 14, 2017|archive-date=July 4, 2017|archive-url=https://web.archive.org/web/20170704145032/https://arstechnica.com/business/2012/04/exclusive-a-behind-the-scenes-look-at-facebook-release-engineering/|url-status=live}}</ref> Facebook used a combination platform based on [[HBase]] to store data across distributed machines. Using a tailing architecture, events are stored in log files, and the logs are tailed. The system rolls these events up and writes them to storage. The user interface then pulls the data out and displays it to users. Facebook handles requests as [[Ajax (programming)|AJAX]] behavior. These requests are written to a log file using [[Scribe (log server)|Scribe]] (developed by Facebook).<ref name="high scalability">{{cite web|url=http://highscalability.com/blog/2011/3/22/facebooks-new-realtime-analytics-system-hbase-to-process-20.html|title=Facebook's New Real-time Analytics System: HBase To Process 20 Billion Events Per Day|publisher=Highscalability.com|date=March 22, 2011|access-date=December 26, 2012|archive-date=January 26, 2021|archive-url=https://web.archive.org/web/20210126214712/http://highscalability.com/blog/2011/3/22/facebooks-new-realtime-analytics-system-hbase-to-process-20.html|url-status=live}}</ref> Data is read from these log files using Ptail, an internally built tool to aggregate data from multiple Scribe stores. It tails the log files and pulls data out. Ptail data are separated into three streams and sent to clusters in different [[data center]]s (Plugin impression, News feed impressions, Actions (plugin + news feed)). Puma is used to manage periods of high data flow (Input/Output or IO). Data is processed in batches to lessen the number of times needed to read and write under high demand periods. (A hot article generates many impressions and news feed impressions that cause huge data skews.) Batches are taken every 1.5 seconds, limited by memory used when creating a [[hash table]].<ref name="high scalability" /> Data is then output in PHP format. The backend is written in [[Java (programming language)|Java]]. Thrift is used as the messaging format so PHP programs can query Java services. Caching solutions display pages more quickly. The data is then sent to [[MapReduce]] servers where it is queried via Hive. This serves as a backup as the data can be recovered from Hive.<ref name="high scalability" /> ==== Content delivery network (CDN) ==== Facebook uses its own [[content delivery network]] or "edge network" under the domain fbcdn.net for serving static data.<ref>{{cite web|url=https://research.fb.com/blog/2016/04/the-evolution-of-advanced-caching-in-the-facebook-cdn/|title=The Evolution of Advanced Caching in the Facebook CDN|date=April 7, 2016|access-date=May 20, 2020|archive-date=January 15, 2021|archive-url=https://web.archive.org/web/20210115184511/https://research.fb.com/blog/2016/04/the-evolution-of-advanced-caching-in-the-facebook-cdn/|url-status=live}}</ref><ref>{{citation | last=Dwarakanath | first=Navya | title=What I Learned About How Facebook Infrastructure Serves Our Photos | date=August 12, 2019}}</ref> Until the mid-2010s, Facebook also relied on [[Akamai]] for CDN services.<ref>{{cite web|url=https://research.facebook.com/publications/an-analysis-of-facebook-photo-caching/|title=An Analysis of Facebook Photo Caching – Meta Research|website=Meta Research|access-date=December 18, 2021|archive-date=December 18, 2021|archive-url=https://web.archive.org/web/20211218093324/https://research.facebook.com/publications/an-analysis-of-facebook-photo-caching/|url-status=live}}</ref><ref>{{cite web|url=https://webapps.stackexchange.com/questions/85953/does-facebook-use-any-other-cdn-apart-from-akamai-encountered-fbcdn-net-subdoma|title=Does Facebook use any other CDN apart from Akamai? Encountered fbcdn.net subdomain that does not belong to Akamai|website=Web Applications Stack Exchange|access-date=May 20, 2020|archive-date=August 11, 2020|archive-url=https://web.archive.org/web/20200811051533/https://webapps.stackexchange.com/questions/85953/does-facebook-use-any-other-cdn-apart-from-akamai-encountered-fbcdn-net-subdoma|url-status=live}}</ref><ref>{{cite journal | last1=Farahbakhsh | first1=Reza | last2=Cuevas | first2=Angel | last3=Ortiz | first3=Antonio M. | last4=Han | first4=Xiao | last5=Crespi | first5=Noel | s2cid=7987529 | title=How far is Facebook from me? Facebook network infrastructure analysis | journal=IEEE Communications Magazine | publisher=Institute of Electrical and Electronics Engineers (IEEE) |arxiv=1705.00717 | volume=53 | issue=9 | year=2015 | issn=0163-6804 | doi=10.1109/mcom.2015.7263357 | pages=134–142}}</ref> ==== Hack programming language ==== On March 20, 2014, Facebook announced a new open-source programming language called [[Hack (programming language)|Hack]]. Before public release, a large portion of Facebook was already running and "battle tested" using the new language.<ref>{{cite magazine|url=https://www.wired.com/wiredenterprise/2014/03/facebook-hack/|title=Facebook Introduces 'Hack', the Programming Language of the Future|date=March 20, 2014|magazine=Wired|first=Cade|last=Metz|access-date=March 7, 2017|archive-date=March 28, 2014|archive-url=https://web.archive.org/web/20140328124125/http://www.wired.com/wiredenterprise/2014/03/facebook-hack|url-status=live}}</ref> Summary: Please note that all contributions to Christianpedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here. You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Christianpedia:Copyrights for details). Do not submit copyrighted work without permission! Cancel Editing help (opens in new window) Discuss this page