Skip to content

Latest commit

 

History

History
28 lines (26 loc) · 1019 Bytes

File metadata and controls

28 lines (26 loc) · 1019 Bytes

Caching Strategies

  • Lazy Loading – a caching strategy that loads data into the cache only when necessary.
    • Only requested data is cached.
    • Node failures are not fatal.
    • There is a cache miss penalty.
    • Stale data.
  • Write Through – adds data or updates data in the cache whenever data is written to the database.
    • Data in the cache is never stale.
    • Write penalty vs. Read penalty. Every write involves two trips: A write to the cache and a write to the database
    • Missing data.
    • Cache churn.
  • By adding a time to live (TTL) value to each write, we are able to enjoy the advantages of each strategy and largely avoid cluttering up the cache with superfluous data.

alt text
Amazon Elastic Cache Index. Source: AWS Official Training

alt text
Redis vs Memcached. Source: AWS Official Training