{
  "docVersion": 1,
  "id": "blog-tenancy-d3",
  "name": "The data-layer ladder",
  "purpose": "Shared tables with tenant_id, schema-per-tenant, database-per-tenant, and cells — isolation rising left to right.",
  "nodes": {
    "d1": {
      "type": "database",
      "label": "One DB",
      "x": 40,
      "y": 120,
      "w": 130,
      "h": 84,
      "color": "blue",
      "runtime": "rows: A,B,C mixed"
    },
    "d2": {
      "type": "database",
      "label": "One DB",
      "x": 320,
      "y": 120,
      "w": 130,
      "h": 84,
      "runtime": "3 schemas inside"
    },
    "s2a": {
      "type": "storage",
      "label": "schema_a",
      "x": 260,
      "y": 280,
      "w": 100,
      "h": 70
    },
    "s2b": {
      "type": "storage",
      "label": "schema_b",
      "x": 375,
      "y": 280,
      "w": 100,
      "h": 70
    },
    "d3a": {
      "type": "database",
      "label": "DB — tenant A",
      "x": 600,
      "y": 60,
      "w": 130,
      "h": 84,
      "color": "green"
    },
    "d3b": {
      "type": "database",
      "label": "DB — tenant B",
      "x": 600,
      "y": 190,
      "w": 130,
      "h": 84,
      "color": "green"
    },
    "d3c": {
      "type": "database",
      "label": "DB — tenant C",
      "x": 600,
      "y": 320,
      "w": 130,
      "h": 84,
      "color": "green"
    },
    "c1a": {
      "type": "k8s",
      "label": "cell 1 app",
      "x": 880,
      "y": 60,
      "w": 110,
      "h": 76
    },
    "c1d": {
      "type": "database",
      "label": "cell 1 DB",
      "x": 1010,
      "y": 60,
      "w": 110,
      "h": 76
    },
    "c2a": {
      "type": "k8s",
      "label": "cell 2 app",
      "x": 880,
      "y": 300,
      "w": 110,
      "h": 76
    },
    "c2d": {
      "type": "database",
      "label": "cell 2 DB",
      "x": 1010,
      "y": 300,
      "w": 110,
      "h": 76
    }
  },
  "edges": {
    "e1": {
      "from": "d2",
      "to": "s2a",
      "fromSide": "bottom",
      "toSide": "top"
    },
    "e2": {
      "from": "d2",
      "to": "s2b",
      "fromSide": "bottom",
      "toSide": "top"
    },
    "e3": {
      "from": "c1a",
      "to": "c1d",
      "fromSide": "right",
      "toSide": "left"
    },
    "e4": {
      "from": "c2a",
      "to": "c2d",
      "fromSide": "right",
      "toSide": "left"
    }
  },
  "boxes": {
    "z1": {
      "x": 10,
      "y": -30,
      "w": 200,
      "h": 440,
      "label": "1 · shared tables",
      "color": "blue",
      "opacity": 0.04
    },
    "z2": {
      "x": 240,
      "y": -30,
      "w": 270,
      "h": 440,
      "label": "2 · schema-per-tenant",
      "color": "amber",
      "opacity": 0.04
    },
    "z3": {
      "x": 560,
      "y": -30,
      "w": 220,
      "h": 440,
      "label": "3 · DB-per-tenant",
      "color": "green",
      "opacity": 0.04
    },
    "z4": {
      "x": 850,
      "y": -30,
      "w": 310,
      "h": 200,
      "label": "4 · cell — tenants 1-500",
      "color": "purple",
      "opacity": 0.04
    },
    "z5": {
      "x": 850,
      "y": 220,
      "w": 310,
      "h": 200,
      "label": "4 · cell — tenants 501-1000",
      "color": "purple",
      "opacity": 0.04
    }
  },
  "texts": {
    "t1": {
      "x": 10,
      "y": 450,
      "text": "isolation and cost-per-tenant both rise left to right — hybrid-sharded = tenants MIGRATE between rungs as they grow",
      "color": "gray",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-19T09:00:00.000Z",
    "modifiedAt": "2026-07-19T09:00:00.000Z"
  }
}