Bird
Raised Fist0
DynamoDBquery~10 mins

On-demand vs provisioned cost comparison in DynamoDB - Visual Side-by-Side Comparison

Choose your learning style10 modes available
Concept Flow - On-demand vs provisioned cost comparison
Start
↓
Choose Workload Type
↓
On-demand Pricing
↓
Calculate Cost
↓
Compare Costs
↓
Decision: Which is cheaper?
↓
End
This flow shows how to compare costs by choosing workload type, calculating costs for on-demand and provisioned modes, then deciding which is cheaper.
Execution Sample
DynamoDB
SELECT workload_type, cost
FROM dynamodb_costs
WHERE workload_type IN ('on-demand', 'provisioned')
ORDER BY cost ASC;
This query retrieves and orders DynamoDB costs for on-demand and provisioned workloads to compare them.
Execution Table
StepWorkload TypeRead Capacity Units (RCU)Write Capacity Units (WCU)Requests per secondCost CalculationCost Result
1On-demandN/AN/A1000Cost = 1.8M req/hr * $0.25/M (read) + 1.8M req/hr * $1.25/M (write)$2.70
2Provisioned5005001000Cost = (RCU * $0.00013) + (WCU * $0.00065)$0.39
3Compare---Provisioned cheaper than On-demandChoose Provisioned
4End---Comparison complete-
💡 Comparison ends after calculating and comparing both costs.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Workload TypeNoneOn-demandProvisionedProvisionedProvisioned
Cost0$2.70$0.39$0.39$0.39
Key Moments - 2 Insights
Why does On-demand cost more even with the same request rate?
On-demand charges per request without reserved capacity, so costs scale directly with usage (see execution_table row 1). Provisioned reserves capacity at a lower unit price (row 2).
What happens if request rate is lower than provisioned capacity?
Provisioned cost stays the same regardless of usage, so if requests are low, you pay for unused capacity (not shown in table but implied by provisioned pricing).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the cost result for On-demand pricing at step 1?
A$0.39
B$2.70
C$0.75
D$1.50
💡 Hint
Check the 'Cost Result' column in row 1 of execution_table.
At which step does the comparison decide which pricing is cheaper?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look for the row where costs are compared and a choice is made (execution_table row 3).
If the request rate doubles, which cost is likely to increase more?
AOn-demand cost
BProvisioned cost
CBoth increase equally
DNeither increases
💡 Hint
On-demand cost scales with requests (see execution_table row 1), provisioned cost is fixed by capacity.
Concept Snapshot
On-demand pricing charges per request, good for unpredictable workloads.
Provisioned pricing reserves capacity, cheaper for steady workloads.
Calculate costs by multiplying usage by unit prices.
Compare costs to choose the best option.
Provisioned cost is fixed; On-demand scales with usage.
Full Transcript
This visual execution compares DynamoDB On-demand and Provisioned pricing. First, we select the workload type. On-demand pricing charges per request, so cost scales with usage. Provisioned pricing reserves capacity at a fixed cost. We calculate costs for both using example rates: 1000 requests per second. On-demand cost is $2.70, provisioned cost is $0.39. Comparing costs shows provisioned is cheaper for steady high usage. Key points: On-demand is flexible but can be costly at scale; provisioned is cost-effective for predictable workloads. This helps decide which pricing model to use.

Practice

(1/5)
1. Which DynamoDB billing mode charges you only for the read and write requests you actually use, without any upfront capacity planning?
easy
A. Provisioned mode
B. Reserved mode
C. On-demand mode
D. Manual mode

Solution

  1. Step 1: Understand billing modes in DynamoDB

    DynamoDB offers two main billing modes: on-demand and provisioned. On-demand charges per request without pre-allocating capacity.
  2. Step 2: Identify the mode with no upfront capacity planning

    On-demand mode does not require capacity planning and bills you based on actual usage.
  3. Final Answer:

    On-demand mode -> Option C
  4. Quick Check:

    On-demand charges per request = On-demand mode [OK]
Hint: On-demand means pay per request, no setup needed [OK]
Common Mistakes:
  • Confusing provisioned mode as pay-per-request
  • Thinking reserved mode exists in DynamoDB billing
  • Assuming manual mode is a billing option
