Vibe monitoring with Last9 MCP: Ask your agent to fix production issues! Setup →
Last9 Last9

Feb 17th, ‘25 / 11 min read

What is DynamoDB Throttling and How to Fix It

DynamoDB throttling occurs when requests exceed table capacity. Learn how to identify, prevent, and resolve throttling issues effectively.

What is DynamoDB Throttling and How to Fix It

When you're working with DynamoDB, one of the most critical things you need to keep an eye on is throttling. If you're not careful, throttling can severely impact your database's performance. It’s not just about slower response times—throttling can lead to system failures or unexpected downtime if not addressed properly.

In this guide, we’ll take a closer look at throttling in DynamoDB—why it happens, how it affects your database, and, most importantly, what you can do to avoid or resolve it.

What is Throttling?

Throttling in DynamoDB occurs when the number of read or write requests exceeds the table’s capacity to handle them. This is often due to a spike in traffic or inefficient resource use.

In provisioned capacity mode, tables are assigned specific read capacity units (RCUs) and write capacity units (WCUs) to define throughput limits. When these limits are exceeded, DynamoDB throttles incoming requests, causing them to be delayed or rejected until capacity is available again.

Example:
Imagine you have a DynamoDB table with a provisioned capacity of 10 RCUs and 5 WCUs. If your application sends 20 read requests and 10 write requests within a second, it will exceed the provisioned throughput. DynamoDB will throttle the extra requests, leading to delays or errors in your application.

If your application sends more requests than the table can handle (e.g., from high traffic or inefficient access patterns), throttling kicks in to prevent the database from being overwhelmed. While this helps protect the system, it can lead to delays or failures if not addressed promptly.

💡
For more insights on handling performance issues in Kubernetes, check out our guide on Kubernetes CPU throttling and how to mitigate related challenges.

How Throttled Requests Affect Your DynamoDB Performance

So, what exactly happens when a request is throttled? Let’s break it down:

Imagine you’ve designed your DynamoDB table with a certain level of provisioned throughput based on what you expect in terms of traffic. However, if your application suddenly experiences a burst of API calls (perhaps due to a seasonal promotion, new feature, or viral traffic spike), you might exceed your table's capacity.

This is where throttling comes into play. If DynamoDB can’t process the number of requests within the limits, it will start rejecting or delaying some of the requests. The impact?

Well, you may experience latency issues—responses take longer to arrive. For APIs, this means your calls might time out or get an error, leaving users frustrated.

This problem can be more severe in use cases that involve high write throughput or complex queries that target multiple attributes with high cardinality.

For example, if you have a table with uneven sharding or poor partition key design, DynamoDB might struggle to evenly distribute the load, resulting in "hot" partitions. Hot partitions are essentially partitions that get too much traffic, causing throttling on that specific partition while the rest of the table may be under-utilized.

Moreover, when throttling occurs at the table level, it affects all queries and writes to that table. It’s not just a matter of one user’s request being delayed; it can lead to widespread delays for all users or even failed transactions, which may negatively impact your service’s availability.

What is the Maximum Throughput in DynamoDB?

DynamoDB offers two types of capacity modes for handling throughput:

  • Provisioned Mode: In this mode, you manually set the read and write capacity units for your table. This approach gives you precise control over capacity but requires you to adjust it based on workload changes.
  • On-Demand Mode: Here, DynamoDB automatically adjusts throughput based on traffic volume. This removes the need to manually scale, but there are still burst limits that can trigger throttling if the system is overwhelmed in a short time.
💡
For a deeper dive into monitoring performance, check out our guide on AWS CloudWatch custom metrics and how to set them up effectively.

Read Capacity Units (RCU) vs Write Capacity Units (WCU)

When using DynamoDB in provisioned capacity mode, you define how much throughput (in terms of reads and writes) your table can handle. This is where Read Capacity Units (RCU) and Write Capacity Units (WCU) come in—they determine the capacity of your DynamoDB table to handle read and write requests.

Properly sizing these units is crucial to ensuring your table operates smoothly and doesn’t experience throttling.

Let’s break down what RCUs and WCUs mean in more detail and how they impact the performance of your DynamoDB table.

Read Capacity Units (RCUs)

