How does auto scaling work in DynamoDB?
Understand how DynamoDB auto scaling adjusts provisioned capacity via target utilization, CloudWatch alarms and min/max bounds to balance cost and speed.
Expected Interview Answer
DynamoDB auto scaling automatically adjusts a table's provisioned read and write capacity up or down in response to actual traffic, using AWS Application Auto Scaling and CloudWatch alarms to keep utilization near a target you set.
You define a minimum capacity, a maximum capacity, and a target utilization percentage (commonly 70%) for read and write capacity units. Application Auto Scaling creates CloudWatch alarms that watch consumed versus provisioned capacity; when utilization stays above target it scales capacity up, and when it drops well below target it scales down, always within your min and max bounds. This keeps performance smooth during traffic spikes while avoiding paying for idle capacity, though it reacts over minutes rather than instantly — which is why bursty or unpredictable workloads often use on-demand mode instead.
- Handles traffic spikes without manual intervention
- Reduces cost by scaling down during quiet periods
- Keeps utilization near a chosen target automatically
- Respects min/max bounds so scaling stays predictable
- Works per-table and per-global-secondary-index
AI Mentor Explanation
Think of a stadium that opens and closes seating tiers based on ticket demand for each match. Staff watch the turnstiles and, when a section fills past about 70%, they open another tier; when the crowd thins they close some, never going below a core set or above the venue's limit. DynamoDB auto scaling adjusts capacity units the same way — reacting to measured demand within set floors and ceilings.
Step-by-Step Explanation
Step 1
Enable auto scaling
Turn on auto scaling for the table's read and write capacity, and optionally for each global secondary index.
Step 2
Set bounds and target
Define minimum capacity, maximum capacity, and a target utilization percentage (commonly 70%) for reads and writes.
Step 3
CloudWatch monitors utilization
Application Auto Scaling creates CloudWatch alarms comparing consumed capacity against provisioned capacity.
Step 4
Scale up on demand
When utilization exceeds the target for a sustained period, capacity is increased toward the maximum.
Step 5
Scale down when idle
When utilization stays well below the target, capacity is reduced toward the minimum to save cost.
What Interviewer Expects
- Knows auto scaling adjusts provisioned capacity, not on-demand
- Can name the three settings: min, max, and target utilization
- Understands it relies on Application Auto Scaling and CloudWatch alarms
- Aware scaling reacts over minutes, not instantly
- Can contrast auto scaling with on-demand capacity mode
Common Mistakes
- Confusing provisioned auto scaling with on-demand capacity mode
- Assuming scaling is instantaneous rather than reactive over minutes
- Forgetting to set a sensible maximum, risking runaway cost or throttling
- Not enabling auto scaling separately for global secondary indexes
- Believing auto scaling prevents all throttling during sudden spikes
Best Answer (HR Friendly)
“DynamoDB auto scaling automatically raises a table's capacity when traffic gets heavy and lowers it when things are quiet, keeping performance steady while avoiding wasted spend. You just set a minimum, a maximum, and a target usage level, and AWS handles the adjustments.”
Code Example
# Register the table's read capacity as a scalable target
aws application-autoscaling register-scalable-target \
--service-namespace dynamodb \
--resource-id "table/Orders" \
--scalable-dimension "dynamodb:table:ReadCapacityUnits" \
--min-capacity 5 \
--max-capacity 500
# Keep read utilization near 70%
aws application-autoscaling put-scaling-policy \
--service-namespace dynamodb \
--resource-id "table/Orders" \
--scalable-dimension "dynamodb:table:ReadCapacityUnits" \
--policy-name "OrdersReadScaling" \
--policy-type "TargetTrackingScaling" \
--target-tracking-scaling-policy-configuration '{
"TargetValue": 70.0,
"PredefinedMetricSpecification": {"PredefinedMetricType": "DynamoDBReadCapacityUtilization"}
}'Follow-up Questions
- When would you choose on-demand mode over provisioned auto scaling?
- Why does auto scaling not eliminate throttling during sudden traffic spikes?
- How do you configure auto scaling for a global secondary index?
- What target utilization would you pick and why?
- How does DynamoDB burst capacity interact with auto scaling?
MCQ Practice
1. Which three parameters do you configure for DynamoDB auto scaling?
Auto scaling is defined by a minimum capacity, a maximum capacity, and a target utilization percentage.
2. Which AWS service drives DynamoDB auto scaling decisions?
Application Auto Scaling creates CloudWatch alarms that trigger capacity changes based on consumed versus provisioned throughput.
3. Why might a sudden spike still cause throttling under auto scaling?
Scaling responds to sustained utilization over minutes, so an abrupt spike can outpace it until capacity catches up.
Flash Cards
What does DynamoDB auto scaling adjust? — Provisioned read and write capacity units, within your min and max bounds.
What three values do you set? — Minimum capacity, maximum capacity, and target utilization (often 70%).
What powers the scaling decisions? — AWS Application Auto Scaling using CloudWatch alarms on utilization.
When is on-demand better than auto scaling? — For spiky or unpredictable traffic where minute-scale reaction is too slow.
Continue Learning
Related Interview Questions
A production DynamoDB table is throttling — how do you diagnose and fix it?
hard
How can a global secondary index break writes to the base table, and how do you design around it?
hard
How do you estimate DynamoDB capacity for a new workload before it launches?
medium
What is read and write capacity in DynamoDB (provisioned vs on-demand)?
medium