2. The Backstory
• Lead the migrations of DynamoDB tables from
On-Demand to Provisioned Capacity mode for
one of the biggest retailer in North America
• The goal was to save cost
• Individual Tables Containing an excess of 1
billions items (+1 TB)
• Over 100K items added every day
• Used by multiple microservices servicing million
plus users
5. Unit of measure for R/W Capacity
• 1 RRU/RCU ≡ 1 strongly consistent or 2 eventually
consistency read of an item up to 4KB
• 2 RRU/RCU ≡ 1 transactional read of item up to 4KB
• 1 WRU/WCU ≡ 1 write for item up to 1 KB
• 2 WRU/WCU ≡ 1 transactional write for item up to 1
KB
6. On-Demand Capacity Mode
• Pay Per Request pricing
• Only pay for what you use
• Capable of serving thousands of requests /second
• Single digit millis SLA
• Low utilization ratio
7. When to use On-Demand mode
• Un-Predictable or unknow traffic.
• Mission critical application demanding single
digit millis response time
• Your organization is still using manual
provisioning methods or in initial stage of
DevOps maturity level
8. Provisioned Capacity Mode
• Configure your provision RW capacity
• Pay for the provisioned capacity
• Can be used with auto scaling
• Predictable cost
9. When to use Provisioned mode
• Predictable application traffic.
• Traffic is consistent or ramps gradually.
• You can forecast capacity requirements to
control costs.
• High utilization ratio
• Can tolerate throttling
• Cost gain justifies the additional overhead
• Your organization is in advance stage of DevOps
maturity level
13. Before you begin
• Is it worth the hassle?
• Average/Median RW rates
• Peak RW rates
• Promotional or seasonal peaks
• Most accessed partition key
• Hot partitions
• Response time SLA
• Acceptable error rate
18. On-Demand Pricing
Write Request Units (WRU) $1.25 per million
Read Request Units (RRU) $0.25 per million
Consumed WRU per minutes 500
Consumer RRU per minutes 1000
Consumed WRU per month 500 X 60 X 24 X 30 = 21.6 million
Cost for WRU per month 21.6 X $1.25 = $27.00
Consumed RRU per month 1000 X 60 X 24 X 30 = 43.2 million
Cost for RRU per month 43.2 X $0.25 = $10.8
Total Cost per month $27.00 + $10.8 = $37.80
19. Provisioned Pricing
Write Capacity Units (WCU) $0.00065 / WCU per hour
Read Capacity Units (RCU) $0.00013 / RCU per hour
Min WCU 10
Max WCU 125
Min RCU 25
Max RCU 300
Avg WCU Consumed .8 X 10 + .2 X 62.5 = 20.5
Cost for WRU per month 20.5 X 24 X 30 X $0.00065 =
$9.594
Avg RCU Consumed .6 X 25 + 0.4 X 150 = 75
Cost for RCU per month 75 X 24 X 30 X $0.0003 = 7.02
Total Cost per month $9.594 + 7.02 = $16.614
28. Optimization Hacks
• Upfront planning for your seasonal peak load
• Use On-Demand mode for Non-Prod environment
• Schedule your scaling event
• Switch between On-Demand and Provisioned
Mode with ease