Skill 3.3.5

Integrating caching to meet business requirements

Key Concepts

Amazon ElastiCache supports Valkey and Redis OSS (replication, Multi-AZ failover, persistence, rich data structures such as sorted sets for leaderboards, pub/sub) and Memcached (simple, multi-threaded, no replication). ElastiCache Serverless removes capacity planning. DAX is an in-memory cache for DynamoDB with microsecond reads and no application logic changes beyond using the DAX client.

Strategies: lazy loading (cache-aside) reads from the cache and loads from the database on a miss (only requested data is cached; first reads are slow; data can be stale). Write-through updates the cache on every write (always fresh, but caches data that may never be read). Add TTLs to limit staleness.

Other caching layers: CloudFront at the edge, API Gateway response caching, and session stores in ElastiCache or DynamoDB for stateless web tiers.