Copyright (c) 2025 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

3.1.3.3. DynamoDB Capacity Planning

šŸ’” First Principle: DynamoDB capacity planning provisions Read Capacity Units (RCUs) and Write Capacity Units (WCUs) to meet application throughput, ensuring consistent low-latency performance and optimizing costs.

Amazon DynamoDB is a fully managed NoSQL database service that delivers single-digit millisecond performance at any scale. To achieve this, you define your table's throughput capacity in terms of Read Capacity Units (RCUs) and Write Capacity Units (WCUs).

Key Concepts:
  • "Read Capacity Units (RCUs)": An RCU represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4KB in size.
  • "Write Capacity Units (WCUs)": A WCU represents one write per second for an item up to 1KB in size.
  • "Provisioned Capacity Mode": You specify the number of RCUs and WCUs your application needs. Use DynamoDB Auto Scaling to adjust these automatically based on actual utilization.
  • "On-Demand Capacity Mode": DynamoDB automatically adjusts its capacity based on your workload, only charging for actual reads and writes. Ideal for unpredictable workloads.

Scenario: For unpredictable e-commerce traffic, on-demand capacity simplifies scaling; for stable user profiles, provisioned capacity with Auto Scaling optimizes cost and performance.

Visual: DynamoDB Capacity Modes
Loading diagram...

āš ļø Common Pitfall: Over-provisioning capacity in "Provisioned mode". This leads to wasted costs for unused RCUs/WCUs. Use "DynamoDB Auto Scaling" to dynamically adjust capacity.

Key Trade-Offs:
  • Predictability/Lower Unit Cost ("Provisioned") vs. Simplicity/Flexibility ("On-Demand"): "Provisioned mode" is more cost-effective for stable workloads. "On-Demand" is simpler for unpredictable workloads but can be more expensive per unit.

Reflection Question: How does choosing between on-demand and provisioned capacity modes for Amazon DynamoDB impact both performance consistency and operational cost for varying workload patterns (e.g., stable vs. unpredictable)?