1. Overview of distributed architecture
Microservice architecture is a type of distributed architecture.
1. The difference between single unit, cluster and distributed
2. Advantages of distributed architecture
3. Disadvantages of distributed architecture
4. Principles of Distributed Architecture Design
The power of the distributed system architecture is not only "demolition", but also because it can integrate various "middleware", fault tolerance and high availability.
- Asynchronous decoupling
- Not only module code decoupling, but also communication between modules should be decoupled as much as possible. [Message queue realizes communication decoupling]
- Idempotent consistency
- The user's request may go through multiple subsystems. It is necessary to ensure that there is only one copy of the final database operation, that is, to ensure the consistency of the database data (mainly for the "increase" and "reform" of the database).
- Split principle
- It can be split according to various standards, such as: portal subsystem, user center subsystem, search subsystem, file processing subsystem...
- Converged distributed middleware
- For example: Redis cache middleware, Zookeeper middleware, message queue
- Fault tolerance and high availability
5. Drawbacks of Keepalived + LVS + Nginx "Highly Available" cluster architecture
When the number of system visits increases, the pressure on the database will be very heavy . Use distributed cache Redis database to provide system concurrency.