Load balancing algorithm
- Polling
- Weighted polling
- Random algorithm
- Minimum number of connections
- hash calculates the hash value according to the client ip, and hash%2 is modulated to determine the distribution target
Database evolution
1. Database performance improvement
- How to synchronize the database
- How to route the data source
- Improve retrieval speed
- Reduce the pressure of reading the database
- lucence, solr, elk
- Index construction:
Build an index based on raw data
Full build -> First build
Incremental build -> Incremental synchronization
Non-real-time (asynchronous/timed task), real-time - Caching: In order to reduce low-speed devices And the difference between high-speed equipment.
- Nosql storage or other storage methods
Nosql: hbase, mongoDB, Redis…
Other caches: browser cache, application cache, db cache, cpu cache, file storage, etc - Deployment and Maintenance difficulties
- Business coupling is very high
- Performance bottlenecks
-
Test
1. The application is split according to functional modules:
1.1 such as: member service, transaction service, commodity service
- Special personnel to maintain special services
li>
- According to different throughput requirements, make targeted expansions
- Operation and maintenance costs Increase
- Increased team members
- zipkin
- traceID
- Client 1, Client 2….
- ESB:
Communication and discovery of services
Protocol conversion
Security
Limits Flow - Server cluster
< /ul>
1.1 Option 1: Introduce a search engine:
1.2 Option 2: Caching
2. Distributed database
2.1 What is the role of transaction?
2.2 Distributed Database:
Realize database splitting by sub-database and table:
According to service characteristics (business volume, type etc. ) Configure database performance separately
Application evolution
Problems of traditional single application:
The role of RPC in distributed?
1.2 Service segmentation
Advantages:
Disadvantages:
High Availability Plan
1 . Single point of failure
1.1 Multi-room deployment
monitoring
1. Link monitoring
2. Hardware monitoring
cpu, internal memory, disk
architecture development process
1. SOA-ESB< /p>
2. Microservices
Registration center: eureka, zookeeper, consoul
3. Container + k8s scheduling
4. serviceMesh (service mesh) The sidecar solves: service fusing, invocation, discovery, load balancing< /p>