A Read Capacity Unit (RCU) is a measure of throughput for read operations in DynamoDB. The number of RCUs you allocate determines how much read traffic your table can handle at any given time. The actual number of reads that an RCU can support depends on whether your application uses strongly consistent reads or eventually consistent reads.

  • One RCU allows for one strongly consistent read request of up to 4 KB of data per second.
  • One RCPU allows for two eventually consistent reads (which are more efficient and cheaper) of the same 4 KB of data per second.

Strongly Consistent Reads vs. Eventually Consistent Reads

  • Strongly Consistent Reads: This ensures that the data returned is the most up-to-date version, reflecting all writes that were made to the database before the read request.
    • Example: If you query a table for the latest user profile, a strongly consistent read ensures you get the current data.
  • Eventually Consistent Reads: This type of read may return stale data but is faster and costs fewer RCUs. The data may take some time to propagate across all replicas of the table, meaning you might not always get the most recent changes immediately.
    • Example: In a scenario where it's acceptable to get some level of outdated information (like product listings), eventually consistent reads can help reduce costs and improve speed.

How this affects your application

When you use strong consistency, you'll consume more RCUs per read compared to eventual consistency. So, if you know that your application doesn’t require up-to-the-minute accuracy for every read, you can opt for eventually consistent reads to minimize RCU usage and avoid throttling.

💡
To explore more about serverless solutions, take a look at our guide on OpenSearch Serverless and its benefits for scalable applications.

Write Capacity Units (WCUs)

A Write Capacity Unit (WCU) is a measure of throughput for write operations in DynamoDB. The number of WCUs you allocate determines how much write traffic your table can handle at any given time.

  • One WCU allows for one write request of up to 1 KB of data per second.

Write Operations

Write operations in DynamoDB are simple but can be a bit tricky to scale if your data grows quickly. For example, inserting an item into a table with attributes like a name, address, and phone number (less than 1 KB) will consume one WCU. If your write request is larger than 1 KB, it will consume more WCUs. For example:

  • A 2 KB write request would consume 2 WCUs.
  • A 3 KB write request would consume 3 WCUs.

How to Properly Size WCUs for Your Application

Properly sizing your WCUs is key to ensuring that your database can handle the volume of writes without throttling. If your table is being updated frequently (for example, in an application with heavy write traffic, like user posts, product reviews, etc.), you’ll need to allocate more WCUs to avoid running into bottlenecks.

The Right Way to Size RCUs and WCUs for Your Table

Both RCUs and WCUs determine the throughput limits for your table. If the traffic—whether read or write—exceeds the allocated units, DynamoDB will throttle your requests to ensure that your table doesn’t become overloaded.

This can result in delays, timeouts, or failures in your API calls, which ultimately impact your application's performance and user experience.

  • Under-provisioning RCUs or WCUs: If you don’t allocate enough capacity for your table’s needs, you’ll quickly encounter throttling, especially during peak traffic times. For example, if your application is read-heavy or write-heavy, you’ll see degraded performance or failed requests.
  • Over-provisioning RCUs or WCUs: On the flip side, if you over-provision your capacity, you might end up paying for more resources than you need, resulting in unnecessary costs.
💡
For more on securing your applications, check out our guide on Getting Started with AWS WAF to protect your web resources.

How to Avoid Throttling

To prevent throttling, it’s important to:

  • Monitor Usage with CloudWatch or Third-Party Tools: Use tools like Amazon CloudWatch or monitoring tools like Last9 to track read and write capacity usage in real-time. This helps you identify when you’re nearing capacity and need to scale.
  • Estimate Traffic Patterns and Prepare for Spikes: Understand your application’s usage patterns and traffic spikes. For example, if your application’s traffic grows unexpectedly during certain events or periods (e.g., product launches, sales), be proactive and adjust your throughput accordingly.
  • Consider On-Demand Mode for Unpredictable Traffic: If traffic patterns are unpredictable or you want to avoid the hassle of managing capacity manually, DynamoDB on-demand mode automatically adjusts throughput to accommodate sudden traffic spikes. However, even with on-demand, you may still encounter limits under extreme load, so always monitor closely.

Key Challenges and Limitations When Using DynamoDB

Limitations and Issues

