{
  "docVersion": 1,
  "id": "template-cell-based-architecture",
  "name": "Cell-based architecture",
  "purpose": "A cell-partitioned service: a thin, statically-stable router maps shuffle-sharded tenants onto identical self-contained cells; the control plane provisions asynchronously and its loss never stops the data plane.",
  "nodes": {
    "users": {
      "type": "users",
      "label": "Tenants",
      "x": 20,
      "y": 260,
      "runtime": "A → Z"
    },
    "router": {
      "type": "gateway",
      "label": "Cell Router",
      "x": 270,
      "y": 260,
      "runtime": "thin · cached routing table",
      "color": "blue",
      "patterns": [
        "stateless",
        "replicated"
      ],
      "notes": "Deliberately boring: a lookup and a forward. Works from its cached table if the control plane disappears (static stability)."
    },
    "api1": {
      "type": "k8s",
      "label": "API",
      "x": 560,
      "y": 90,
      "runtime": "cell 1"
    },
    "db1": {
      "type": "database",
      "label": "DB",
      "x": 810,
      "y": 90,
      "runtime": "cell 1 · isolated"
    },
    "api2": {
      "type": "k8s",
      "label": "API",
      "x": 560,
      "y": 300,
      "runtime": "cell 2"
    },
    "db2": {
      "type": "database",
      "label": "DB",
      "x": 810,
      "y": 300,
      "runtime": "cell 2 · isolated"
    },
    "api3": {
      "type": "k8s",
      "label": "API",
      "x": 560,
      "y": 510,
      "runtime": "cell 3"
    },
    "db3": {
      "type": "database",
      "label": "DB",
      "x": 810,
      "y": 510,
      "runtime": "cell 3 · isolated"
    },
    "cp": {
      "type": "orchestrator",
      "label": "Control plane",
      "x": 270,
      "y": 520,
      "runtime": "creates cells · migrates tenants",
      "color": "purple",
      "notes": "Talks to cells and the router asynchronously. It can be down for hours before anyone notices — that's the point."
    }
  },
  "edges": {
    "e1": {
      "from": "users",
      "to": "router",
      "fromSide": "right",
      "toSide": "left",
      "label": "request · tenant id",
      "animated": true
    },
    "e2": {
      "from": "router",
      "to": "api1",
      "fromSide": "right",
      "toSide": "left",
      "label": "tenant → cell lookup",
      "animated": true
    },
    "e3": {
      "from": "router",
      "to": "api2",
      "fromSide": "right",
      "toSide": "left"
    },
    "e4": {
      "from": "router",
      "to": "api3",
      "fromSide": "right",
      "toSide": "left"
    },
    "e5": {
      "from": "api1",
      "to": "db1",
      "fromSide": "right",
      "toSide": "left"
    },
    "e6": {
      "from": "api2",
      "to": "db2",
      "fromSide": "right",
      "toSide": "left"
    },
    "e7": {
      "from": "api3",
      "to": "db3",
      "fromSide": "right",
      "toSide": "left"
    },
    "e8": {
      "from": "cp",
      "to": "router",
      "fromSide": "top",
      "toSide": "bottom",
      "label": "routing table updates",
      "style": "dashed"
    }
  },
  "boxes": {
    "b1": {
      "x": 530,
      "y": 30,
      "w": 470,
      "h": 210,
      "label": "cell 1 — tenants shuffled here",
      "color": "blue",
      "opacity": 0.04
    },
    "b2": {
      "x": 530,
      "y": 245,
      "w": 470,
      "h": 205,
      "label": "cell 2",
      "color": "green",
      "opacity": 0.04
    },
    "b3": {
      "x": 530,
      "y": 455,
      "w": 470,
      "h": 205,
      "label": "cell 3",
      "color": "purple",
      "opacity": 0.04
    }
  },
  "texts": {
    "t1": {
      "x": 20,
      "y": 420,
      "text": "shuffle sharding: each tenant is assigned 2 of 3 cells.\nA poison tenant hurts only its shuffle-set —\nmost tenant pairs don't even share one cell.",
      "color": "green",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-13T09:00:00.000Z",
    "modifiedAt": "2026-07-13T09:00:00.000Z"
  }
}