For enterprises, the website is an important portal for the enterprise. However, the way different enterprises host their website servers will change according to the needs of the enterprise.
Generally speaking, large websites develop from small websites. The website architecture in the initial stage is relatively simple. As the business becomes more complex and the number of users increases, many architectural improvements begin to be made. When it is a small website, there are not many visitors, and generally speaking, only one server is enough. At this time, all resources such as applications, databases, files, etc. are on one server.
#But as the website business develops and the number of users increases, one server can no longer meet the demand. A large number of users access the system resulting in slower and slower access speeds, and the gradual increase in data will also lead to insufficient storage space. At this time, it is necessary to separate the application and data. After the application and data are separated, the entire website uses three servers, namely the application server, the file server and the database server. These three servers have increasingly higher requirements on hardware resources. They require more powerful CPUs, faster disks, and larger memory to support the operation of these servers.
As the number of users continues to increase, the website will face challenges again: too much pressure on the database leads to a further decline in the access efficiency of the entire site, and the user experience is affected. For a website, most business visits are often concentrated on 20% of the data. Take Weibo as an example. The Weibo posts with the most requests are definitely those of big Vs with tens of millions of fans, while almost no one pays attention to the homepages of those small accounts.
We can take advantage of this feature to cache this small part of the data in memory in advance instead of reading it from the database every time. This can reduce the access pressure on the database and improve the access of the entire website. speed. The cache used by the website is generally divided into caching on the application server or caching on a dedicated distributed cache server. The access speed of caching to the application server is much faster, but due to its own memory limitations, it is often not suitable. The remote distributed cache uses a cluster to be responsible for caching services. When the memory is insufficient, it can be easily expanded dynamically.
Use application server clusters to improve the concurrent processing capabilities of the website. After using cache, the data access pressure is alleviated, but the number of request connections that a single application server can handle is limited. During the peak period of website access, the application server becomes the entire The efficiency bottleneck of the website. When a server's processing power and storage space are insufficient, do not try to replace it with a more powerful server. For large websites, no matter how powerful the server is, it cannot meet the website's continued growth in business needs.
In this case, a more appropriate approach is to add a server to share the access and storage pressure of the original server. For website architecture, as long as the load pressure can be improved by adding a server, you can continue to add servers in the same way to continuously improve system performance, thereby achieving system scalability. Application server cluster implementation is a relatively simple and mature type of website scalable architecture design.