{
  "docVersion": 1,
  "id": "template-card-authorization-at-scale",
  "name": "Card authorization — 100ms budget",
  "purpose": "Sub-100ms card authorization using cell isolation, shuffle-sharded routing, near-caches and hedged reads; edge labels carry the latency budget.",
  "nodes": {
    "net": {
      "type": "partnerapi",
      "label": "Card Network",
      "x": 20,
      "y": 300,
      "runtime": "ISO 8583 · 100ms SLA"
    },
    "router": {
      "type": "lb",
      "label": "Cell Router",
      "x": 280,
      "y": 300,
      "runtime": "shuffle-sharded · stateless",
      "patterns": [
        "stateless",
        "replicated"
      ],
      "notes": "Routes by issuer id. Shuffle sharding: each issuer gets 2 of 8 cells, so two issuers rarely share both cells."
    },
    "auth1": {
      "type": "k8s",
      "label": "Auth Service",
      "x": 560,
      "y": 130,
      "runtime": "cell 1 · decision in ≤40ms",
      "color": "green",
      "patterns": [
        "autoscale",
        "stateless"
      ],
      "notes": "Decision = limits check + risk score. Everything it needs is cached or budgeted; nothing blocks on a cold path."
    },
    "cache1": {
      "type": "cache",
      "label": "Near-cache L1+L2",
      "x": 840,
      "y": 40,
      "runtime": "hit ratio 99.4%",
      "notes": "L1 in-process (~1ms), L2 cluster (~5ms). The 0.6% miss path is where the hedged read earns its keep."
    },
    "store1": {
      "type": "database",
      "label": "Account Store",
      "x": 1120,
      "y": 130,
      "runtime": "3 replicas",
      "patterns": [
        "replicated"
      ]
    },
    "risk1": {
      "type": "gpu",
      "label": "Risk Scorer",
      "x": 840,
      "y": 260,
      "runtime": "≤30ms or default-allow rules"
    },
    "auth2": {
      "type": "k8s",
      "label": "Auth Service",
      "x": 560,
      "y": 470,
      "runtime": "cell 2 — identical, isolated",
      "color": "gray",
      "style": "dashed"
    },
    "cache2": {
      "type": "cache",
      "label": "Near-cache",
      "x": 840,
      "y": 470,
      "runtime": "cell-local",
      "style": "dashed"
    },
    "store2": {
      "type": "database",
      "label": "Account Store",
      "x": 1120,
      "y": 470,
      "runtime": "cell-local",
      "style": "dashed"
    }
  },
  "edges": {
    "e1": {
      "from": "net",
      "to": "router",
      "fromSide": "right",
      "toSide": "left",
      "label": "auth request · t=0",
      "animated": true,
      "flowSpeed": "fast",
      "patterns": [
        "timeout"
      ]
    },
    "e2": {
      "from": "router",
      "to": "auth1",
      "fromSide": "right",
      "toSide": "left",
      "label": "route ≤5ms · issuer→cell 1",
      "animated": true,
      "flowSpeed": "fast"
    },
    "e3": {
      "from": "auth1",
      "to": "cache1",
      "fromSide": "right",
      "toSide": "left",
      "label": "limits lookup ≤5ms",
      "patterns": [
        "cache-aside"
      ]
    },
    "e4": {
      "from": "cache1",
      "to": "store1",
      "fromSide": "right",
      "toSide": "left",
      "label": "miss → hedged read ≤20ms",
      "style": "dashed",
      "patterns": [
        "hedged",
        "timeout"
      ]
    },
    "e5": {
      "from": "auth1",
      "to": "risk1",
      "fromSide": "right",
      "toSide": "left",
      "label": "score ≤30ms",
      "patterns": [
        "timeout",
        "fallback",
        "bulkhead"
      ]
    },
    "e6": {
      "from": "router",
      "to": "auth2",
      "fromSide": "right",
      "toSide": "left",
      "label": "other issuers",
      "style": "dashed"
    },
    "e7": {
      "from": "auth2",
      "to": "cache2",
      "fromSide": "right",
      "toSide": "left",
      "style": "dashed"
    },
    "e8": {
      "from": "cache2",
      "to": "store2",
      "fromSide": "right",
      "toSide": "left",
      "style": "dashed"
    }
  },
  "boxes": {
    "b1": {
      "x": 520,
      "y": -40,
      "w": 830,
      "h": 420,
      "label": "cell 1 — one issuer group's whole world",
      "color": "green",
      "opacity": 0.04
    },
    "b2": {
      "x": 520,
      "y": 420,
      "w": 830,
      "h": 250,
      "label": "cell 2 — identical, shares nothing",
      "color": "gray",
      "opacity": 0.03
    }
  },
  "texts": {
    "t1": {
      "x": 20,
      "y": 480,
      "text": "the budget: route 5 + cache 5 + risk 30 + decision 10\n+ network 20 = 70ms, 30ms headroom.\nEvery edge label is a line item — spend deliberately.",
      "color": "green",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-13T09:00:00.000Z",
    "modifiedAt": "2026-07-13T09:00:00.000Z"
  }
}