DynamoDB, while powerful, comes with several limitations that can lead to throttling issues:

  • Latency and Performance: In high-throughput environments, DynamoDB can experience latency when throttling is triggered, especially in a provisioned mode where scaling is manual.
  • Hot Partitions and Uneven Workloads: DynamoDB divides data into partitions. If a disproportionate amount of requests is directed to one partition key (e.g., a frequently queried attribute), it can become “hot,” causing throttling on that partition, even though other partitions may be underutilized.

Impact of Hot Partitions and Uneven Workloads on Throughput

Hot partitions are a common problem in DynamoDB, where a single partition receives an overwhelming amount of read or write traffic. This can lead to throttling despite overall table capacity being underutilized. Ensuring your data is evenly distributed across partitions is crucial to mitigating this issue.

💡
To learn more about tracking and auditing AWS activities, check out our comprehensive AWS CloudTrail guide.

How to Resolve Throttling and Hot Partition Issues

1. Managing Hot Partitions with Partition Key Strategies

Hot partitions occur when traffic is concentrated on a single partition, causing throttling. To prevent this:

  • Choose High Cardinality Keys: Use partition keys with many unique values (e.g., user IDs) to distribute traffic evenly across partitions.
  • Avoid Sequential or Time-Based Keys: Keys like timestamps or sequential IDs can cause traffic to concentrate on a few partitions. Instead, opt for more random values to spread traffic.
  • Design for Randomness: Add random suffixes to keys or combine multiple attributes (e.g., user ID + random number) to promote even distribution.

2. Role of Adaptive Capacity and Auto-Scaling

DynamoDB has built-in features to help resolve throttling and hot partition issues:

  • Adaptive Capacity: Automatically redistributes traffic when a partition is overloaded, ensuring even distribution across partitions. This helps prevent one partition from becoming a bottleneck.
  • Auto-Scaling: Dynamically adjusts the throughput of your DynamoDB table based on demand. During traffic spikes, auto-scaling increases throughput, and it scales down when traffic decreases, helping to save costs.

3. Provisioned vs. On-Demand Capacity

  • Provisioned Capacity with Auto-Scaling: Ideal for predictable workloads where you can define scaling policies.
  • On-Demand Capacity: Perfect for unpredictable workloads. DynamoDB adjusts throughput automatically without manual intervention.

How to Monitor Your DynamoDB Performance in Real Time

1. Utilizing Amazon CloudWatch for Monitoring Throughput and Throttling

CloudWatch is an essential tool for tracking DynamoDB performance. Key metrics to monitor:

  • ConsumedReadCapacityUnits (RCU): Measures the read capacity usage.
  • ConsumedWriteCapacityUnits (WCU): Measures the write capacity usage.
  • ProvisionedReadCapacityUnits (RCU): Indicates the provisioned read capacity.
  • ProvisionedWriteCapacityUnits (WCU): Indicates the provisioned write capacity.

2. Importance of CloudWatch Alarms and Contributor Insights

  • CloudWatch Alarms: Set alarms on key metrics (like RCUs and WCUs) to proactively identify when throttling events are likely. This helps catch issues early and allows you to adjust capacity before it impacts your application.
  • Contributor Insights: This feature helps track the root causes of throttling, showing whether the issue is from traffic spikes, partitioning issues, or other bottlenecks. It gives you deeper insights to help resolve problems faster.
💡
For tips on optimizing your monitoring costs, check out our guide on how to cut down AWS CloudWatch costs.

On-Demand vs. Provisioned Capacity to Manage Throttling

Choosing between on-demand and provisioned capacity depends on your traffic patterns:

  • On-Demand Capacity: Ideal for unpredictable or fluctuating workloads. With on-demand, DynamoDB automatically adjusts throughput to handle sudden traffic spikes, so you don’t need to manually manage capacity.
  • Provisioned Capacity: Best for predictable and steady workloads. Provisioned mode allows you to set specific read and write capacity units, giving you more control over throughput. Plus, you can save costs by adjusting capacity to match your consistent traffic.

Benefits of DynamoDB Auto Scaling and Global Secondary Indexes (GSI)

