AWS – MySQL on ECS vs RDS

amazon-ecsamazon-rdsamazon-web-services

I'm working on a project where we will be using ECS to run the API of each client, it will start with one but it will eventually grow. We will also need a database for each client and the Project Manager decided that we should have an instance of both API and MySQL for each client. It would be a lot more simple if we used multiple databases inside a MySQL instance but that is not the case.

I've looked at RDS and we can't really have multiple instances of a MySQL database inside an on-demand instance, which makes which leads to a single on-demand instance for each client. On the other hand, running each MySQL instance on a container (while integrating with EFS) in ECS does not feel safe and perhaps troublesome to run backups.

What would you advise me to do in this scenario? Thanks!

Best Answer

Choose the right service for the job.

RDS

  • Managed service
  • Automatic fail-over
  • Automatic backup, easy restore
  • Automatic disk space management (in case of Aurora)
  • Detailed performance stats in CloudWatch
  • Little more expensive, however you get a lot more for the money

MySQL on EC2

  • Cheaper than RDS
  • You have full control of the setup (do you really need it?)
  • All management is up on you - backup, restore, fail over, etc.

MySQL in an ECS container

  • Pros ... ehm ... none?
  • Cons - containers are not meant to store stateful data. That workaround with EFS is just that - a workaround.

The bottom line is to convince your project manager that RDS is the best suited service for storing data. If his worry is the appropriation of the RDS costs to your customers you can charge them some flat fee for "database service" and that with N customers will cover the cost of RDS and with >N customers will contribute to your profit.

Hope that helps :)