Cache simulator

The problem

Database reads are slow and expensive compared with reading memory. A cache keeps recent answers close to the application, but it is small, its copies can go out of date, and every miss still reaches the database.

What you will see

See how cache size, time-to-live and key popularity change the hit rate, how much database traffic a cache removes, and how stale reads appear when writes do not invalidate the cache, or race with a read in flight.

A cache-aside cache in front of a database: hits, misses, TTL expiry, LRU eviction and invalidation on write, with hit rate and database load measured as it runs.

Read next