API Call Sequence — Reladraw template

下单接口调用链. Copy the source, paste into the official playground, done. No coordinates — every position is stated relative to something else.

Preview

Client Load balancer Auth service Order service Database POST /orders token check insert

Source (.reladraw)

node client "Client"
node lb "Load balancer"  below client
node auth "Auth service"  right of lb
node orders "Order service"  below lb
node db "Database"  below orders
edge client -> lb  "POST /orders"
edge lb -> auth  "token check"
edge lb -> orders
edge orders -> db  "insert"

How to use

  1. Open the Reladraw playground
  2. Paste the source above — the diagram re-solves live
  3. Export SVG from the playground, or render locally: npx reladraw sequence-api.reladraw -o out.svg

When to use this template

A single request traced through the stack: client, load balancer, auth check, the service that does the work, the database it writes to. Use it to debug latency arguments, document an API contract, or onboard someone to a codebase — it answers who is called, in what order.

How to customize

  1. Add a cache hop. Add node redis "Redis" right of db and edge orders -> redis "get cached".
  2. Show a failure path. Add node err "429 response" right of lb with edge auth -> err "reject".
  3. Make it async. Change a label: edge orders -> db "enqueue write" — or add a queue node between service and database.

FAQ

Is Reladraw good for sequence diagrams?

Yes for request-level sequences: place caller above callee and draw each call as a labeled edge in order. For long, branching UML sequences with lifelines and activation bars, a dedicated sequence tool still fits better.

How do I show synchronous vs asynchronous calls?

In the edge label: POST /orders for sync, enqueue for async. If the distinction is central to your doc, add separate queue and response nodes so the return path is explicit.

How do I diagram retries or timeouts?

Add an edge back to the caller labeled retry ×3 or timeout 2s. Explicit back edges beat prose notes — reviewers scan edges, not captions.

Related templates

Cache LayersIoT Data PipelineGit Branching Model