We know that a website is with the development of the business, gradually evolved into tens of thousands of servers, Gui the number of users of large sites, through a number of years, even the last ten years of
Developed into a large web site, but really personally experienced this development process of people are not many, this kind of person is holding the company stock, drive not to go to people, so because
For many people have not personally experienced, so the evolution of the architecture has no deep understanding, including myself, but have not eaten pork, also saw pig run ...
One: First generation architecture
These days, most of the business started from poor cock, running the "fast and good province" principle to establish a website, the "application", "File", "database" all put in a service
On the device, hurriedly embarked on the road of the website architecture.
We know that the development of the business will have a higher demand for technology, business innovation will touch the innovation of technology, when the business gradually developed, the most likely problem is
"Storage space" and "poor performance" in general require the separation of "application" and "data" at this time.
II: Second generation architecture
As your business grows, you need to separate "applications", "Files", "Databases", and more powerful CPU processing servers to host applications, remembering the previous
Home CPU is 16 cores, "file" words will require more disk space of the server, "database" words need larger disk and large memory server, we know
SQL Server is still eating memory, remember to use the largest 120g of memory.
As the scale of business expands, the number of visitors increases, we are happy, at least to earn money, and then we will find that the database is beginning to bottleneck, a lot of read and write operations let
Access delays and deadlocks occur in the database, which in turn affects the user experience.
III: Third generation architecture
Since a large number of read and write operations to the database bottlenecks, this time to optimize the read and write operations from two aspects
1. Read operation
We know that everything is in accordance with the 28 principle, that is, the site often access to so many things, for this very high-hit things need to be processed by the cache,
Reducing the number of reads, the memcache in Ctrip do the "Data heat" operation, for low-heat data will be automatically kicked out of the cache.
2. Write operations
This is timely write and non-timely write, for non-timely write data, we can use "message queue" to the write operation throttling, thereby alleviating the instantaneous pressure of the database write.
This time the database read and write operations have been greatly alleviated, as the business scale continues to expand, the number of users is again exploding, we will find the "Application Server" CPU
Often the high fever does not retreat, has been playing the explosion the frequency more and more.
IV: Fourth generation architecture
Now that it's exploded, it's time to pull another application server to distribute the pressure on the front-end access, and after the cluster, a "load balancer Scheduler" is needed.
But the Cock silk Company used more or nginx, tall on the company are prone to hundreds of thousands of of hardware load balancing, such as Ctrip with the A10, there are hundreds of thousands of F5 on the market
and other products.
Large web site high concurrency Architecture Evolution Diagram-excerpt from the network