Can DynamoDB be used as a cache?
Yes. DynamoDB's fast key-value lookups and TTL make it a solid durable cache — for sessions, tokens, and computed results. For sub-millisecond reads, pair it with DynamoDB Accelerator (DAX), a fully managed in-memory, write-through cache that fronts the table and returns eventually consistent reads in microseconds without any cache-invalidation code.
DynamoDB as a durable cache
Because reads are keyed and single-digit-millisecond, DynamoDB works well as a persistent cache layer. TTL expires stale entries for you, so cached sessions or precomputed results clean themselves up.
Adding DAX for microseconds
DAX is an in-memory cache that sits in front of DynamoDB:
- Read-through / write-through — it manages population and invalidation for you.
- Microsecond reads — up to a 10x improvement on eventually consistent reads.
- API-compatible — minimal application changes.
What DAX costs before it saves you
DAX is a latency purchase. Priced out, it does not start saving money until you are reading a great deal.
A dax.t3.small node is $0.04 an hour in us-east-1, and AWS recommends at least three across Availability Zones for production, because three is the number that makes a cluster fault-tolerant. That is $87.60 a month. An on-demand eventually consistent read of an item up to 4 KB costs $0.0000000625, so the same $87.60 buys 1.4 billion reads straight off the table, or 533 a second sustained all month.
That number flatters DAX, too: it assumes every read hits the cache, while in practice each miss bills a table read on top of the cluster. A development cluster of one node is $29.20 a month, or 178 reads a second, and AWS advises against fewer than three nodes in production since a one- or two-node cluster can lose its cached data outright.
TTL is free, and not prompt
Expiring an entry yourself costs a write unit; a million DeleteItem calls on items up to 1 KB is $0.63. TTL does the same work without consuming write throughput, which is the practical argument for it in a cache.
The timing is the catch. AWS deletes expired items typically within a few days of expiry, so storage keeps billing on entries your application considers gone, and the bill tracks the deletion lag rather than the TTL you set. Cache 1,000 items a second at 1 KB with a one-hour TTL and the live set is 3.4 GB, $0.86 a month; a two-day lag parks 165 GB of dead entries beside it at $41.19 a month. Expired items also keep turning up in Query and Scan results until they are physically removed, so filter on the expiry attribute at read time instead of trusting it.
When it fits and when it does not
Great for read-heavy workloads that tolerate eventual consistency (DAX serves eventually consistent data). If you need strong consistency on every read, go to the table directly. DAX nodes also replicate among themselves eventually, so two clients hitting the same cluster can briefly read different values for the same key.
Go deeper
Read DynamoDB TTL and DynamoDB consistency. Download DynoTable to inspect your cache tables.
References
- In-memory acceleration with DynamoDB Accelerator (DAX) — Amazon DynamoDB Developer Guide
- DAX: How it works — Amazon DynamoDB Developer Guide
- Using time to live (TTL) in DynamoDB — Amazon DynamoDB Developer Guide
- Sizing your DAX cluster — Amazon DynamoDB Developer Guide — the three-node production recommendation, re-checked 2026-07-28.
- Amazon DynamoDB pricing — DAX node-hour and request-unit rates.
Last verified 2026-07-13 against the official AWS documentation linked above.
Costed 2026-07-28. The DAX node-hour rate was read from the AWS Price List API (us-east-1, dax.t3.small, $0.040) and the read, write and storage rates come from the same feed our pricing calculator syncs; the arithmetic above is ours and every input is on the page.