Nowadays,in the context of the rapid development of the Internet,the previous single-node service architecture has become more and more unable to bear the user access under the large amount of data,so the distributed technology arises naturally.Along with the distributed technology is the micro service architecture which is now in full swing.To put it simply,microservices are the integration of many services in a single application,broken down into modules that can be independently run,independently maintained and independently deployed.Modules communicate with each other through RPC communication framework or Http communication mode and provide a unified and standardized api interface to the outside.Meanwhile,Redis,ElasticSearch and other related middleware technologies also further improve the performance of micro-services and enable developers to reduce the time of repeated wheel building and improve efficiency.This paper mainly introduces the construction of micro service and the application of micro service in the field of e-commerce.By means of Zuul routing gateway in SpringCloud,Feign and Ribbon load balancing,Eurekaservice registration and discovery and Hystrix service fuse,a basic micro-service architecture is built to realize the module split.The basic storage module is built by Redis and My SQL to ensure that user information can be compared quickly and temporary information can be cached under the large amount of data.The search module is built by ES to improve the query efficiency when searching a large number of indexed documents according to keywords.The load balancing module is built through Nginx,and the client request is forwarded to achieve load balancing and reduce the pressure of the back-end module.In this paper,the service integrated in a single application can be divided into modules through the above technology stack and the normal communication between micro-service modules can be realized.And the performance of each module has been improved to a certain extent after the use of Redis,ES. |