Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker on AWS - what is a difference between Elastic Beanstalk and ECS?

I want to migrate from Heroku to Amazon AWS and I would like to deploy my app in Docker image. So the app consists of:

  • Web server (node.js -> docker image)
  • Worker (node.js -> docker image)
  • Postgres database (Amazon RDS)
  • Redis instance (Amazon ElatiCache?)

With my app I (Web+Worker):

  • I have to be able to scale both web and worker instances manually or auto.
  • update with new image with zero-downtime
  • see realtime/history metrics
  • see realtime/history logs

And now when studying Amazon docs I found "Elastic Beanstalk" and "Amazon EC2 Container Services (ECS)". I was wondering which one should I use to manage my application (docker images)? What is a difference between them?

like image 204
user606521 Avatar asked Aug 26 '15 07:08

user606521


People also ask

What is the difference between Elastic Beanstalk and ECS?

In comparison to Elastic Beanstalk, Elastic Container Service provides greater control over application architectures and orchestration of Docker containers. You specify the size and number of cluster nodes and determine if auto-scaling should be used. Elastic Container Service uses tasks to launch Docker containers.

Is Amazon ECS same as Docker?

Amazon ECS uses Docker images in task definitions to launch containers. Docker is a technology that provides the tools for you to build, run, test, and deploy distributed applications in containers. Docker provides a walkthrough on deploying containers on Amazon ECS.

Why use Elastic Beanstalk over ECS?

The benefit of Elastic Beanstalk is its ease of use. The AWS Management Console makes it easy to start a highly scalable application just by supplying your application code. Your team doesn't need to be experts in AWS. And you don't need to hire a DevOps engineer or team to manage your environment for you.

What is difference between ECS Docker?

ECS orchestrates Docker containers, but the containers run on EC2 instances. EC2 instances provide the virtual machines that Docker containers need in order to run. AWS released ECS Anywhere in May 2021. ECS Anywhere is the on-premises version of Amazon ECS.


1 Answers

AWS Elastic Beanstalk uses the Amazon EC2 Container Service under the hood for its Multicontainer Docker Environments, and the difference is addressed by the resp. FAQ How is Amazon ECS different from AWS Elastic Beanstalk?

AWS Elastic Beanstalk [...] keeps the provisioning of building blocks (e.g., EC2, RDS, Elastic Load Balancing, Auto Scaling, CloudWatch), deployment of applications, and health monitoring abstracted from the user so they can just focus on writing code. You simply specify which container images are to be deployed, the CPU and memory requirements, the port mappings, and the container links. Elastic Beanstalk will [...] handle all the details such as provisioning an Amazon ECS cluster, balancing load, auto-scaling, monitoring, and placing your containers across your cluster.

[...] You can work with Amazon ECS directly if you want more fine-grained control for custom application architectures. [emphasis mine]

Furthermore, only Elastic Beanstalk supports Heroku's push deployment model (see the deploy command of the EB Command Line Interface), so for your scenario I would definitely recommend to look into Elastic Beanstalk's Multicontainer Docker Environments, rather than using Amazon ECS directly.

like image 56
Steffen Opel Avatar answered Sep 28 '22 00:09

Steffen Opel