DynamoDB interview question · Most asked
What causes throttling in DynamoDB, and how should clients handle it?
Summary
Throttling happens when requests exceed provisioned capacity, a partition's limits (hot keys), on-demand scaling limits during a sudden surge, or a GSI's capacity (which back-pressures writes to the table). Clients receive ProvisionedThroughputExceededException or ThrottlingException and should retry with exponential backoff and jitter, which AWS SDKs do automatically.
Longer Answer
Diagnose with CloudWatch metrics (ThrottledRequests, consumed versus provisioned capacity) and Contributor Insights for hot keys. Fixes: better key distribution, higher capacity or on-demand mode, caching, smoothing batch jobs with rate limiting, and sizing GSIs properly. Make sure your own retry layer does not stack on top of the SDK's retries and multiply load.
Key Points
- Capacity, hot partitions, surges, GSIs.
- Exponential backoff with jitter.
- CloudWatch + Contributor Insights.
- Do not double-retry.
More most-asked DynamoDB questions
- What are DynamoDB Streams, and how are they used?
- Query or Scan: what is the difference, and why avoid Scan?
- What is DynamoDB, and what workloads is it a good fit for?
- What is a hot partition, and how do you avoid one?
- How do you approach data modelling in DynamoDB, and how is it different from relational design?
- Explain partition keys, sort keys and the two kinds of primary key.
- Global secondary index or local secondary index: what is the difference?
- How do conditional writes work, and how do you implement optimistic locking in DynamoDB?