A beautifully designed architecture that costs $5,000/month when the budget is $500 is not a good architecture, it is a fantasy. Cost estimation is a design constraint that shapes every decision.
The 3 pillars of cloud cost
Cloud billing comes down to three things: compute, storage, and data transfer. If you understand these three, you can estimate any system.
Compute (CPU/RAM)
AWS example (us-east-1):
| Type | vCPU | RAM | Cost/month | Best for |
|---|---|---|---|---|
| t3.micro | 2 | 1 GB | ~$8 | Testing, very light workloads |
| t3.small | 2 | 2 GB | ~TABLE6 | Dev environments, low-traffic apps |
| t3.medium | 2 | 4 GB | ~$32 | Small production workloads |
| t3.large | 2 | 8 GB | ~$62 | Medium production workloads |
| c6i.large | 2 | 4 GB | ~$70 | CPU-intensive tasks (compute-optimized) |
| m6i.xlarge | 4 | 16 GB | ~TABLE40 | Memory-heavy apps (general purpose) |
Rules of thumb:
- Development: t3.small/medium (burstable, fine for low traffic)
- Production small: t3.large
- Production medium: c6i/m6i instances (consistent performance)
The "t" instances are burstable: they accumulate CPU credits when idle and spend them during spikes. If your CPU is consistently above 30%, switch to a "c" or "m" instance.
Storage
Types and costs:
| Type | Cost/GB/month | Latency | Use case |
|---|---|---|---|
| S3 Standard | $0.023 | 100-200ms | Frequently accessed files |
| S3 Infrequent Access | $0.0125 | 100-200ms | Backups, older data |
| S3 Glacier | $0.004 | Minutes to hours | Archives, compliance data |
| EBS (SSD gp3) | $0.08 | 1-5ms | Databases, application storage |
| RDS storage | $0.115+ | 1-5ms | Managed database storage |
Storage costs seem small ($0.023/GB means 1 TB = $23), but storage grows over time and rarely shrinks. After a year, you can easily accumulate 10-50 TB.
The hidden cost is operations. S3 charges $0.005 per 1,000 PUTs and $0.0004 per 1,000 GETs. An app serving 1 million images/day pays $12/month just in GET fees, on top of storage and transfer.
Data transfer
This is where budgets go to die.
- Inbound (ingress): generally free
- Outbound (egress): $0.09/GB on AWS
- Between AWS regions: $0.02/GB
- Between availability zones (same region): $0.01/GB
Example: A mobile app with 10K users, 10MB/user/day of data
- 10K x 10MB x 30 days = 3 TB/month
- Cost: 3,000 GB x $0.09 = $270/month just in data transfer
The hidden costs nobody mentions
| Hidden cost | Typical monthly amount | Why it surprises you |
|---|---|---|
| CloudWatch/monitoring | TABLE0-50 | Log ingestion charges pile up |
| Load balancer | $20-30 | Fixed cost even with zero traffic |
| NAT Gateway | $30-100 | Required if private subnets need internet access |
| DNS (Route 53) | $2-5 | Per hosted zone + per query |
| Secrets Manager | $5-20 | $0.40 per secret per month |
| Backups (RDS snapshots) | 10-20% of DB cost | Automatic but not free |
NAT Gateways deserve special mention: $0.045/hour (~$32/month) plus $0.045/GB processed. For a system making many outbound APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses. calls, this single component can cost more than your servers.
Estimation template
For a system with:
- 2 web servers (t3.medium)
- 1 RDS database (db.t3.medium)
- 100 GB S3 storage
- 500 GB data transfer/month
Compute:
- 2 × t3.medium × $32 = $64
- 1 × db.t3.medium × $65 = $65
Storage:
- 100 GB S3 × $0.023 = $2.30
- 50 GB EBS (OS + logs) × $0.08 = $4
Data Transfer:
- 500 GB × $0.09 = $45
Other:
- Load balancer: $20
- CloudWatch/logs: CODE_BLOCK0
- Backups (20% of RDS): CODE_BLOCK3
- NAT Gateway: $32
TOTAL: ~$255/month (~$3,060/year)Always add a 30% buffer. A $255 estimate becomes $332, still cheaper than being surprised by a $400 bill.
Estimation tools
- AWS Calculator: calculator.aws
- GCP Pricing Calculator: cloud.google.com/products/calculator
- Azure Pricing Calculator: azure.microsoft.com/pricing/calculator
- Infracost: Open-source tool that estimates costs from Terraform code
Common optimizations
| Problem | Solution | Savings |
|---|---|---|
| Servers idle at night | Auto-scaling or spot instances | 30-70% |
| Heavy images/videos | CDN (CloudFront) + compression | 50-80% |
| Overloaded DB | Read replicas, caching (Redis) | 40-60% |
| Infinite logs | Retention policy (30d to 7d) | 60-80% |
| High egress costs | Cloudflare in front of S3/origin | 70-90% |
| Predictable workloads | Reserved instances / savings plans | 30-60% |
Alternatives to AWS for startups
| Platform | Compute cost | Egress | Best for |
|---|---|---|---|
| Railway | From $5/month | Included | Quick deploys, small apps |
| Render | From $7/month | Included | Static sites + APIs |
| Fly.io | From $2/month | $0.02/GB | Edge deployment, low latency |
| Hetzner | From $4/month | 20 TB included | European projects, raw VPS |
| DigitalOcean | From $6/month | 1 TB included | Simple cloud, good docs |