Running Microservices in AWS

The easiest way to run a microservices app in AWS is to run it on EC2:

  • Deploy a web server: ideally nginx, alternatively apache,
  • Build your DB: ideally PostgreSQL, alternatively MongoDB or similar,
  • Build your backend and run it continuously: PM2 for Node/Python, systemd for Golang,
  • Change the configurations to serve your frontend in frontend folder - 80/443

Let me know if you want me to elaborate, but this is all you need to run a typical layers of an application.

If I could look for an alternative way however, this wouldn’t be serverless at first hand, it definitely wouldn’t be Lightsail, and surely not Elastic Beanstalk (no clue why some AWS certifications are still Elastic Beanstalk intense by the way). And it wouldn’t be EKS/Kubernetes.

My choice would be to containerize each layer, and deploy with ECS.

And for those who have 0 experience with ECS, allow me to humbly mention a few things:

  • It may look complicated at first hand, but it is a really simple tool, and easy to manage.
  • It’s cheap, can go as powerful as you like or as economic as you like.
  • First deploy some simple application. Build it, then break it while trying to optimize. Then get good at it. Don’t focus on the application, but focus on understanding concepts of ECS.
  • Eventually build it using IaC. This can be AWS native as Cloudformation, CDK; or it can be with Terraform, Pulumi etc.
  • Once again: start managing and setting up ECS with IaC. Get good at it. You will not regret.

It shouldn’t be so difficult to build this architecture with ease of reaching to knowledge nowadays. Yet I can imagine some details about this concept may still be difficult to grasp. So my plan is to learn first, and share in the future.