Java performance optimization to create a billion-level traffic spike system: 0. Project goal

Java performance optimization to create a billion-level traffic spike system: 0. Project goal

1. Background:

In scenarios such as panic buying, the service will receive large traffic requests. At this time, if the traffic is completely handed over to the business service to query and then respond to the database, there are two major drawbacks:

  1. Too many database connections cause a crash
  2. Slow response, affecting user experience


Therefore, we plan to adopt the idea of ​​caching to deal with high-traffic scenarios.
There are two cache places,

  1. One is to cache the static resources of the page, which can reduce the pressure on the main service. Dynamic information can be obtained through Ajax.
  2. The other is to cache part of the data in the database to reduce the pressure on the database and increase the speed of operating the database.

2. The preliminary specific plan is:

  1. Use Nginx for reverse proxy and cache static resources
  2. Add Redis on the database side to support the acquisition of dynamic data

The architecture diagram is as follows:
image.png

Consider Redis's master-slave or consistent Hash algorithm as a sharded Redis cluster; the use of cache architecture requires applications to have low data consistency requirements; for example, data that needs to be landed like placing an order is not suitable for storage in Redis. But the order reading can use the cache.
https://wiki.jikexueyuan.com/project/nginx-lua/http.html

3. Advanced plan:

Upgrade the single DB architecture to Twemproxy to organize the Redis cluster, and Atlas to organize the Mysql cluster.
image.png===>>>image.png

Ref: https://wiki.jikexueyuan.com/project/nginx-lua/http.html


Four, learn to grasp:

Learning course: "Focus on Java performance optimization to create a billion-level traffic spike system"
https://coding.imooc.com/class/338.html

5. Reference materials:

  1. https://wiki.jikexueyuan.com/project/nginx-lua/http.html
  2. https://wiki.jikexueyuan.com/project/nginx-lua/product-details-page.html
  3. https://www.iteye.com/blog/jinnianshilongnian-2319573
  4. Core technology of billion-level traffic website architecture[b]

Guess you like

Origin blog.csdn.net/xiaohaigary/article/details/108007860