In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how the evolution of distributed architecture is". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The architecture is evolved, not designed. There is no best architecture, only the most suitable one.
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).
Phase one, 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.
Phase 2, 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.
Stage 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.
Stage 4, 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.
Stage 5, use search engines to relieve the pressure of reading the library.
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.
If you are a Java programmer, if you want to improve yourself, if you want to be strong, add Q group: 479499375, you can get a Java architecture advanced technology boutique video. (high concurrency + Spring source code + JVM principle analysis + distributed architecture + micro-service architecture + multi-thread concurrency principle and so on. These become essential content for architects) and the Java advanced learning roadmap.
Stage 6, introduce caching mechanism to relieve 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.
Stage 7, 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.
Stage 8, split of the application
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.
Stage 9, 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.
This is the end of the content of "how does the evolution of distributed architecture"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.