What if your database could magically handle any number of users without you worrying about it?
Why DynamoDB capacity modes (on-demand, provisioned) in AWS? - Purpose & Use Cases
Imagine you run a busy online store and you have to guess how many customers will visit each hour. You set up your database to handle that many shoppers manually. But some hours are quiet, and others are crazy busy. You have to keep changing settings all the time to keep up.
Manually adjusting database capacity is slow and tricky. If you guess too low, your store slows down or crashes. Guess too high, and you waste money paying for unused capacity. It's stressful and easy to make mistakes that hurt your business.
DynamoDB capacity modes let you choose how your database handles traffic automatically. On-demand mode adjusts instantly to any number of requests without you lifting a finger. Provisioned mode lets you set a steady capacity if you expect predictable traffic, saving money. Both take the guesswork and hassle away.
Update capacity settings every hour based on traffic reports
Set DynamoDB to on-demand mode and forget about capacity changesYou can focus on growing your app while DynamoDB smoothly handles any traffic spikes or quiet times without manual work.
A mobile game suddenly becomes popular overnight. With on-demand capacity, the database scales instantly to support millions of players without downtime or extra setup.
Manual capacity management is slow, error-prone, and costly.
DynamoDB capacity modes automate scaling to match your app's needs.
On-demand mode is great for unpredictable traffic; provisioned mode saves cost with steady traffic.
Practice
Solution
Step 1: Understand on-demand mode behavior
On-demand mode automatically adjusts capacity to meet traffic demands without manual input.Step 2: Compare with provisioned mode
Provisioned mode requires fixed capacity settings, unlike on-demand.Final Answer:
It automatically scales to handle any workload without manual capacity planning. -> Option BQuick Check:
On-demand = auto scaling without setup [OK]
- Confusing on-demand with provisioned fixed capacity
- Thinking on-demand limits requests
- Assuming on-demand is cheaper for steady workloads
Solution
Step 1: Recall provisioned capacity syntax
Provisioned mode requires specifying ReadCapacityUnits and WriteCapacityUnits inside ProvisionedThroughput.Step 2: Check options for correct JSON structure
{ "ProvisionedThroughput": { "ReadCapacityUnits": 5, "WriteCapacityUnits": 10 } } matches the correct AWS DynamoDB API format for provisioned throughput.Final Answer:
{ "ProvisionedThroughput": { "ReadCapacityUnits": 5, "WriteCapacityUnits": 10 } } -> Option CQuick Check:
ProvisionedThroughput with Read/Write units = correct syntax [OK]
- Using CapacityMode for provisioned capacity
- Missing ProvisionedThroughput wrapper
- Incorrect property names like ReadUnits
Solution
Step 1: Understand provisioned capacity limits
Provisioned mode limits throughput to the set capacity units (5 writes per second here).Step 2: Analyze effect of exceeding capacity
Sending 20 writes exceeds 5 units, causing throttling of excess requests.Final Answer:
Some write requests are throttled because they exceed the provisioned write capacity. -> Option AQuick Check:
Provisioned mode throttles excess requests [OK]
- Assuming automatic capacity increase in provisioned mode
- Thinking on-demand mode applies automatically
- Believing all requests always succeed
Solution
Step 1: Identify cause of throttling
Throttling occurs because provisioned capacity is too low for peak traffic.Step 2: Choose immediate fix without downtime
Increasing provisioned capacity units can be done live without deleting the table.Final Answer:
Increase the provisioned read and write capacity units. -> Option DQuick Check:
Increase capacity units to reduce throttling [OK]
- Deleting and recreating table causes downtime
- Assuming switching to on-demand is instant and free
- Reducing item size does not fix capacity limits
Solution
Step 1: Understand startup's needs
They want to avoid throttling during spikes and save cost during low usage.Step 2: Compare capacity modes for unpredictable traffic
On-demand mode charges per request and auto scales instantly, ideal for unpredictable spikes.Step 3: Evaluate other options
Provisioned with auto scaling helps but requires setup and may lag; fixed capacity risks throttling or cost waste.Final Answer:
On-demand mode because it charges per request and scales instantly without manual setup. -> Option AQuick Check:
Unpredictable traffic = on-demand mode best [OK]
- Choosing fixed provisioned capacity for unpredictable traffic
- Assuming auto scaling is instant and always perfect
- Thinking on-demand has fixed request limits
Ready to prove it?
Pass the test and this pattern moves unknown
