A picture of the highly available, high-performance, extensible Web System Architecture _ server-side development

Source: Internet
Author: User
Tags varnish

Foreword: In conjunction with the Guangdong Internet base to carry on the construction of the wireless city centralized platform, has done many explorations in the system design, the structure tuning, also in the system integration test and the performance tuning has encountered many troubles, in the mind has some gains to realize, hoped that with everybody studies together to discuss.


The point where the web system is most vulnerable to performance failures. A lot of people don't know about it, or know it, but they don't know why.

The following diagram is a classic architectural design and layered pattern in a large web system design.

1 Front-end load balancing: Rich with hardware four-layer exchange (think of Yahoo China 2000 servers, only four Alteon on the deal), no money with software load balancing (LVS, Nginx)

2 Multilevel caching: First of all, to take full advantage of the browser's caching capabilities, that is, cookies, and then to use the page caching mechanism in the server, some years ago, we like to use squid, now varnish more popular, there is a great story is Norway's largest online newspaper Verdens Gang ( vg.no) using 3 varnish instead of the original 12 Squid, better performance than before, this is the varnish most successful application case. The last cache point is set in front of the database, so that those who often need to be queried, but the real-time requirements are not so high data caching, to avoid frequent queries on the database. Level three caching can effectively improve the performance of the entire system.

3 Application Server level: First consider your static page and dynamic page accounted for, and then consider how to achieve dynamic static page, static deployment to Apache, dynamic deployment to Tomcat on it. If you are a picture-sharing site like flicker, you must consider setting up a separate picture server, which is the truth of the history of the tears of Taobao telling us.

4 Now consider the question of database selection: The use of relational or relational database is entirely dependent on your business scenario, if you want to achieve real-time requirements high, high data consistency requirements of the scene, relational database; If you want to implement massive data queries and high concurrency, Non-relational database (consider a Facebook table with 100 million users, if you use a relational database query.) Disk IO is almost unstoppable, not a relational database at all;

5 Database performance problems must consider the concurrency of the database performance: usually the production database and query database separation, that is, the famous MySQL single owner more from the way of service. In order to achieve high availability of HA, some sites such as Taobao, in the master will also implement a cluster deployment.

6 Database cluster and library table hash: The database cluster mentioned above is constrained by the DB type used in architecture, cost, and extensibility, so we need to consider improving the system architecture from an application perspective, which is a common and most effective solution for separating the databases in the application. Different modules corresponding to different databases or tables, and then according to a certain strategy for a page or function of a smaller database hash, for example, the user table, according to the user ID for the table hash, so that the system can be low-cost to improve performance and. and has a good scalability, Sohu forum is to adopt such a framework.

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.