This article has participated in the call for good writing activities, click to view: back end, big front end double track submission, 20,000 yuan prize pool waiting for you to challenge!

Spring Cloud Eureka is a part of Spring Cloud Netflix microservice suite. It has done secondary encapsulation based on Netflix Eureka and is mainly responsible for realizing service governance functions in microservice architecture. Spring Cloud Eureka is a REST-based service and provides a Java-based client component that makes it very easy to register services with Spring Cloud Eureka for unified management. Service governance is an essential part of microservices architecture, and Alibaba’s open source Dubbo framework is targeted at service governance. Service governance requires a registry. In addition to using Eureka as the registry, we can also use Consul, Etcd, Zookeeper, etc. Those of you who have used Dubbo should know that there are several registries in Dubbo, such as ZooKeeper-based, Redis-based, and so on, but the Zookeeper approach is the most popular. Either way is fine, the registry is just about managing the information and state of all services. If use the example in our life to explain, the author thinks 12306 website is more appropriate. First of all, the 12306.cn website is like a registration center, the customer is like the client, when they need to take a train, they will log in the 12306.cn website to check the remaining tickets, tickets can be purchased, and then obtain the train number, time, etc., the last departure. The program is the same, when you need to call a service, you will first go to Eureka to pull the service list, check whether the service you call is in it, if so, get the service address, port and other information, and then call. The nice thing about registries is that you don’t need to know how many providers there are, you just need to follow the registries, just as customers don’t need to know how many trains are running, they just need to go to 12306.cn to see if there are tickets. Why is Eureka a better registry than Zookeeper? This is mainly because Eureka is built on AP principles, while ZooKeeper is built on CP principles. In the field of distributed systems, there is a famous CAP theorem, that is, C is data consistency; A is service availability; P is the fault tolerance of the service to network partition faults. These three characteristics cannot be met in any distributed system at the same time, at most two. Zookeeper has a Leader and uses the Paxos (ZAB) algorithm to elect a new Leader when the Leader is unavailable. The Leader’s job is to ensure that data is written only to the Leader, who synchronizes information to other nodes. This operation ensures data consistency. In summary, Eureka is the key to AP and Zookeeper is the key to CP. Much of Dubbo is based on Zookeeper as its registry. Eureka is of course preferred in Spring Cloud.

Introduction and Use of Spring Boot Starter

The next article describes writing registry services using Eureka

Relevant Springboot actual combat project recommendation

Based on Java SSM Springboot +VUE epidemic prevention system system front and back end separation design and implementation

Based on Java Springboot + Mybatis film ticket website management system front + background design and implementation

Design and implementation of winery internal management system based on Java SSM Springboot + Mybatis

Design and implementation of intelligent life sharing platform based on JAVA Springboot + Mybatis

Based on Java Springboot + VUE + Redis front and back end separation furniture mall platform system design and implementation

Design and implementation of anti-epidemic material information management system based on JAVA SSM Springboot

>>>