AWS Certified Solutions Architect – Associate
DynamoDB on-demand vs provisioned capacity, and when to use DAX
On-demand mode is the default: you pay per request and DynamoDB scales for you, instantly up to double the previous peak. Provisioned mode charges for the reads and writes per second you set, usually with auto scaling, and suits steady, predictable traffic. DAX is an in-memory cache that cuts eventually consistent reads from milliseconds to microseconds; it does not cache strongly consistent reads.
On-demand mode
On-demand is the default and recommended mode for most workloads. You do not plan capacity, and with zero traffic you pay nothing for throughput. A new on-demand table can sustain up to 4,000 writes and 12,000 reads per second. It instantly handles up to double its previous peak. Going beyond double within 30 minutes can cause throttling, so AWS recommends pre-warming the table or spreading the growth over at least 30 minutes.
Pre-warming means raising the table's warm throughput, the number of reads and writes it can support instantly, before an event such as a launch. You can also set a maximum read or write throughput on an on-demand table to cap cost. Requests above that maximum are throttled. Separately, an account has a default table-level quota of 40,000 read and write units, which you can ask to raise.
Provisioned mode and capacity units
In provisioned mode you set reads and writes per second and pay for that capacity hourly, used or not. It fits steady workloads with predictable growth. Auto scaling adjusts capacity toward a target utilization; AWS recommends 70%. It is turned on by default when you create a table in the console.
One read capacity unit is one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB. One write capacity unit is one write per second for an item up to 1 KB. Sizes round up, so reading 80 items of 3 KB per second with strong consistency needs 80 RCUs.
You can switch a table from provisioned to on-demand up to four times in a rolling 24 hours. You can switch from on-demand to provisioned at any time.
DynamoDB Accelerator (DAX)
DAX is a managed, DynamoDB-compatible cache. It suits read-heavy or bursty workloads, hot keys and apps that need microsecond reads. You use the DAX client in your application and point it at the cluster endpoint; the API calls stay the same.
DAX passes strongly consistent reads and TransactGetItems straight to DynamoDB and does not cache the results. It is not a good fit for apps that need strongly consistent reads, write-heavy apps, or apps with few repeated reads. AWS says DAX performs best when the cache hit rate is above 90%.
DAX has two separate caches. GetItem results go in the item cache. Query and Scan results go in the query cache. Writes through DAX update the item cache only. A cached query result does not change until its TTL expires.
Where the exam catches people
- Believing DAX speeds up strongly consistent reads: DAX passes them to DynamoDB and caches nothing.
- Believing a write through DAX refreshes cached
Queryresults: writes update the item cache only; the query cache waits for its TTL. - Believing on-demand absorbs any spike instantly: more than double the previous peak within 30 minutes can throttle; pre-warm the table.
- Believing an on-demand table has no ceiling: a maximum throughput you set, or the account quota, throttles requests above it.
- Believing one RCU covers any read: it covers one strongly consistent read of up to 4 KB, rounded up by item size.