I have a cloud-native application, which is implemented using Spring Cloud Netflix
.
So, in my application, I'm using Eureka
service discovery to manage all instances of different services of the application. When each service instance wants to talk to another one, it uses Eureka
to fetch the required information about the target service (IP and port for example).
The service orchestration can also be achieved using tools like Docker Swarm
and Kubernetes
, and it looks there are some overlaps between what Eureka
does and what Docker Swarm
and Kubernetes
can do.
For example, Imagine I create a service in Docker Swarm
with 5 instances. So, swarm insures that those 5 instances are always up and running. Additionally, each services of the application is sending a periodic heartbeat to the Eureka
internally, to show that it's still alive. It seems we have two layers of health check here, one for Docker
and another inside the Spring Cloud
itself.
Or for example, you can expose a port for a service across the entire swarm, which eliminates some of the needs to have a service discovery (the ports are always apparent). Another example could be load balancing performed by the routing mesh
inside the docker, and the load balancing happening internally by Ribbon
component or Eureka
itself. In this case, having a hardware load balancer, leads us to a 3-layered load balancing functionality.
So, I want to know is it rational to use these tools together? It seems using a combination of these technologies increases the complexity of the application very much and may be redundant.
Thank you for reading!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…