High-performance, high-availability platform architecture evolution history

Source: Internet
Author: User
Tags redis cluster nginx load balancing

Opening overview

In today's mobile internet, Internet +, the era of big data, all kinds of internet sites, platform anomalies, as springing up, there is a "suddenly like a night spring breeze, thousand tree million Tree pear blossom" feeling.
For the mobile internet era of the platform, the user's sense of experience is good? Is the stability of the platform good? Estimate is for all the Internet platform two big head and other elements bar, indeed, the mobile internet era, traffic is the market value, plainly is the proceeds, is the RMB, lost the flow, then you also lost the opportunity and opportunity to earn income.

Therefore, for the Internet Platform or Web site, the high availability of the site, uninterrupted service is also a major determinant of the platform operation process, such as a platform, Zooey failure, open, or, often, the error, access time-out and so on, then the user's chance of loss will increase.
So, let's talk about it today. What is the evolution of a variety of highly available architectures? This article of migrant brother three hours to summarize the completion of writing, I hope that everyone has help, welcome to make bricks, messages, praise, forward sharing to support.

What is high availability?

High availability availability typically describes a system that has been designed to reduce downtime while maintaining the high availability of its services. In short, it is to provide services without interruption.

Schema first schema diagram

Architecture Brief

This type of architecture is more suitable for startups or for smaller traffic platforms.
This architecture is generally used at the beginning of the platform operation of the architecture, the daily average PV is small, simple architecture enough to respond to user traffic requests, such as the front-end site using Apache/nginx can, the app server directly using the Java environment such as Tomcat application, The database of the Internet platform mostly uses MySQL, the backup server usually backs up some commonly used configuration, the code, the database data backup file and so on. Therefore, the migrant brother called it the beginning of the structure.

Architecture Mid-term

As the number of users increased, the increase in access, the problem is that a single server has been unable to withstand the user's access traffic, so the early infrastructure needs to face a certain adjustment, presumably adjusted as follows

Architecture diagram

Architecture Brief

This kind of architecture introduces the concept of load balancing, the load balance of the application, there are related articles in front of the article, the specific article links as follows
Nginx load balancing and reverse proxy
Nginx+tomcat multi-instance and load Balancing configuration

Load-balanced open source software is more, usually in the following two ways
    • Hardware load--f5 7-tier or 4-layer network proxy
    • Software load--nginx, Haproxy open source load balancer software
The algorithm for load balancing usually has:
    • Polling method
    • Stochastic method
    • Source Address Hash method
    • Weighted round robin method
    • Weighted Stochastic method
    • Minimum connection number method

Specific use of the way, everything to the actual needs of enterprises, input and output ratio (cost considerations) mainly, but this kind of architecture also has some shortcomings exist, temporarily do not consider the front-end load device high availability, such as the user's upload and view file problems (through a service access upload, and then load view is through B server, The user can not see the problem), the same as the application server, the database server has the main, from the single point of the problem, once the failure, you could manually failover, but may result in data loss or disunity, and to a certain extent to the user to create a bad experience, so still need to evolve.

Architecture diagram

Architecture Brief

This architecture is based on the above architecture to deal with the changes of various types of problems, adding data Storage Server (NFS shared storage Linux System NFS Network File System), for storage architecture and source parts, in fact, there are several types of open source software services

    • 1. NFS network shared storage File system
    • 2, FASTDFS Lightweight Network File System (reference article: Distributed File System Fastdfs detailed)
    • 3. Distributed File System Moosefs
    • 4. glusterfs File System

and configure load balancing, and also solve the problem of single point of failure, for the database server made a certain architectural adjustment for the dual-master multi-Slave architecture, for the database of a variety of high-availability architecture, the previous article has been analyzed, such as:
On MySQL cluster high-availability architecture

MHA of MySQL cluster high-availability architecture

However, all architectures are based on actual requirements (such as data integrity, consistency requirements), so as to solve the main library single point problem, read from the library a large number of performance issues, to ensure that a certain amount of access to the platform performance and high availability

Architecture end-of-life architecture diagram

Architecture Brief schema evolution to a certain extent, only by parallel scaling or increasing the number of servers may have been unable to resolve related performance issues, so

first , in the initial stage of user access, CDN Acceleration technology will be used to improve the user's experience of access;

second , according to the business to split into different services, through the split service, the same service deployment of multiple instances of the architecture to achieve the expansion of the purpose to improve certain performance, but also to ensure high availability of the platform, service after splitting, can also be limited to solve the issue of publishing, because the service is independent of each other, The coupling between the services is not strong, but also more convenient for peacetime maintenance;

thirdly , for the bottleneck between the user and the database, consider adding the caching technology to improve the access performance and high availability, so that the user's access traffic can be filtered out directly before reaching the database, or even more than half, thus reducing the pressure of database access, and the number of write-less scenes, It is very useful to use caching to improve the performance of the query service and reduce the pressure on the database. Redis is typically used as a cache server, and some of the cluster mechanisms of Redis guarantee high availability of the cache service (the real-world process of high-availability scenarios for Redis cluster production environments), and the ability to retrieve information from a database when a cache service fails. Then for the backup server is also easy to make adjustments to ensure the integrity of the data, on the one hand can ensure the high availability of the application; in fact, some large-scale distributed systems in the cache this block or more inclined to memcached service (Linux system memcached Service introduction), For example, like some users of the login information synchronization to other systems in this scenario, the general deployment of the front-end application layer and the data storage layer, the front of the application of a large number of requests and rapid response, so as to reduce the database access pressure, but also improve the user's access experience.

There is also a part of the platform architecture that is layered

Front-end application layer:

    •  给用户提供页面展示、查找、搜索的界面及相关的最终结果显示页面
      Back-end service tiers:
    •  一般包括像常用的后台服务、用户管理、接口管理、支付管理等,都是给前端应用提提供服务的
      * * Data storage Tier: * *
    • 这个就很容易理解,像数据库、文件系统、缓存等一系列提供数据访问与存储的

So there are also the following types of architectures that produce

Final summary

High availability, high performance can only be said to be a stage, a period of time, there is no perfect architecture, only the constantly evolving, constantly improve the architecture. Therefore, today's high-performance, high-availability architecture may not be perfect, but ultimately summed up in a sentence: "Let the user's access to traffic as far as possible before, step by step to filter user traffic, quickly respond to user requests, so as to achieve a better user experience."

@ Copyright belongs to the author, from migrant Brother original works, if necessary to reprint, please indicate the source and author information.

High-performance, high-availability platform architecture evolution history

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.