{"type":"excalidraw","version":2,"source":"https://AwesomeSystemDesign.dev","elements":[{"angle":0,"strokeColor":"#6577aa","backgroundColor":"#eef1fc","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-1"}],"updated":0,"link":null,"locked":false,"id":"shape-0","type":"rectangle","seed":41,"x":466,"y":32,"width":390,"height":667.8000000000001,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-1","type":"text","seed":114,"x":486,"y":50,"width":350,"height":631.8000000000001,"fontSize":18,"fontFamily":1,"text":"Option B: Shared Database,\nSeparate Schema\n(Schema-per-Tenant)\n\nEach tenant gets its own schema\nwithin a shared database.\n\nPros:\n+ Stronger isolation than shared\ntables\n+ Easier per-tenant backup/restore\n+ No tenant_id column needed in\nqueries\n\nCons:\n- Schema migrations across 100K\nschemas = SLOW\n- Connection pool exhaustion (one\npool per schema?)\n- Doesn't scale past ~5K tenants\nper instance\n\n• PostgreSQL Instance\nSchema: tenant_acme projects:\n(project_id, name, ...)\nSchema: tenant_bigcorp projects:\n(project_id, name, ...)","originalText":"Option B: Shared Database,\nSeparate Schema\n(Schema-per-Tenant)\n\nEach tenant gets its own schema\nwithin a shared database.\n\nPros:\n+ Stronger isolation than shared\ntables\n+ Easier per-tenant backup/restore\n+ No tenant_id column needed in\nqueries\n\nCons:\n- Schema migrations across 100K\nschemas = SLOW\n- Connection pool exhaustion (one\npool per schema?)\n- Doesn't scale past ~5K tenants\nper instance\n\n• PostgreSQL Instance\nSchema: tenant_acme projects:\n(project_id, name, ...)\nSchema: tenant_bigcorp projects:\n(project_id, name, ...)","textAlign":"center","verticalAlign":"middle","containerId":"shape-0","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#628572","backgroundColor":"#edf5ee","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-3"}],"updated":0,"link":null,"locked":false,"id":"shape-2","type":"rectangle","seed":187,"x":36,"y":32,"width":390,"height":714.6,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-3","type":"text","seed":260,"x":56,"y":50,"width":350,"height":678.6,"fontSize":18,"fontFamily":1,"text":"Option A: Shared Database, Shared\nSchema (Pool Model)\n\nALL tenants in the SAME database,\nSAME tables.\nIsolation via tenant_id column +\nRow-Level Security.\n\nPros:\n+ Cheapest (one DB serves 1000s\nof tenants)\n+ Simplest operations (one schema\nto migrate)\n+ Efficient resource utilization\n\nCons:\n- Noisy neighbor risk (one tenant's\nquery slows others)\n- Cross-tenant data leak if RLS\nmisconfigured (security risk)\n- Cannot offer different regions per\ntenant\n- Hard to meet strict compliance\n(HIPAA, data residency)\n\n• PostgreSQL Shard 1\nprojects: tenant_id | project_id |\nname acme | p1 | Q2 Launch bigcorp |\np2 | Migration startup | p3 | MVP","originalText":"Option A: Shared Database, Shared\nSchema (Pool Model)\n\nALL tenants in the SAME database,\nSAME tables.\nIsolation via tenant_id column +\nRow-Level Security.\n\nPros:\n+ Cheapest (one DB serves 1000s\nof tenants)\n+ Simplest operations (one schema\nto migrate)\n+ Efficient resource utilization\n\nCons:\n- Noisy neighbor risk (one tenant's\nquery slows others)\n- Cross-tenant data leak if RLS\nmisconfigured (security risk)\n- Cannot offer different regions per\ntenant\n- Hard to meet strict compliance\n(HIPAA, data residency)\n\n• PostgreSQL Shard 1\nprojects: tenant_id | project_id |\nname acme | p1 | Q2 Launch bigcorp |\np2 | Migration startup | p3 | MVP","textAlign":"center","verticalAlign":"middle","containerId":"shape-2","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-5"}],"updated":0,"link":null,"locked":false,"id":"shape-4","type":"rectangle","seed":333,"x":36,"y":786.5999999999999,"width":390,"height":738,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-5","type":"text","seed":406,"x":56,"y":804.5999999999999,"width":350,"height":702,"fontSize":18,"fontFamily":1,"text":"Option C: Dedicated Database per\nTenant (Silo Model)\n\nEach tenant gets its own database\ninstance.\n\nPros:\n+ Maximum isolation (no shared\nanything)\n+ Per-tenant region, performance\ntuning, backup\n+ Compliance-friendly (data\nresidency, HIPAA)\n+ Noisy neighbor impossible\n\nCons:\n- Expensive (100K DB instances =\nmassive cost)\n- Operational burden (manage 100K\ndatabases)\n- Schema migrations across 100K\ninstances\n- Inefficient for small tenants (1\nuser, 100 MB, own DB?)\n\n• DB: acme (RDS instance)\n\n• DB: bigcorp (RDS instance)\n\n• DB: startup (RDS instance)","originalText":"Option C: Dedicated Database per\nTenant (Silo Model)\n\nEach tenant gets its own database\ninstance.\n\nPros:\n+ Maximum isolation (no shared\nanything)\n+ Per-tenant region, performance\ntuning, backup\n+ Compliance-friendly (data\nresidency, HIPAA)\n+ Noisy neighbor impossible\n\nCons:\n- Expensive (100K DB instances =\nmassive cost)\n- Operational burden (manage 100K\ndatabases)\n- Schema migrations across 100K\ninstances\n- Inefficient for small tenants (1\nuser, 100 MB, own DB?)\n\n• DB: acme (RDS instance)\n\n• DB: bigcorp (RDS instance)\n\n• DB: startup (RDS instance)","textAlign":"center","verticalAlign":"middle","containerId":"shape-4","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#9180ac","backgroundColor":"#f4effb","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-7"}],"updated":0,"link":null,"locked":false,"id":"shape-6","type":"rectangle","seed":479,"x":466,"y":786.5999999999999,"width":390,"height":808.2,"customData":{"revealStep":4}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-7","type":"text","seed":552,"x":486,"y":804.5999999999999,"width":350,"height":772.2,"fontSize":18,"fontFamily":1,"text":"Recommendation: HYBRID (Tiered by\nPlan)\n\nFree tier (80K tenants):\n→ Shared pool (Option A)\n→ tenant_id column + RLS\n→ Sharded by tenant_id hash (50\nshards)\n→ Cost: ~$0.01/tenant/month\n\nPro tier (18K tenants):\n→ Shared pool with dedicated shard\ngroups\n→ Higher resource quotas, priority\nqueries\n→ Sharded by tenant_id (smaller\ntenants share shards)\n\nEnterprise tier (2K tenants):\n→ Dedicated database instance\n(Option C)\n→ Custom region, compliance controls\n→ Dedicated cache, compute\nresources\n→ Cost: $500-5000/tenant/month\n(justified by contract value)\n\nMigration path: Tenant upgrades\nFree→Pro→Enterprise\n→ Data migrated from shared pool\nto dedicated instance\n→ Transparent to the tenant (zero\ndowntime)","originalText":"Recommendation: HYBRID (Tiered by\nPlan)\n\nFree tier (80K tenants):\n→ Shared pool (Option A)\n→ tenant_id column + RLS\n→ Sharded by tenant_id hash (50\nshards)\n→ Cost: ~$0.01/tenant/month\n\nPro tier (18K tenants):\n→ Shared pool with dedicated shard\ngroups\n→ Higher resource quotas, priority\nqueries\n→ Sharded by tenant_id (smaller\ntenants share shards)\n\nEnterprise tier (2K tenants):\n→ Dedicated database instance\n(Option C)\n→ Custom region, compliance controls\n→ Dedicated cache, compute\nresources\n→ Cost: $500-5000/tenant/month\n(justified by contract value)\n\nMigration path: Tenant upgrades\nFree→Pro→Enterprise\n→ Data migrated from shared pool\nto dedicated instance\n→ Transparent to the tenant (zero\ndowntime)","textAlign":"center","verticalAlign":"middle","containerId":"shape-6","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":4}}],"appState":{"viewBackgroundColor":"#fbfbf8","gridSize":null},"files":{}}