Skill 1.5.6

Design data caching strategies to optimize performance (for example, by using ElastiCache, DynamoDB Accelerator [DAX]).

Key Concepts

Caching: CloudFront (static and dynamic), API Gateway cache, ElastiCache (lazy loading, write-through, TTLs), DAX. Buffering: SQS and Kinesis smooth bursts and protect databases. Replicas: Aurora replicas behind a reader endpoint, RDS read replicas, DynamoDB global tables, cross-Region read replicas for local reads.

Watch consistency trade-offs: caches and replicas can serve stale data; invalidate or use TTLs, and route strongly consistent reads to the primary.

Caching strategies: lazy loading (cache-aside) fills the cache on a miss and may serve stale data until the TTL expires; write-through updates the cache on every write so reads are fresh but unused data is cached too. TTLs bound staleness, and eviction policies handle memory pressure. DAX is an API-compatible, write-through cache for DynamoDB with microsecond reads for eventually consistent reads only; ElastiCache (Valkey, Redis OSS or Memcached, provisioned or serverless) caches query results, sessions and computed objects for any database.