This project started as a simple FastAPI monolith. It was cozy, lived happily in a single container, and was easy to manage—until it wasn't. As I dove deeper into the DevOps world, I realized it needed to "find itself" and grow into a 3-service microservices architecture deployed on AWS ECS Fargate.
The "It Works on My Machine" Phase
I containerized the app using Docker and threw it into ECS Fargate via Terraform. Instead of magic, I got crashing containers. I learned the hard way that private subnets lacking NAT access for ECR pulls and architecture mismatches (M1 ARM vs x86_64 Fargate) are great ways to spend an afternoon questioning your life choices.
Breaking Up (The Right Way)
Once stable, I split the app into user-service, order-service, and an api-gateway. Because each ECS task runs in its own Elastic Network Interface, localhost was dead. I had to implement AWS Cloud Map for internal DNS discovery so my services could finally talk to each other.
The Moral
Why do this? Because now I can break the User service and the Order service won't even notice. That’s the beauty of fault isolation and independent pipelines. It keeps the system resilient and my sleep schedule intact.