Fargate over self-managed instances
Patching and scaling a fleet is real, recurring work. Fargate trades a slightly higher unit cost for the removal of that work entirely, which is the right trade for teams without a dedicated platform group.
A reusable deployment architecture for modern commerce applications using automated infrastructure and containerised services.
Most commerce projects rebuild the same infrastructure from scratch. This is that work done once, as a reusable module set.
Infrastructure written for one project tends to encode that project's assumptions. Making it reusable meant separating what genuinely varies between deployments from what should stay fixed.
I designed the module structure, wrote the Terraform, and built the delivery pipeline.
Each layer, and the reasoning that shaped it.
Composable Terraform modules — network, data, runtime, delivery — assembled per environment. Each module has a narrow input surface, so a new environment is a short configuration file rather than a copy of the previous one.
Static assets are built in the pipeline and served from object storage behind a CDN, keeping the application containers focused on dynamic requests.
Application containers run on ECS with Fargate. Health checks and rolling updates mean a bad release is replaced rather than absorbed.
Managed PostgreSQL with automated backups, and Redis for caching and sessions. Credentials are issued from a secrets store, never committed.
GitHub Actions builds, tests and publishes images, then triggers the service update. Deployment permissions are scoped to exactly what the pipeline needs.
Networking, compute, data services and permissions declared in Terraform and reviewed in pull requests.
Multi-stage Docker builds produce small, reproducible images with no build tooling shipped to production.
ECS on Fargate removes host management while keeping the deployment model familiar.
Build, test, image publish and deploy run on every merge, with no manual server access required.
Staging and production share one module, differing only in configuration values.
Placeholder frames — swap for real captures once they exist.
Every architecture is a set of choices. These are the ones that mattered most, and why they went the way they did.
Patching and scaling a fleet is real, recurring work. Fargate trades a slightly higher unit cost for the removal of that work entirely, which is the right trade for teams without a dedicated platform group.
Environments that drift apart cause the failures that only appear in production. Sharing one module and varying only configuration keeps staging a genuine rehearsal.
Want the detail behind any of these decisions?
Start a conversation