<p>I have a cloud-native application, which is implemented using <code>Spring Cloud Netflix</code>.</p>

<p>So, in my application, I'm using <code>Eureka</code> service discovery to manage all instances of different services of the application. When each service instance wants to talk to another one, it uses <code>Eureka</code> to fetch the required information about the target service (IP and port for example).</p>

<p>The service orchestration can also be achieved using tools like <code>Docker Swarm</code> and <code>Kubernetes</code>, and it looks there are some overlaps between what <code>Eureka</code> does and what <code>Docker Swarm</code> and <code>Kubernetes</code> can do.</p>

<p>For example, Imagine I create a service in <code>Docker Swarm</code> 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 <code>Eureka</code> internally, to show that it's still alive. It seems we have two layers of health check here, one for <code>Docker</code> and another inside the <code>Spring Cloud</code> itself.</p>

<p>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 <code>routing mesh</code> inside the docker, and the load balancing happening internally by <code>Ribbon</code> component or <code>Eureka</code> itself. In this case, having a hardware load balancer, leads us to a 3-layered load balancing functionality.</p>

<p>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.</p>

<p>Thank you for reading!</p>

<p>If you already have the application working then there's presumably more effort and risk in removing the netflix components than keeping them. There's an argument that if you could remove e.g. eureka then you wouldn't need to maintain it and it would be one less thing to upgrade. But that might not justify the effort and it also depends on whether you are using it for anything that might not be fulfilled by the orchestration tool. </p>

<p>For example, if you're connecting to services that are not set up as load-balanced (<a href="https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" rel="nofollow noreferrer">'headless services'</a>) then you might want ribbon within your services. (You could do this using tools in the <a href="https://github.com/spring-cloud-incubator/spring-cloud-kubernetes" rel="nofollow noreferrer">spring cloud kubernetes incubator project</a> or its <a href="https://github.com/fabric8io/spring-cloud-kubernetes" rel="nofollow noreferrer">fabric8 equivalent</a>.) Another situation to be mindful of is when you're connecting to external services (i.e. services outside the kubernetes cluster) - then you might want to add load-balancing or rate limiting and ribbon/hystrix would be an option. It will depend on how nuanced your requirements for load-balancing or rate-limiting are. </p>

<p>You've asked specifically about netflix but it's worth stating clearly that spring cloud includes other components and not just netflix ones. <a href="https://dzone.com/articles/deploying-microservices-spring-cloud-vs-kubernetes" rel="nofollow noreferrer">And that there's other areas of overlap where you would need to make choices.</a></p>

<p>I've focused on Kubernetes rather than docker swarm partly because that's what I know best and partly because that's what I believe to be the current direction of <a href="https://dzone.com/articles/why-did-kubernetes-win" rel="nofollow noreferrer">travel for the industry</a> - on this you should note that <a href="https://www.theregister.co.uk/2017/10/17/docker_ee_kubernetes_support/" rel="nofollow noreferrer">kubernetes is available within docker EE</a>. I guess you've read many comparison articles but <a href="https://hackernoon.com/a-kubernetes-guide-for-docker-swarm-users-c14c8aa266cc" rel="nofollow noreferrer">https://hackernoon.com/a-kubernetes-guide-for-docker-swarm-users-c14c8aa266cc</a> might be particularly interesting to you. </p>
