In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Preface
As the scale of computer systems becomes larger and larger, the architecture of centralizing all business units on one or more mainframes has become increasingly unable to meet today's computer systems. At the same time, with the emergence of microcomputers, more and more cheap PCs have become the first choice of IT architecture for major enterprises, and distributed processing methods are more and more favored by the industry. This article will introduce the history of distributed architecture and some related concepts of distributed architecture.
Let's take a simple e-commerce system as an example, when the amount of data and visits increase, observe the structural changes that may occur in the system. Suppose our system has the following functions: user module (user registration and management), commodity module (commodity display and management), transaction module (creation of transactions and payment settlement).
I. single application architecture
The early days of the website can also be regarded as an early rise in the development of the Internet, and we often run all our programs and software on a single computer. All the software and applications are deployed on a single machine, so as to complete the construction of a simple system, this time is about efficiency.
Separation of application server and database server
With the launch of the website, the number of visits gradually increases, and the load of the server increases slowly. When the server is not overloaded, we should make good planning to improve the load capacity of the website. If the optimization at the code level has no way to continue to improve, without improving the performance of a single machine, increasing the machine is a better way, the input-output ratio is very high. The main purpose of adding machines at this stage is to split the web server and the database server, which not only improves the load capacity of the single machine, but also improves the disaster recovery capacity.
By the way, I would like to recommend a Java technology exchange group: 908676731, which will share some videos recorded by senior architects: Spring,MyBatis,Netty source code analysis, the principles of high concurrency, high performance, distributed, micro-service architecture, JVM performance optimization, distributed architecture, and so on. You can also get free learning resources and benefit a lot at present!
3. Application server cluster
As the traffic continues to increase, a single application server has been unable to meet the demand. Assuming that the database server has not encountered performance problems, we can increase the number of application servers and divert user requests to each server through the application server cluster, thus continuing to improve the load capacity. At this time, there is no direct interaction between multiple application servers, they all rely on the database to provide external services.
When the architecture develops to this stage, various problems will gradually emerge, such as who will forward the user request to the specific application server, and the following architecture model may appear.
IV. Separation of database read and write
When the pressure on the database increases, how to increase the load at the database level? With the previous ideas, you will naturally think of adding servers. But if we simply divide the database into two, and then load the subsequent database requests to the two database servers respectively, it will certainly cause the problem of database disunity. So we usually consider the separation of reading and writing first.
Fifth, use search engines to relieve the pressure of reading libraries.
If the database is used as a reading library, the efficiency of fuzzy search is often not very good, such as e-commerce sites, search is a very core function, even if the separation of reading and writing, this problem can not be effectively solved. Then at this time, we can introduce search engines, and the use of search engines can greatly improve our query speed.
6. introduce caching mechanism to alleviate the pressure on database.
With the continuous increase in the number of visits, there are gradually many users accessing the same part of the content. For these hot data, it is not necessary to read them from the database every time. We can use caching technologies such as memcache and redis as the cache of our application layer. In addition, in some scenarios, such as we limit the access frequency of some users'IP, it is not appropriate to put them in memory, and it is too troublesome to put them in the database. In this case, we can use Nosql instead of traditional relational databases.
VII. Horizontal / vertical split of the database
In the changing process of the evolution of our website, the data of transactions, commodities and users are still in the same database. Although we have adopted the way of increasing cache and separating read and write, as the pressure on the database continues to increase, the bottleneck of the database is still the biggest problem. So we can consider the vertical split and horizontal split of the data.
Vertical split: split different business data in a database into different databases.
Split horizontally: split data from the same table into two or more tables.
VIII. Split of applications
With the development of business, there are more and more services, the pressure of application is increasing, and the scale of the project is becoming larger and larger. At this time, we can consider splitting the application and dividing the system into users, commodities and trading subsystems according to the domain model.
After this split, there may be some same code, such as user operations, which need to be queried in goods and transactions, so there will be user queries to access related operations in each system. These same operations must be abstracted and can be solved by service.
IX. Service
After the service is split, various services can communicate with each other through RPC technology, such as webservice, hessian, http, RMI and so on.
Thank you for reading the article patiently.
By the way, I would like to recommend a Java technology exchange group: 908676731, which will share some videos recorded by senior architects: Spring,MyBatis,Netty source code analysis, the principles of high concurrency, high performance, distributed, micro-service architecture, JVM performance optimization, distributed architecture, and so on. You can also get free learning resources and benefit a lot at present!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.