Templates / sequenceDiagram
Cache-aside pattern
The classic read-through caching interaction: cache hit, cache miss, database load, and repopulation with a TTL.
Preview
Mermaid 11 renderer
Rendering preview...
Mermaid source
sequenceDiagram
sequenceDiagram
participant App
participant Cache as Redis
participant DB as Database
App->>Cache: GET user:42
alt Cache hit
Cache-->>App: Cached value
else Cache miss
Cache-->>App: nil
App->>DB: SELECT user row
DB-->>App: Row data
App->>Cache: SETEX user:42 300
endMore templates
flowchartArchitecture
Microservices architecture
A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.
sequenceDiagramProcess
User login sequence
A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.
stateDiagram-v2Process
Order state machine
Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.