1. get2. read on miss3. setAPIRedisDatabase
Architectureminimal

Cache-Aside Read Path

A cache-aside pattern: the API reads from Redis first and falls back to the database on a miss, then fills the cache.

Start from this template

Opens in the editor. No signup. Export SVG, PNG, or an embed link.


Source text
title: Cache-Aside Read Path
theme: minimal
node api "API" [service]
node cache "Redis" [cache]
node db "Database" [database]
cache right-of api
db below api
api -> cache : "1. get"
api -> db : "2. read on miss"
api -> cache : "3. set"

About this template

The cache-aside (lazy loading) pattern in three numbered steps: the API reads from Redis first, falls back to the database on a cache miss, and then writes the value back to Redis.

Numbered arrow labels show the order of calls without a sequence diagram. That works well in architecture docs, where you want the components and the read path in one picture.

If you need the exact back-and-forth instead, see the Cache Miss and Fill sequence template. You can also add a write path, such as "api -> db : "write"", to show how the cache gets invalidated in your system.