Study Guide860 words

Database Capacity Planning: Mastering RCUs, WCUs, and RDS Scaling

Database capacity planning (for example, capacity units)

Database Capacity Planning

This guide covers the essential knowledge required for the SAA-C03 exam regarding database performance and capacity planning, focusing heavily on Amazon DynamoDB throughput and RDS storage optimization.

Learning Objectives

  • Calculate Read Capacity Units (RCUs) and Write Capacity Units (WCUs) for DynamoDB based on item size and consistency models.
  • Differentiate between relational (RDS) and non-relational (DynamoDB) capacity planning strategies.
  • Select appropriate RDS instance classes and storage types (Provisioned IOPS vs. General Purpose).
  • Evaluate the impact of read consistency on performance and cost.

Key Terms & Glossary

  • RCU (Read Capacity Unit): A measure of throughput in DynamoDB. 1 RCU = 1 strongly consistent read per second for an item up to 4 KB.
  • WCU (Write Capacity Unit): A measure of throughput in DynamoDB. 1 WCU = 1 write per second for an item up to 1 KB.
  • Strongly Consistent Read: Returns the most up-to-date data by reflecting all successful previous writes. Consumes more RCUs.
  • Eventually Consistent Read: Maximizes read throughput but might not reflect a recently completed write. Consumes 50% fewer RCUs than strongly consistent reads.
  • Provisioned IOPS (io1/io2): RDS storage designed for I/O intensive workloads, providing low-latency and consistent throughput.

The "Big Idea"

Capacity planning in the cloud shifts from server-based thinking (how much RAM do I need?) to throughput-based thinking (how many operations per second do I need?). For relational databases like RDS, you scale by picking the right instance "size." For NoSQL like DynamoDB, you scale by defining the specific volume of data flowing in and out per second.

Formula / Concept Box

Operation TypeItem Size IncrementThroughput Equivalent
Strongly Consistent Read4 KB1 RCU per second
Eventually Consistent Read4 KB0.5 RCU per second
Transactional Read4 KB2 RCU per second
Standard Write1 KB1 WCU per second
Transactional Write1 KB2 WCU per second

[!IMPORTANT] Always round up the item size to the next increment (4 KB for reads, 1 KB for writes) before performing the math.

Hierarchical Outline

  1. DynamoDB Throughput Planning
    • Read Capacity (RCU): Depends on consistency and size.
    • Write Capacity (WCU): Depends on size (writes are always 1 KB increments).
  2. RDS Capacity Factors
    • Instance Classes: Standard (M), Memory Optimized (R), and Burstable (T).
    • Storage Tiers: SSD-backed (gp2/gp3, io1/io2) vs. HDD-backed (st1, sc1).
  3. Scaling Strategies
    • Read Replicas: Offload read traffic from the primary instance.
    • RDS Proxy: Efficiently manage high volumes of database connections.

Visual Anchors

DynamoDB Capacity Decision Flow

Loading Diagram...

Visualization of Data Block Units

Compiling TikZ diagram…
Running TeX engine…
This may take a few seconds

Definition-Example Pairs

  • Bursting (T-Instances): The ability for a database to consume "CPU credits" to handle spikes.
    • Example: A small blog that has low daily traffic but spikes when a new post is shared on social media.
  • Read Replicas: Asynchronous copies of the primary database.
    • Example: A reporting application that runs heavy analytics queries without slowing down the customer-facing checkout database.
  • Provisioned IOPS: Storage specifically bought to guarantee a certain number of I/O operations.
    • Example: A high-frequency trading platform where every millisecond of database latency translates to lost revenue.

Worked Examples

Example 1: Calculating RCUs

Problem: You need to read 11 KB of data per second using Strongly Consistent reads. How many RCUs do you need?

Solution:

  1. Take the item size: 11 KB.
  2. Divide by 4 KB (the RCU increment): $11 / 4 = 2.75$.
  3. Round up to the nearest whole number: 3.
  4. Since it is strongly consistent, 1 unit = 1 RCU.
  5. Answer: 3 RCUs.

Example 2: Calculating WCUs

Problem: You perform 10 writes per second. Each item is 2.5 KB. How many WCUs are required?

Solution:

  1. Take the item size: 2.5 KB.
  2. Round up to the nearest 1 KB increment: 3 KB.
  3. Calculate units per write: $3 KB / 1 KB = 3$ WCUs per write.
  4. Multiply by operations per second: $3 \times 10 = 30$.
  5. Answer: 30 WCUs.

Checkpoint Questions

  1. How many RCUs are consumed by an Eventually Consistent read of a 6 KB item?
  2. What is the primary difference between RDS Multi-AZ and Read Replicas regarding write replication?
  3. Which RDS storage type is most cost-effective for large, infrequently accessed sequential data?
  4. If an item is 3.5 KB, how many WCUs does it consume for a single write?
Click to see answers
  1. 1 RCU. (6 KB rounds up to 8 KB / 4 KB increment = 2. Eventually consistent is 50%, so $2 \times 0.5 = 1$).
  2. Multi-AZ uses synchronous replication (high availability); Read Replicas use asynchronous replication (scaling).
  3. st1 (Throughput Optimized HDD).
  4. 4 WCUs. (3.5 KB rounds up to 4 KB. 1 WCU per 1 KB).

Ready to study AWS Certified Solutions Architect - Associate (SAA-C03)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free