Comparison between the background architecture of facebook and Renren's website

Source: Internet
Author: User

What types of websites are most popular today? The answer is an SNS website. In just a few years, SNS quickly established the core position of Web 2.0. The rapid growth of users is even more confusing, and the first time Facebook visits surpassed Google, it also makes people feel that the future of SNS is limitless. Of course, in the face of huge and tedious data volumes, high application complexity and user experience, the background architecture of large-scale SNS sites has become one of the highlights of recent attention.

After continuously reporting "the world's largest PHP site Facebook background technology Quest" and "Interview Renren Huang Jing: SNS website background architecture Quest, in addition to the unique landscape of the SNS website background, we also see that, as a representative of domestic and foreign SNS sites, Facebook and Renren still have many different background technical applications. Of course, there are many reasons for this difference. Here we will compare the background architecture of Facebook and Renren. While finding out these differences, we can also see that there is still a big gap in the background Technology of domestic SNS websites compared with those outside China? Where is the gap?

Background language selection

As a large site, the selection of background languages means different architecture routes and different development frameworks. Considering the complexity of the SNS website background architecture, there are not many languages available. Facebook chose php as a large lamp website, while Renren uses Java. Of course, PHP and Java have their own advantages. The golden partner of PHP + MySQL is used by countless sites. when evaluating the advantages of Java, Mr. Huang Jing said, "and when the project becomes increasingly complex, java is able to maintain excellent controllability through its good oo features, and is also beneficial to website reconstruction."

There are many factors in the selection of background languages. It is not important to select a language. The key is to adapt to the corresponding production environment. Comparing PHP and Java is not significant here. But it should be noted that every language has its disadvantages. developers need to think about how to optimize it effectively, just as Facebook has developed hiphop for PHP.

Database

In the background architecture, databases have always been our focus. The relational database, which used to grow stronger and stronger, seems to be a little thin in the nosql movement. This sentence is no longer suitable for SNS sites. Yes, due to the high complexity of SNS sites, their database requirements are very high, high performance, scalability and availability are indispensable.

Facebook is not a traditional LAMP site, and MySQL is mainly used as a Key-value persistent storage, while its storage system is an important part of the NoSQL movement-Cassandra, which features what SNS sites need. Although many people think that NoSQL is not mature enough and lacks reliability, but Facebook's success is a living example.

 
Facebook database architecture diagram, click the source image to view

According to Mr. Huang Jing's introduction, we learned that Renren is not just using MySQL. Nuclear is a distributed KV storage system developed by Renren's team. It is currently being used for trial. For more information about Nuclear, see the UGC team blog at http://ugc.renren.com/2010/01/21/ugc-nuclear-guide-use /.

It is not hard to see that relational databases can no longer meet the needs of large SNS sites. While using NoSQL in foreign countries (including Facebook and Twitter ), in China, the use of NoSQL is still relatively cautious, and the technical level gap is indeed reflected in this regard. In the long run, NoSQL will gradually replace traditional relational databases, especially in the SNS field.

Cache

Cache technology plays an important role in the background architecture. For SNS sites, relying solely on the database, Web servers and other software's own cache mechanisms is absolutely unable to meet the requirements. Memcached is a distributed memory cache system used by Renren and Facebook. It has become one of the most famous software on the Internet. Of course, there are a variety of caching methods. It is not enough to ensure the stable operation of the daily background only. In the face of some emergencies, the cache mechanism is particularly important, especially on database servers and Web servers.

Image Storage Architecture

Images can put a lot of pressure on the Web server, especially the amount of images processed by Facebook (more than 3 billion photos are uploaded every month), which is amazing! Facebook has developed an image storage architecture, namely, Haystack.

Compared with Facebook, Renren does not have a complete image storage architecture. Of course, as a Renren user, you can feel that uploading images and other operations are still smooth. The description uses the current Renren image processing technology to meet the needs of current users and the smooth operation of the background. However, the architecture always focuses on the future. Developing a complete and efficient architecture system is the best solution.

Future Development Trend of SNS background Technology

Compared with other types of websites, the SNS website background architecture is more complex. Regarding the future development trend of SNS backend technology, Huang Jing also said that in view of some of the business characteristics of SNS websites, Renren still focuses on high performance, scalability, and high availability, therefore, the SNS website architecture requires a robust distributed system that can flexibly cope with business changes.

After comparing the background architecture of hichina and Facebook, we can easily see that apart from the system performance of the overall architecture, we need to carefully consider each of the details, this also requires our technical staff to improve their own capabilities, dare to use advanced technologies and applications, and be brave in innovation.

This article address http://www.chengxuyuans.com/software_design/225.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.