C4 model of a messaging API, all four levels

A C4 model of Gridline, an SMS, email and push API, at all four levels: one drill from its context through containers and components to code.

Gridline, l1 context view of the map Open the interactive map

Views in this map

  1. 1
    L1 ContextWho uses Gridline, and the carriers, providers and services it relies on.
  2. 2
    L2 ContainersTen containers: the public API, the send path, webhooks and analytics, and their stores.
  3. 3
    L3 Rate limiterInside the rate limiter: rules, overrides and a token bucket per rule, kept in Redis.
  4. 4
    L4 Token bucketThe token bucket’s code: TokenBucket, the store it depends on, and the Lua Redis runs.

L1 Context ▸ L2 Containers ▸ L3 Rate limiter ▸ L4 Token bucket

Flows to play

  • One SMS requestFrom the customer’s POST to the carrier, through the rate limiter. In L2 Containers: the customer’s app, the REST API, the rate limiter, the router, a delivery worker and the carrier, a step each.
  • A rate-limit checkOne Check() call through the rate limiter’s components. In L3 Rate limiter: the same check inside the rate limiter, from the Limit API through the rules to Redis and back.
  • tryConsume()One call into the token bucket’s code, down to Redis and back. In L4 Token bucket: the call through TokenBucket, its clock, rule and store, to the Lua script that Redis runs.

The model behind it

57 records of 7 types. Every box on the map is one of them, so the filters and the record panel read the same data.

  • Components 26
  • Containers 10
  • Code elements 7
  • External systems 6
  • Teams 5
  • People 2
  • Software system 1

Filters

Level and Language: pick a value and everything else fades.

See you in the canvas

Unlock your team’s collaborative super powers.