Skip to content
StackDecode
System Design
7. Caching ArchitectureAnimated

Server-Side Caching

Caching results on the server.

The idea

The application stores computed results or query outputs in memory or a cache server.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

RequestL1 in-processL2 RedisDatabase
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Check the in-process cache: nanoseconds.

step:
1/4
at:
Request
1/10

The green dot is a request moving through the system.

Step by step

  1. 1Compute or fetch a result
  2. 2Store it with a key
  3. 3Later requests read it
  4. 4Entries expire or are evicted

Where it is used

Expensive queries and pages.

Watch out for

Cached data can be inconsistent with the database.

Related