Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_api-styles

API styles: REST, a query API and events

10 COMPONENTS · 12 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![API styles: REST, a query API and events — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_api-styles/opengraph-image)](https://archos.sageideas.dev/d/dgm_api-styles)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_api-styles)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_api-styles" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="API styles: REST, a query API and events — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Mobile Client")]
  partner_1[("Partner Server")]
  gw_2["API gateway"]
  rest_3["Resource server (REST)"]
  graphql_4["Resource server (query)"]
  db_5[("System of record")]
  relay_6[("Message relay")]
  queue_7[("Message queue")]
  worker_8["Idempotent consumer"]
  capacity_9["Capacity Estimate"]
  client_0 -->|"1. Calls with JWT · HTTPS"| gw_2
  gw_2 -->|"2a. Routes v1 REST call · HTTP/2"| rest_3
  gw_2 -->|"2b. Routes query · HTTP/2"| graphql_4
  rest_3 -->|"3a. Saves order · SQL"| db_5
  graphql_4 -.->|"3b. Asks order · TCP"| queue_7
  queue_7 -.->|"4a. Delivers ask · TCP"| rest_3
  db_5 -->|"4b. Polls outbox rows · SQL"| relay_6
  rest_3 -.->|"5a. Replies with id · TCP"| queue_7
  relay_6 -.->|"5b. Publishes order event · TCP"| queue_7
  queue_7 -.->|"6a. Delivers reply · TCP"| graphql_4
  queue_7 -.->|"6b. Delivers events · TCP"| worker_8
  worker_8 -.->|"7. Webhook · HTTPS"| partner_1

COMPONENT STACK (9)

  • Mobile ClientSTATEFUL
    Calls the public API over the internet
  • Partner ServerSTATEFUL
    Receives signed callbacks
  • API gatewaySTATELESS
    Checks the JWT; routes by path and version
  • Resource server (REST)STATELESS
    REST orders: resources and verbs
  • Resource server (query)STATELESS
    Query API: client picks the fields
  • System of recordSTATEFUL
    Orders and outbox tables, read in cursor pages
  • Message relaySTATEFUL
    Forwards new order rows as events
  • Message queueSTATEFUL
    Carries events and request-reply
  • Idempotent consumerSTATELESS
    Skips repeats, then sends the callback

REQUEST & DATA FLOW (12)

  1. Mobile Client → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Resource server (REST) (Routes v1 REST call)[HTTP/2]
  3. API gateway → Resource server (query) (Routes query)[HTTP/2]
  4. Resource server (REST) → System of record (Saves order)[SQL]
  5. Resource server (query) → Message queue (Asks order)[TCP]
  6. Message queue → Resource server (REST) (Delivers ask)[TCP]
  7. System of record → Message relay (Polls outbox rows)[SQL]
  8. Resource server (REST) → Message queue (Replies with id)[TCP]
  9. Message relay → Message queue (Publishes order event)[TCP]
  10. Message queue → Resource server (query) (Delivers reply)[TCP]
  11. Message queue → Idempotent consumer (Delivers events)[TCP]
  12. Idempotent consumer → Partner Server (Webhook)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →