0
votes

I am currently developing a cloud backup solution which involves up to 8 microservices developed in spring-boot and using mongo DB atlas as the persistence layer.

The microservices involve a Netflix ZUUL API gateway and Netflix Eureka as the service discovery mechanism. The microservices are required to talk to each other obviously.

The microservices are dockerized. So far I have been deploying them to an EC2 instance using a docker-compose file listing all the services and communication using docker networking

Now I have been trying to use ECS for deploying the microservices. I have been following the below link to creating the cluster etc. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cli-tutorial-ec2.html

My questions are as follows:

  1. Should I create a task definition per microservice and deploy them to a common cluster or should there be a single task wherein I should have all the microservices coagulated together using the docker-compose file? How service discovery work in such a case?

  2. Currently, the services talk to each other using feign proxy and eureka server. What is the best way to retain it as it is or what do you suggest? I earlier used Fargate and deployed the microservices but the service discovery and service registration was failing

Please guide my what is the best way to design the deployment of such an application in ECS

1

1 Answers

0
votes

Compose files only dictate communication between containers running on the same node. Service discovery is usually considered a desirable feature of distributed systems, so I'm going to assume that you're running your stack on several nodes and load-balance between them in some way to give you resilience and high-availability (HA). Otherwise, you'd just use EC2 and install docker.

You need to run your containers/services on a node, so you can continue to use Compose files for this. You shouldn't be using this to define the communication between services though, as you want this to pass through your service-mesh (services + discovery + proxy == service-mesh). Alternatively, it would be relatively easy to replace Compose with a bunch of docker container run statements in a bash script.

Your choice of service-mesh is (arguably) outdated. I'd take a look at consul and consul-connect these days rather than eureka, with the Envoy proxy -- this tech is a couple of generations on from Eureka and a lot simpler.