The following services provide caching on AWS:
- CloudFront
- API Gateway
- ElastiCache
- DynamoDB Accelerator
DynamoDB Accelerator (DAX)
DAX is highly-available, fully-managed in-memory read cache service designed for DynamoDB.
There is no need to manage the caching logic. DAX uses a cluster architecture (one or more nodes) and can deliver results as fast as in microseconds!
- DAX delivers up to 10x read performance improvements.
- Mircosecond performance for millions of requests per second.
- DAX can be used for heavy-read workloads or data with repeated read patterns.
- Read API calls hit the DAX first before reaching the DynamoDB table.
- DAX can reduce RCUs on the table.
- DAX can only be used with eventually consistent reads.
DAX maintains two distinct caches.
- Item Cache stores results from GetItem and BatchGetItem and has 5-minute default TTL.
- Query Cache stores results from Query and Scan operations.
Do not use DAX if
- You need strongly consistent reads
- or You do not have extremely heavy requests.
ElastiCache
ElastiCache is a managed in-memory data store – Redis or Memcached.
- Offloading database reads or storing user session states for the stateless compute.
Redis
supports master/slave replication and Multi-AZ redundancy for more advanced data types (lists, hashes, and sets), data persistence (backup/restore), pub/sub capabilities, or data sorting and ranking such as leader dashboard.
Memcached
Simple in-memory caching model or large cache node with multi-threaded performance (horizontal scale out).