What is the difference between DynamoDB on-demand and provisioned capacity modes?
On-demand charges per request and scales automatically, good for unpredictable traffic. Provisioned lets you set read and write capacity units, often cheaper for steady traffic, and can use auto scaling.
Explain it simply
On-demand is paying per auto-rickshaw ride: no commitment, you pay for each trip. Provisioned is paying a monthly bus pass: cheaper if you travel daily and predictably, but you waste money if you do not travel and get stuck if more people join than the pass covers.
Example
On-demand
Pay per read and write request
No capacity planning; handles sudden spikes
Best for: new apps, spiky or unknown traffic
Provisioned
You set RCU (reads/s) and WCU (writes/s)
Optional auto scaling between min and max
Best for: steady, predictable traffic
Exceeding capacity -> throttling (ProvisionedThroughputExceeded)
Capacity unit sizes
1 RCU = one strongly consistent read of up to 4 KB per second
1 WCU = one write of up to 1 KB per secondYou can switch a table between modes, but AWS limits how often. A common pattern is to start on-demand while traffic is unknown, then move to provisioned with auto scaling when the pattern is stable and cost matters.
Reserved capacity is available for provisioned tables with long-term commitment.
What to say in the interview
"On-demand is pay-per-request with no planning, ideal for unpredictable load. Provisioned needs RCU and WCU settings and is cheaper for steady traffic, with throttling if I exceed it. I start on-demand and move to provisioned once traffic is predictable."
Common mistakes
- Forgetting that provisioned tables throttle when capacity is exceeded.