1. DynamoDB Auto Scaling

  • Automatic Capacity Adjustment: Auto-scaling automatically adjusts your table’s capacity based on actual demand, reducing the need for manual capacity management.
  • Efficiency: This feature ensures your table can handle sudden traffic spikes without hitting capacity limits or experiencing throttling.

2. Global Secondary Indexes (GSI)

  • Improved Query Flexibility: GSIs allow you to query data using different partition keys, giving you more flexible access patterns.
  • Reduced Throttling Risk: By enabling queries on alternate keys, GSIs can help reduce hot partitions and balance traffic, lowering the risk of throttling.

How Can DAX and Lambda Improve DynamoDB Performance?

1. Integration with DynamoDB Accelerator (DAX) for Reduced Latency

  • DAX Overview: DynamoDB Accelerator (DAX) is a fully managed, in-memory cache that speeds up read operations for DynamoDB.
  • Benefits: DAX helps reduce read latency and offloads pressure from your DynamoDB tables. It’s especially useful for read-heavy applications and can mitigate throttling by decreasing the number of read requests hitting the database.

2. Utilizing AWS SDK and Lambda for Optimized Write Operations

  • Batching Write Requests: The AWS SDK and Lambda functions allow you to batch write requests or use exponential backoff and retries. This reduces the frequency of throttling events, especially in high-traffic situations.
  • Optimizing Traffic: Controlling write traffic more efficiently helps reduce the likelihood of overwhelming your DynamoDB table’s throughput capacity.
💡
For a deeper understanding of cloud security, check out our guide on AWS CSPM and how it helps manage risks.

Best Practices for Avoiding Throttling

To prevent throttling in DynamoDB and ensure your application remains responsive, consider these strategies:

  • Regularly monitor your tables and indexes using CloudWatch.
  • Design your partition keys to ensure an even distribution of traffic across partitions.
  • Use auto-scaling to adjust capacity dynamically based on your workload.
  • Consider implementing DAX for caching to reduce read load.
  • Optimize your write operations using AWS SDK or Lambda functions.

Conclusion:

Finally, regularly analyzing your workload patterns and adjusting your capacity settings ensures that your DynamoDB instance can handle future traffic spikes without compromising performance. With the right strategies and tools in place, throttling can be minimized, leading to a more reliable and efficient application.

💡
And if you'd like to continue the conversation, feel free to join our community on Discord. We have a dedicated channel where you can discuss your specific use case with fellow developers.

FAQs

  1. What causes throttling in DynamoDB?
    Throttling occurs when the number of read or write requests exceeds the allocated throughput capacity (RCUs and WCUs) for a DynamoDB table. This can happen due to high traffic or inefficient resource usage.
  2. How can I monitor throttling in DynamoDB?
    You can monitor throttling using Amazon CloudWatch metrics like ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits. CloudWatch alarms can notify you when your table exceeds its throughput limits.
  3. What happens when throttling occurs in DynamoDB?
    When throttling occurs, DynamoDB temporarily blocks or delays requests that exceed the capacity. This can result in increased latency or errors in your application if not addressed.
  4. How can I prevent throttling in DynamoDB?
    To prevent throttling, you should monitor usage, estimate traffic spikes, and consider using auto-scaling or on-demand capacity mode. Also, design your access patterns and partition keys to distribute traffic evenly.
  5. What’s the difference between provisioned and on-demand capacity in DynamoDB?
    Provisioned capacity allows you to set a specific number of RCUs and WCUs, while on-demand capacity automatically adjusts throughput to handle sudden traffic spikes. On-demand is ideal for unpredictable workloads, while provisioned works best for consistent traffic.
  6. How does auto-scaling help with throttling?
    Auto-scaling automatically adjusts the provisioned throughput based on traffic demand, reducing the chances of throttling. This is useful when your traffic fluctuates, and you want to maintain optimal performance without manual intervention.
  7. Can throttling affect write operations in DynamoDB?
    Yes, throttling can affect both read and write operations. If your write throughput exceeds the allocated WCUs, write requests will be delayed or rejected until capacity is available, impacting your application's ability to save data.

Contents


Newsletter

Stay updated on the latest from Last9.

Authors
Anjali Udasi

Anjali Udasi

Helping to make the tech a little less intimidating. I love breaking down complex concepts into easy-to-understand terms.