How DynamoDB provisions throughput of reads independently of writes
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Amazon DynamoDB, a fully managed NoSQL database service provided by Amazon Web Services (AWS), is designed to deliver fast, reliable performance with seamless scalability. One of the standout features of DynamoDB is how it provisions throughput for read and write operations independently. This structure allows users to scale and manage database operations efficiently to meet specific application demands.
Understanding Read and Write Throughput
DynamoDB provisions throughput in terms of read capacity units (RCUs) and write capacity units (WCUs).
- Read Capacity Unit (RCU): Each RCU provides up to two eventually consistent reads per second for items up to 4 KB in size. For strongly consistent reads, you will need two RCUs for the same item size and frequency.
- Write Capacity Unit (WCU): Each WCU allows for one write per second for an item up to 1 KB in size.
This provisioning allows you to tailor your database's performance according to the specific demands of read and write operations, which may not always be symmetrical. For instance, a user-facing application might require high read performance during peak access times, while backend operations may have bulk write needs during off-peak hours.
Configuring Throughput Capacity
When setting up a DynamoDB table, the initial step involves specifying the required WCUs and RCUs based on anticipated workloads. DynamoDB offers two modes for managing throughput:
- Provisioned Mode: You specify the number of reads and writes per second you expect your application to require.
- On-Demand Mode: DynamoDB automatically scales to accommodate varying traffic, charging for the reads and writes your application performs without capacity planning.
The right choice depends on your application needs and traffic predictability. Provisioned mode is cost-effective for predictable workloads, while on-demand mode can handle unpredictable or sporadic workloads without manual intervention.
Technical Example: Provisioning Throughput
Consider an application that primarily performs read operations in the morning and write operations at night. To optimize cost and performance, you could initially provision a higher RCU in the morning and then programmatically switch to a higher WCU at night using the AWS SDK or API.
For example, if your morning read pattern requires 100 RCUs and your night-time write pattern requires 50 WCUs, your table's settings need to be adjusted accordingly at corresponding times.
Auto Scaling
DynamoDB can also automatically adjust your table's throughput in response to actual traffic patterns using DynamoDB Auto Scaling. Here, you set target utilization thresholds and maximum/minimum capacities for your read and write capacity units. DynamoDB adjusts the capacities within these bounds to maintain the efficiency and performance of your operations.
Pricing Considerations
Pricing for read and write throughput is separate, allowing businesses to optimally allocate resources based on specific workloads and budgetary considerations. Cost calculations are typically based on the number of WCUs and RCUs provisioned, with additional costs for data storage and data transfer out of AWS. The separate provisioning thus offers not only technical performance benefits but also financial management advantages.
Summary Table
| Factor | Description | Consideration |
| RCU & WCU | Provision read (RCU) and write (WCU) units separately to meet distinct application requirements. | Scale based on specific read/write requirements. |
| Configuration Mode | Choose between provisioned and on-demand modes based on workload predictability. | Cost optimization and handling varying traffic. |
| Auto Scaling | Automate scaling of RCUs and WCUs with DynamoDB Auto Scaling. | Efficiency under dynamically changing workloads. |
| Cost | Separate billing for read and write operations. | Financial planning and resource allocation. |
Conclusion
The ability to separately provision read and write capacities in DynamoDB gives users granular control over database performance and cost. Whether managing bulk data uploads or handling high query volumes, DynamoDB's flexible throughput provisioning ensures that database performance aligns tightly with user demands and application requirements, marking it as a robust solution for modern scalable applications.

