4.3 Database Cost Optimization

Key Takeaways

  • Aurora Serverless v2 scales compute automatically (0.5-256 ACUs) and bills per second, eliminating waste from over-provisioned database instances.
  • DynamoDB On-Demand mode charges per read/write request with no capacity planning; Provisioned mode with auto-scaling is cheaper for predictable workloads.
  • RDS Reserved Instances save up to 69% for steady-state databases; choose Multi-AZ reserved for production databases.
  • ElastiCache Reserved Nodes save up to 55% for always-on caching layers.
  • Use read replicas to offload read traffic from the primary database, potentially reducing the primary instance size (and cost).
Last updated: March 2026

Database Cost Optimization

Quick Answer: Use Aurora Serverless for variable workloads (pay per ACU-second). Use RDS Reserved Instances for steady-state databases (up to 69% off). Use DynamoDB On-Demand for unpredictable traffic, Provisioned for predictable traffic. Add ElastiCache or DAX to reduce expensive database reads. Read replicas offload read traffic cheaply.

RDS Cost Optimization

Instance Right-Sizing

StrategyHow
Performance InsightsIdentify actual CPU, memory, and I/O usage
CloudWatch metricsMonitor CPU utilization, freeable memory, read/write IOPS
Compute OptimizerGet right-sizing recommendations
Graviton instancesSwitch to Graviton (arm64) for up to 20% cost savings with better performance

RDS Pricing Options

OptionSavingsCommitment
On-DemandBaselineNone
Reserved (1-year)~40%1 year
Reserved (3-year)Up to 69%3 years
Aurora Serverless v2Variable (per ACU-second)None

Read Replicas for Cost Optimization

Instead of scaling UP (larger primary instance), scale OUT with read replicas:

  • Offload read queries to replicas (cheaper instances)
  • Reduce load on primary → potentially downsize the primary
  • Aurora allows up to 15 read replicas with automatic load balancing

Aurora Serverless for Cost Optimization

ScenarioProvisioned Aurora CostServerless v2 Cost
Dev/test (used 8 hours/day)~$730/month (db.r6g.large 24/7)~$245/month (8 hours active + 16 hours idle)
Variable workload (spikes 4x baseline)~$1,460/month (sized for peak)~$500/month (scales dynamically)
Steady 24/7 high load~$730/month~$800/month (overhead from per-ACU pricing)

Key insight: Aurora Serverless saves money for variable or part-time workloads. For steady 24/7 workloads, provisioned instances with Reserved pricing are cheaper.

DynamoDB Cost Optimization

On-Demand vs. Provisioned

ModeCost (us-east-1)Best For
On-Demand$1.25 per million write requests, $0.25 per million read requestsUnpredictable, spiky traffic
Provisioned$0.00065 per WCU/hour, $0.00013 per RCU/hourPredictable, steady traffic
Provisioned + ReservedUp to 77% off provisioned pricingSteady, long-term workloads

DynamoDB Cost Strategies

StrategyHow It Saves
Use TTLAutomatically delete expired items at no cost (reduces storage)
Use DAXCache reads to reduce RCU consumption
Optimize item sizeSmaller items = fewer RCUs/WCUs
Use GSI projectionsProject only needed attributes in Global Secondary Indexes
Reserved CapacityCommit to provisioned capacity for up to 77% savings

Caching for Cost Reduction

Adding a caching layer reduces database load, which means:

  • Fewer reads hitting the database → lower IOPS/RCU needs → smaller (cheaper) instance
  • Better performance → fewer timeouts → fewer retries → lower cost
Caching SolutionUse WithCache Hit Latency
ElastiCache RedisAny databaseSub-millisecond
DynamoDB DAXDynamoDB onlyMicrosecond
CloudFrontAPI responses, web contentMillisecond (edge)
API Gateway cachingAPI responsesMillisecond

On the Exam: "Reduce database costs for a read-heavy workload" → Add ElastiCache or read replicas. "Variable database workload with unpredictable traffic" → Aurora Serverless or DynamoDB On-Demand.

Test Your Knowledge

A development database is only used during business hours (8 AM to 6 PM) on weekdays. What is the MOST cost-effective database solution?

A
B
C
D
Test Your Knowledge

A DynamoDB table experiences highly unpredictable traffic — ranging from 10 reads/second to 10,000 reads/second throughout the day. Which capacity mode should they use?

A
B
C
D