Skip to content
StackDecode
System Design
7. Caching ArchitectureAnimated

Cache Penetration

Requests for data that does not exist bypass the cache.

The idea

Queries for missing keys always miss and hit the database, sometimes as an attack.

Watch it work

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

UserCDN edgeOriginGET /video.mp4
  • current message
  • earlier
  • failure or attack

The user is routed to the nearest edge location.

step:
1/6
from:
User
to:
CDN edge
1/6

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1Request for a missing key
  2. 2Cache misses
  3. 3Database finds nothing
  4. 4Repeat

Where it is used

Public APIs.

Watch out for

Cache the negative result briefly or use a Bloom filter.

Related