Cloud & DevOps
AWS Architecture Patterns for High-Growth SaaS Products
HA
Hamza Aslam
DevOps Engineer
24 January 2026
9 min readCloud & DevOps
Infrastructure architecture decisions compound. The choice you make about compute in week one of a new service shapes your deployment patterns, scaling strategy, and operational overhead for years. Most early-stage SaaS products are over-architected for resilience and under-architected for cost.
VPC Design That Doesn't Get You in Trouble
- Three AZs, always: Single-AZ is a time bomb. The cost of a second and third AZ is trivial compared to the cost of an outage during an AWS AZ failure.
- Public subnets for load balancers only: ALB goes in the public subnet. Everything else — ECS tasks, RDS, ElastiCache — goes in private subnets with NAT Gateway egress.
- NAT Gateway per AZ: One shared NAT Gateway is a single point of failure and a bandwidth bottleneck. Spend the extra $35/month per AZ.
- VPC endpoints for S3 and DynamoDB: Free, eliminates NAT Gateway charges for S3 traffic (often 20–30% of NAT costs for media-heavy products).
From $3,200 to $780: The Real Changes
- Moved nightly batch jobs from always-on EC2 to ECS Scheduled Tasks: Saved $420/month. The EC2 instance ran 24/7 to execute 3-hour jobs.
- Right-sized RDS: The client was running db.r6g.xlarge (16GB RAM) for a 2GB database. Moved to db.t4g.medium with read replica. Saved $380/month.
- CloudFront in front of S3: Eliminated $290/month in S3 request costs. CloudFront's regional edge cache absorbed 94% of asset requests.
- Deleted 847GB of unattached EBS volumes and unused snapshots: $180/month of pure waste from terminated instances nobody cleaned up.
HCLcode
# Terraform — ECS service with blue/green deployment
resource "aws_ecs_service" "api" {
name = "api-service"
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.api.arn
desired_count = 3
deployment_controller {
type = "CODE_DEPLOY"
}
load_balancer {
target_group_arn = aws_lb_target_group.blue.arn
container_name = "api"
container_port = 3000
}
health_check_grace_period_seconds = 30
}$3.2k→$780
Monthly AWS bill reduction
76%
Cost reduction without traffic change
847 GB
Orphaned storage deleted
99.97%
Uptime maintained post-optimisation
Tags
AWSDevOpsInfrastructureSaaSTerraformECS
You might also like
Work with us
Ready to build your product?
We help product teams across the UK, Netherlands, Australia, and North America ship faster without compromising quality. Let's talk about your project.
Talk to our team →
