table of Contents
Stage 1: Build a website in a single place
Phase 2: Application server cluster configuration
Phase 3: nginx + application server cluster configuration
Phase 4: nginx cluster + application server cluster configuration + HA
Phase 5: CDN + Varnish server cluster configuration
Phase 6: Separation of database read and write
Stage 7: nosql + distributed search engine
Stage 8: nosql (HA) + sub-library sub-table + MyCat
Stage 9: Distributed file system
Stage 10: Application service split + message middleware
Phase 11: Microservice architecture
spring cloud technology carding
Stage 1: Build a website in a single place
Phase 2: Application server cluster configuration
Phase 3: nginx + application server cluster configuration
nginx solves the problem of which server the user request is forwarded to
Phase 4: nginx cluster + application server cluster configuration + HA
To prevent single point failure of nginx, lvs solves load balancing, keepAlived guarantees high availability of nginx
Phase 5: CDN + Varnish server cluster configuration
Put static resources that rarely change into varnish. Some content can be directly found in varnish without looking for tomcat.
Large manufacturers can use CDN for content distribution (similar to varnish)
Phase 6: Separation of database read and write
Stage 7: nosql + distributed search engine
Further speed up the query operation
Stage 8: nosql (HA) + sub-library sub-table + MyCat
Use mycat to divide the database and table of mysql to speed up the operation of mysql
Redis cluster configuration with Codis
Stage 9: Distributed file system
Pictures can be placed in a distributed file system
Stage 10: Application service split + message middleware
Split service, use different message queues to communicate between different services
Phase 11: Microservice architecture
spring cloud technology carding
The entire development technology is mainly based on SprinaCloud, and the single microservice module is developed with the combination of SpringMVC + SpringBoot / Spring + MyBatis
Front-end layer , page H5 + thymeleaf / style CSS3 + Bootstrap / front-end framework JQuery + Node / Vue, etc.
At the load layer , the front-end access reaches the LB of the server through the Http or Https protocol.It can be F5 and other hardware for load balancing, and you can also deploy LVS + Keepalived by yourself (Nginx can be used directly if the amount is small)
In the gateway layer , after the request passes the LB, it will reach the gateway layer Zuul (Gateway) of the entire microservice system, and the Ribbon is embedded as the client
Load balancing , Hystrix does fuse downgrade and other service registration, uses Eureka for service governance, Zuul will obtain the published microservice access address from the Eureka cluster, and then proxy the request to the corresponding microservice according to the configuration
Docker container , all the microservice modules are deployed in the Docker container, and the front and back services are completely separated.
Service invocation and invocation between microservice modules all use the standard Http / Https + REST + JSON method, and the invocation technology uses Feign + HttpClient + Ribbon + Hystrix
Unified configuration , each microservice module will interact with Eureka cluster, configuration center (SpringCloudConfig), etc.
Third- party framework , each microservice module usually needs to use some third- party frameworks according to the needs of implementation, such as common ones: cache service (Redis), image service (FastDFS), search service (ElasticSearch)
Mysql database can be split according to the microservice module, access to the public library or separate own library, you can build a MySOL cluster or separate MyCat, etc.