2. Which of the following is the correct way to specify provisioned capacity in a DynamoDB table creation command?
easy
A. ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 }
B. BillingMode: 'ON_DEMAND'
C. CapacityUnits: { Read: 5, Write: 5 }
D. Throughput: { Read: 5, Write: 5 }

Solution

  1. Step 1: Recall DynamoDB table creation syntax for provisioned mode

    Provisioned mode requires specifying ProvisionedThroughput with ReadCapacityUnits and WriteCapacityUnits.
  2. Step 2: Match the correct syntax

    ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } uses the exact correct keys: ProvisionedThroughput with ReadCapacityUnits and WriteCapacityUnits.
  3. Final Answer:

    ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } -> Option A
  4. Quick Check:

    Provisioned capacity uses ProvisionedThroughput [OK]
Hint: Provisioned capacity uses ProvisionedThroughput keys [OK]
Common Mistakes:
  • Using BillingMode for provisioned capacity
  • Incorrect key names like CapacityUnits or Throughput
  • Confusing ON_DEMAND with provisioned syntax
3. Consider a DynamoDB table with provisioned capacity of 10 read units and 5 write units. If your application performs 8 strongly consistent reads and 3 writes per second, which billing mode will likely cost less?
medium
A. Cannot determine without data size
B. On-demand mode
C. Both cost the same
D. Provisioned mode

Solution

  1. Step 1: Analyze usage vs provisioned capacity

    The app uses 8 reads and 3 writes per second, which is below the provisioned 10 reads and 5 writes capacity.
  2. Step 2: Compare cost implications

    Provisioned mode charges fixed capacity regardless of usage, so if usage is steady and below provisioned, it is cheaper than on-demand which charges per request.
  3. Final Answer:

    Provisioned mode -> Option D
  4. Quick Check:

    Steady low usage < provisioned = Provisioned cheaper [OK]
Hint: If usage steady and below capacity, provisioned is cheaper [OK]
Common Mistakes:
  • Assuming on-demand is always cheaper
  • Ignoring provisioned capacity limits
  • Thinking cost depends only on data size
4. You set a DynamoDB table to provisioned mode with 5 read and 5 write capacity units, but your app suddenly needs 20 reads per second. What is the likely problem and how to fix it?
medium
A. Provisioned capacity too low; increase capacity or switch to on-demand
B. On-demand mode is enabled; switch to provisioned mode
C. Table is in on-demand mode; reduce read requests
D. Provisioned capacity too high; reduce capacity units

Solution

  1. Step 1: Identify the mismatch between capacity and usage

    The app needs 20 reads per second but provisioned capacity is only 5 reads, causing throttling.
  2. Step 2: Determine the fix

    To fix, increase provisioned capacity or switch to on-demand mode which scales automatically.
  3. Final Answer:

    Provisioned capacity too low; increase capacity or switch to on-demand -> Option A
  4. Quick Check:

    Low provisioned capacity causes throttling; increase or switch [OK]
Hint: If usage > provisioned, increase capacity or use on-demand [OK]
Common Mistakes:
  • Confusing on-demand and provisioned modes
  • Reducing capacity when usage is high
  • Ignoring throttling symptoms
5. A startup expects unpredictable traffic spikes but wants to control costs. They plan to use DynamoDB. Which billing strategy best balances cost and flexibility?
hard
A. Use provisioned mode with high capacity to handle spikes
B. Use provisioned mode with low capacity and enable auto scaling
C. Use on-demand mode but limit requests manually
D. Use on-demand mode to pay only for actual requests

Solution

  1. Step 1: Understand startup needs

    They want to handle unpredictable spikes but also control costs.
  2. Step 2: Evaluate billing options

    Provisioned mode with auto scaling adjusts capacity automatically, balancing cost and flexibility better than fixed provisioned or pure on-demand.
  3. Step 3: Compare with other options

    High fixed provisioned is costly; on-demand can be expensive at scale; manual limits reduce flexibility.
  4. Final Answer:

    Use provisioned mode with low capacity and enable auto scaling -> Option B
  5. Quick Check:

    Auto scaling balances cost and spikes well [OK]
Hint: Auto scaling provisioned mode balances cost and spikes [OK]
Common Mistakes:
  • Choosing high fixed provisioned capacity unnecessarily
  • Assuming on-demand always cheaper for spikes
  • Trying to limit requests manually in on-demand mode
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard