At my work we have a Two different Flask (Python) REST APIs running in ECS behind load balancers. We also have a service that processes background tasks using Redis/Celery.
Right now ECS is my favorite deployment method, though there are still some slow steps when first setting up your task definitions.
Also Fargate is awesome, it sounds more expensive until you realize you’re only paying for CPU time you actually use! It’s actually saving us money now over reserved instances on EC2.
The only thing I haven’t successfully put on ECS is a service that requires local storage. In theory there’s a way to do it but I couldn’t get it to persist between reboots.
So,where are you exactly storing the database. Do you have a container for that also. I would love to hear in more details.
Actually I am looking for a way to use multiple container that are related to each other. In GCP we can easily make the containers contact each other creating a service. Is it possible in ECS?
Our databases are actually not in containers, we use RDS (MySQL) and Elasticache (Redis).
You can definitely communicate between two containers. I think if the containers are on the same instance server (EC2) you can talk directly between them if you use the right networking setup. You can use the concept of a Daemon service to make sure that each backing server has one of the service container you want to share.
Otherwise, you can use the service discovery feature to link services together.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (4)
At my work we have a Two different Flask (Python) REST APIs running in ECS behind load balancers. We also have a service that processes background tasks using Redis/Celery.
Right now ECS is my favorite deployment method, though there are still some slow steps when first setting up your task definitions.
Also Fargate is awesome, it sounds more expensive until you realize you’re only paying for CPU time you actually use! It’s actually saving us money now over reserved instances on EC2.
The only thing I haven’t successfully put on ECS is a service that requires local storage. In theory there’s a way to do it but I couldn’t get it to persist between reboots.
So,where are you exactly storing the database. Do you have a container for that also. I would love to hear in more details.
Actually I am looking for a way to use multiple container that are related to each other. In GCP we can easily make the containers contact each other creating a service. Is it possible in ECS?
Thanks.
We have a python (Flask + Gunicorn) API running using ECS fargate in production and we use AWS RDS Postgres as a Database.
The common wisdom is never to run production databases in containers. There are many articles out there explaining why.
myopsblog.wordpress.com/2017/02/06...
vsupalov.com/database-in-docker/
Containers are meant for stateless applications that can be scaled without issues.
Yes, you can specify multiple containers in ECS. Check out task definitions in ECS.
docs.aws.amazon.com/AmazonECS/late...
Our databases are actually not in containers, we use RDS (MySQL) and Elasticache (Redis).
You can definitely communicate between two containers. I think if the containers are on the same instance server (EC2) you can talk directly between them if you use the right networking setup. You can use the concept of a Daemon service to make sure that each backing server has one of the service container you want to share.
Otherwise, you can use the service discovery feature to link services together.