Participants in this sequence diagram
- Client
- API gateway
- Auth service
- Orders service
- Redis cache
- Postgres
How to use this sequence diagram template
- Click Open in the editor. The sequence diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the Mermaid source below and paste it in through ☰ → Import diagram (see the Mermaid editor); it imports as an editable diagram.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
Mermaid source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
sequenceDiagram
autonumber
actor U as Client
participant GW as API gateway
participant AuthZ as Auth service
participant Svc as Orders service
participant Cache as Redis cache
participant DB as Postgres
U->>GW: GET /v1/orders/42 + API key
GW->>GW: Rate limit check
GW->>AuthZ: Validate token and scopes
AuthZ-->>GW: Allowed (orders:read)
GW->>+Svc: Forward request with user context
Svc->>Cache: GET order:42
alt Cache hit
Cache-->>Svc: Cached order JSON
else Cache miss
Cache-->>Svc: nil
Svc->>DB: SELECT * FROM orders WHERE id = 42
DB-->>Svc: Order row
Svc->>Cache: SET order:42 TTL 300s
end
Svc-->>-GW: 200 order
GW-->>U: 200 order + rate-limit headers
Note right of GW: Gateway also logs and traces every request
Related: Mermaid editor · All uml: sequence, class & state templates · All 521 templates