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?
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
[…] 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.