Using Amazon ECR Clusters - one per microservice or does each microservice reside on one Service

796 Views Asked by At

I am new to using AWS ECR Clusters for microservices projects.

I want to deploy a microservices infrastructure, where I'm able to re-build and re-deploy any microservice on demand. I have deployed a microservice using the ECR registry, and creating Task Definitions per images in ECR.

Is it best practice to create one Cluster per microservice, or one Cluster for all the microservices, but one Service per microserivce?

I would love to hear the best practices around this!

2

There are 2 best solutions below

0
On BEST ANSWER

There are few problems with the terminology in the question. I think once you get the terminology right, you will understand

  1. ECR is the container registry, i.e docker images are uploaded and pulled from and to there
  2. ECS is the orchestration platform, i.e it orchestrates multiple containers in a cluster. It decides on each machine what container will be in
  3. Task definition is an abstraction. You can determine how many containers, what env vars will be passed to the containers, what will be the RUN commands that will be executed once container is started etc..

For instance you have an API endpoint that needs to be highly redundant, so the task definition will be 10 containers. For offline processing (when we care less about performance) - we can set it with less containers.

0
On

In Addition to @gCoh's answer, to answer your question - Is it best practice to create one Cluster per microservice, or one Cluster for all the microservices, but one Service per microserivce?

It depends, What we have done is - Logically grouped the services as per their functionality and created separate clusters out of them.