Running Production Servers on AWS: EC2 vs RDS Cost Breakdown
When planning to run production workloads in the cloud, cost is one of the most important considerations. In this post, we will explore the monthly expenses of running two application servers and a database server on AWS, and compare two deployment approaches: EC2-only vs EC2 + RDS.
Infrastructure Requirements
Our baseline infrastructure looks like this:
- Application Servers (2 units)
- Ubuntu 22.04 LTS
- 2 vCPUs
- 8 GB RAM
- 100 GB NVMe storage each
- 8 TB/month outbound bandwidth
- Database Server (1 unit)
- 1 vCPU
- 4 GB RAM
- 50 GB NVMe storage
- 4 TB/month outbound bandwidth
In total, this architecture requires 12 TB/month of outbound traffic.
Deployment Options
There are two main approaches to deploy the database layer on AWS:
- EC2 with attached storage (self-managed database)
You install and manage the database engine yourself on an EC2 instance. Backups, patching, and replication are your responsibility. - Amazon RDS (managed database)
AWS handles backups, patching, monitoring, and failover. You pay a premium for the managed service, but operational complexity is reduced.
Monthly Cost Estimation
The following table summarizes the approximate monthly costs in the us-east-1 (N. Virginia) region, using on-demand pricing and t4g instances (Graviton/ARM):
Component | EC2 + Self-Managed DB | EC2 + RDS (Single-AZ) |
---|---|---|
Application Servers (2× t4g.large) | $98.1 | $98.1 |
Database Instance | $24.5 (t4g.medium on EC2) | $47.5 (db.t4g.medium on RDS) |
Storage | $20.0 (EBS gp3, 250 GB total) | $5.8 (RDS gp3, 50 GB) |
IPv4 Addresses | $10.9 (3 IPs) | $7.3 (2 IPs) |
Subtotal (no egress) | $153.6 | $158.7 |
Outbound Traffic (12 TB) | $1,095.7 | $1,095.7 |
Total / month | ≈ $1,249 | ≈ $1,294 |
Key Insights
1. Bandwidth Costs Dominate
The majority of the bill comes from data transfer out of AWS. With 12 TB of outbound traffic, you will spend over $1,000 just in egress charges. Optimizations such as CloudFront caching can significantly reduce these costs.
2. EC2 vs RDS Trade-offs
- EC2 + Self-Managed DB is slightly cheaper, but requires you to handle database maintenance, scaling, and backups.
- RDS costs a bit more, but offloads operational overhead and provides features like automated backups and failover.
3. IPv4 Costs Are Rising
AWS now charges for public IPv4 addresses (~$3.65/month per IP). Consider using private subnets + Load Balancers or IPv6 where possible.
4. Instance Type Selection
If your stack supports ARM/Graviton (t4g), you can save 15–25% compared to x86-based instances (t3). Always benchmark your workloads.
Recommendations
- Use RDS if you prefer managed services and need built-in HA, backups, and scaling.
- Stick to EC2 if you need custom database configurations or want to optimize costs.
- Add CloudFront to reduce egress costs and improve latency for global users.
- Evaluate Reserved Instances or Savings Plans if you commit long-term, which can reduce compute costs by up to 40–60%.
Conclusion
Running production workloads on AWS can be cost-effective, but outbound bandwidth costs can quickly overshadow compute and storage. The decision between EC2-only and EC2 + RDS comes down to whether you value lower cost or reduced operational complexity.
If you are planning long-term workloads, it’s worth experimenting with Graviton instances, CloudFront caching, and Reserved Instances to optimize your AWS bill.