Database capacity planning (for example, capacity units)

Task Statement 4.3: Design cost-optimized database solutions.

📘AWS Certified Solutions Architect – (SAA-C03)


1. What is Database Capacity Planning?

Database capacity planning is the process of deciding:

  • How much read and write performance your database needs
  • How much storage is required
  • How the database will scale over time
  • How to meet performance needs at the lowest possible cost

In AWS, capacity planning is important because many database services use capacity-based pricing models.


2. What are Capacity Units?

Capacity Units are a way AWS measures how much work a database can perform.

They define:

  • How many reads per second are allowed
  • How many writes per second are allowed

Different AWS database services use different types of capacity units.


3. Capacity Units in Amazon DynamoDB

3.1 Read Capacity Units (RCUs)

A Read Capacity Unit (RCU) represents:

  • 1 strongly consistent read per second for an item up to 4 KB

OR

  • 2 eventually consistent reads per second for an item up to 4 KB

Key Points:

  • Strong consistency = latest data
  • Eventual consistency = slightly delayed but cheaper
  • Larger items consume more RCUs

3.2 Write Capacity Units (WCUs)

A Write Capacity Unit (WCU) represents:

  • 1 write per second for an item up to 1 KB

Key Points:

  • Larger items consume more WCUs
  • Writes are always strongly consistent

3.3 Example (Important for Exam)

If:

  • Item size = 2 KB
  • Writes = 100 per second

Then:

  • Each write consumes 2 WCUs
  • Total required = 200 WCUs

4. DynamoDB Capacity Modes

4.1 Provisioned Capacity Mode

You manually define:

  • Number of RCUs
  • Number of WCUs

Benefits:

  • Lower cost if workload is predictable
  • Full control

Risks:

  • Over-provisioning → wasted money
  • Under-provisioning → throttling

4.2 On-Demand Capacity Mode

  • No need to define RCUs/WCUs
  • AWS automatically scales capacity

Benefits:

  • Best for unpredictable workloads
  • No planning required

Drawback:

  • Higher cost compared to provisioned (if workload is stable)

5. Auto Scaling in DynamoDB

Auto Scaling adjusts RCUs/WCUs automatically based on usage.

How it works:

  • Define minimum and maximum limits
  • Set a target utilization (e.g., 70%)

Benefits:

  • Prevents over-provisioning
  • Avoids throttling
  • Optimizes cost

6. Burst Capacity (Important Concept)

DynamoDB allows temporary bursts above provisioned capacity.

Key Points:

  • Uses unused capacity from previous time
  • Helps handle sudden traffic spikes
  • Not guaranteed for long periods

7. Partitioning and Capacity

DynamoDB stores data in partitions.

Important limits per partition:

  • ~3,000 RCUs
  • ~1,000 WCUs

Why this matters:

  • Even if total capacity is high, poor partition design can cause hot partitions
  • Leads to throttling

8. Capacity Planning for Amazon RDS

Unlike DynamoDB, Amazon RDS does NOT use RCUs/WCUs.

Instead, capacity planning includes:

8.1 Compute Capacity

  • Instance type (CPU, RAM)
  • Example: db.t3, db.m5

8.2 Storage Capacity

  • Allocated storage (GB)
  • Storage types:
    • General Purpose (gp2, gp3)
    • Provisioned IOPS (io1, io2)

8.3 IOPS (Input/Output Operations Per Second)

  • Measures disk performance
  • Important for high-performance workloads

9. Capacity Planning for Amazon Aurora

9.1 Aurora Capacity Units (ACUs) – Serverless

In Aurora Serverless:

  • Uses Aurora Capacity Units (ACUs)

1 ACU includes:

  • Combination of CPU + memory + networking

Key Features:

  • Automatically scales up/down
  • Pay only for what you use

10. Key Differences Across Services

ServiceCapacity Unit TypeScaling Model
DynamoDBRCUs / WCUsManual / Auto / On-Demand
RDSInstance + IOPSVertical scaling
AuroraACUsAutomatic scaling

11. Cost Optimization Strategies (Exam Focus)

11.1 Right-Sizing Capacity

  • Avoid over-provisioning
  • Monitor usage with CloudWatch

11.2 Use On-Demand When:

  • Traffic is unpredictable
  • Application is new

11.3 Use Provisioned When:

  • Traffic is stable
  • Predictable workload

11.4 Enable Auto Scaling

  • Keeps cost low while maintaining performance

11.5 Optimize Item Size

  • Smaller items = fewer RCUs/WCUs

12. Monitoring Capacity

Use Amazon CloudWatch to track:

  • Consumed RCUs/WCUs
  • Throttled requests
  • CPU utilization (RDS)
  • Storage usage

13. Common Exam Scenarios

Scenario 1:

Application has unpredictable traffic
👉 Use DynamoDB On-Demand


Scenario 2:

Stable workload with predictable usage
👉 Use Provisioned capacity + Auto Scaling


Scenario 3:

Database experiencing throttling
👉 Increase RCUs/WCUs OR improve partition design


Scenario 4:

Need automatic scaling without managing instances
👉 Use Aurora Serverless (ACUs)


14. Key Exam Tips (Very Important)

  • RCU = reads, WCU = writes
  • 4 KB read unit, 1 KB write unit
  • Eventually consistent reads cost less
  • On-Demand = flexible but more expensive
  • Provisioned = cheaper but requires planning
  • Auto Scaling = best balance
  • Hot partitions can cause throttling even with high capacity
  • Aurora Serverless uses ACUs, not RCUs/WCUs

15. Final Summary

Database capacity planning in AWS is about:

  • Matching performance needs with capacity units
  • Choosing the right scaling model
  • Avoiding over-provisioning and throttling
  • Using AWS features like Auto Scaling and On-Demand

Understanding how RCUs, WCUs, and ACUs work is essential to:

  • Design efficient systems
  • Reduce cost
  • Pass the SAA-C03 exam
Buy Me a Coffee