0
0
AWScloud~10 mins

DynamoDB capacity modes (on-demand, provisioned) in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - DynamoDB capacity modes (on-demand, provisioned)
Start
Choose Capacity Mode
On-Demand
Auto scales
Pay per request
Handle Traffic
End
You start by choosing a capacity mode. On-demand mode automatically handles traffic and charges per request. Provisioned mode requires setting capacity units and monitoring usage.
Execution Sample
AWS
CreateTable(
  CapacityMode='ON_DEMAND'
)

UpdateTable(
  CapacityMode='PROVISIONED',
  ReadCapacityUnits=5,
  WriteCapacityUnits=5
)
This code creates a DynamoDB table first with on-demand mode, then updates it to provisioned mode with 5 read and write units.
Process Table
StepActionCapacity ModeRead UnitsWrite UnitsBillingResult
1Create tableON_DEMANDN/AN/APay per requestTable created with on-demand mode
2Traffic startsON_DEMANDN/AN/AAuto scalesHandles any traffic automatically
3Update tablePROVISIONED55Pay per capacity unitTable updated to provisioned mode
4Traffic continuesPROVISIONED55Fixed capacity billingUses set capacity units, throttles if exceeded
5Adjust capacityPROVISIONED1010Updated billingCapacity units increased to handle more traffic
6Traffic spikes beyond capacityPROVISIONED1010Throttling occursRequests above capacity are throttled
7Switch back to on-demandON_DEMANDN/AN/APay per requestTable switches back to on-demand mode
8Traffic spikesON_DEMANDN/AN/AAuto scalesHandles spikes without throttling
9End----Capacity mode choice affects billing and scaling
💡 Execution ends after switching modes and handling traffic with different billing and scaling behaviors.
Status Tracker
VariableStartAfter Step 1After Step 3After Step 5After Step 7Final
CapacityModeNoneON_DEMANDPROVISIONEDPROVISIONEDON_DEMANDON_DEMAND
ReadUnitsNoneN/A510N/AN/A
WriteUnitsNoneN/A510N/AN/A
BillingNonePay per requestPay per capacity unitUpdated billingPay per requestPay per request
Key Moments - 3 Insights
Why does the ReadUnits value show 'N/A' in on-demand mode?
In on-demand mode, you don't set read or write units because DynamoDB automatically handles capacity. This is shown in execution_table rows 1 and 2 where ReadUnits is 'N/A'.
What happens if traffic exceeds provisioned capacity units?
When traffic goes beyond provisioned units, requests get throttled as shown in step 6 of the execution_table. This means some requests are delayed or rejected until capacity is increased.
How does billing differ between on-demand and provisioned modes?
On-demand billing charges per request automatically (rows 1,2,8). Provisioned billing charges based on set capacity units regardless of usage (rows 3,4,5).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the CapacityMode after step 5?
AN/A
BON_DEMAND
CPROVISIONED
DUNKNOWN
💡 Hint
Check the CapacityMode column in execution_table row for step 5.
At which step does throttling occur due to traffic exceeding capacity?
AStep 4
BStep 6
CStep 2
DStep 8
💡 Hint
Look for 'Throttling occurs' in the Result column of execution_table.
If you switch from provisioned to on-demand mode, what happens to ReadUnits and WriteUnits?
AThey become N/A
BThey stay the same
CThey reset to zero
DThey double
💡 Hint
Check variable_tracker values after step 7 for ReadUnits and WriteUnits.
Concept Snapshot
DynamoDB Capacity Modes:
- On-Demand: No capacity units set, auto scales, pay per request.
- Provisioned: Set read/write units, fixed billing, may throttle if exceeded.
- Switch modes anytime to balance cost and performance.
- Monitor usage to adjust provisioned units as needed.
Full Transcript
This visual execution shows how DynamoDB capacity modes work. You start by creating a table in on-demand mode, which automatically scales and charges per request. Then you update the table to provisioned mode, setting fixed read and write capacity units. Traffic is handled within these limits, and if exceeded, throttling occurs. You can adjust capacity units to handle more traffic. Switching back to on-demand removes capacity limits and throttling, charging per request again. The execution table tracks each step, showing capacity mode, units, billing, and results. Variable tracker shows how capacity mode and units change over time. Key moments clarify common confusions about capacity units in on-demand mode, throttling in provisioned mode, and billing differences. The quiz tests understanding of these execution steps. This helps beginners see how capacity modes affect DynamoDB behavior and cost.