Home >Backend Development >PHP Tutorial >[Summary] [Architecture and Optimization] Brainstorm and learn from each other from Facebook_PHP Tutorial
I have little knowledge and I raise this question just to spark some ideas. I hope that everyone can make their own discussion on a certain technology or architecture solution or optimization method that may be used in Facebook in the field that they are good at. According to Tencent’s interview with Facebook’s Vice President of Technical Operations Jonathan Heiliger on September 1, 2008, we learned:
(1) Facebook claims to be the fourth most trafficked website in the world, with 90 million active users accessing Facebook’s 10,000 servers every day.
(2) 25TB data (28TB in December 2008), supported by 400,000 external developers, developed 25,000 sets of application software were purchased.
(3)Use LAMP (Linux, Apache, MySQL, PHP) technical architecture; database uses MySQL; uses Memcached cache SQL acceleration (the world's largest distributed Memcached cache, more than 800 For each server, the data cached in Memcached alone reaches more than 20 TB); use APC for opcode compilation and caching. The compilation execution of PHP is shown in the figure below:
And Facebook’s cache The solution is as shown below:
2. Possible MySQL architecture and optimization
(1) Vertical (unrelated data placed on different database servers) and horizontal segmentation of data (database hashing, such as user_id hashing), and then use MySQL Proxy/Spock Proxy to reverse the split table acting.
(2) Use variables reasonably and establish hash mapping relationships in local files for further segmentation.
(3) Master/Slave cluster architecture to achieve separation of reading and writing.
(4) Reasonable database structure design and index optimization
(5) Others: index cache, joint index, query cache, etc.