{"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":16,"y":16,"width":288,"height":1151.4,"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":36,"y":34,"width":248,"height":1115.4,"fontSize":22,"fontFamily":1,"text":"Option B: Shared\nDatabase, Separate\nSchema\n(Schema-per-Tenant)\n\nEach tenant gets its\nown schema within a\nshared database.\n\nPros:\n+ Stronger isolation\nthan shared tables\n+ Easier per-tenant\nbackup/restore\n+ No tenant_id\ncolumn needed in\nqueries\n\nCons:\n- Schema migrations\nacross 100K schemas\n= SLOW\n- Connection pool\nexhaustion (one pool\nper schema?)\n- Doesn't scale past\n~5K tenants per\ninstance\n\n• PostgreSQL\nInstance\nSchema:\ntenant_acme\nprojects: (project_id,\nname, ...)\nSchema:\ntenant_bigcorp\nprojects: (project_id,\nname, ...)","originalText":"Option B: Shared\nDatabase, Separate\nSchema\n(Schema-per-Tenant)\n\nEach tenant gets its\nown schema within a\nshared database.\n\nPros:\n+ Stronger isolation\nthan shared tables\n+ Easier per-tenant\nbackup/restore\n+ No tenant_id\ncolumn needed in\nqueries\n\nCons:\n- Schema migrations\nacross 100K schemas\n= SLOW\n- Connection pool\nexhaustion (one pool\nper schema?)\n- Doesn't scale past\n~5K tenants per\ninstance\n\n• PostgreSQL\nInstance\nSchema:\ntenant_acme\nprojects: (project_id,\nname, ...)\nSchema:\ntenant_bigcorp\nprojects: (project_id,\nname, ...)","textAlign":"left","verticalAlign":"middle","containerId":"shape-0","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":1}},{"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-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":16,"y":1211.4,"width":288,"height":1294.4,"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":36,"y":1229.4,"width":248,"height":1258.4,"fontSize":22,"fontFamily":1,"text":"Option A: Shared\nDatabase, Shared\nSchema (Pool Model)\n\nALL tenants in the\nSAME database,\nSAME tables.\nIsolation via\ntenant_id column +\nRow-Level Security.\n\nPros:\n+ Cheapest (one DB\nserves 1000s of\ntenants)\n+ Simplest operations\n(one schema to\nmigrate)\n+ Efficient resource\nutilization\n\nCons:\n- Noisy neighbor risk\n(one tenant's query\nslows others)\n- Cross-tenant data\nleak if RLS\nmisconfigured\n(security risk)\n- Cannot offer\ndifferent regions per\ntenant\n- Hard to meet\nstrict compliance\n(HIPAA, data\nresidency)\n\n• PostgreSQL Shard 1\nprojects: tenant_id |\nproject_id | name\nacme | p1 | Q2\nLaunch bigcorp | p2 |\nMigration startup |\np3 | MVP","originalText":"Option A: Shared\nDatabase, Shared\nSchema (Pool Model)\n\nALL tenants in the\nSAME database,\nSAME tables.\nIsolation via\ntenant_id column +\nRow-Level Security.\n\nPros:\n+ Cheapest (one DB\nserves 1000s of\ntenants)\n+ Simplest operations\n(one schema to\nmigrate)\n+ Efficient resource\nutilization\n\nCons:\n- Noisy neighbor risk\n(one tenant's query\nslows others)\n- Cross-tenant data\nleak if RLS\nmisconfigured\n(security risk)\n- Cannot offer\ndifferent regions per\ntenant\n- Hard to meet\nstrict compliance\n(HIPAA, data\nresidency)\n\n• PostgreSQL Shard 1\nprojects: tenant_id |\nproject_id | name\nacme | p1 | Q2\nLaunch bigcorp | p2 |\nMigration startup |\np3 | MVP","textAlign":"left","verticalAlign":"middle","containerId":"shape-2","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"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-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":16,"y":2549.8,"width":288,"height":1265.8,"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":36,"y":2567.8,"width":248,"height":1229.8,"fontSize":22,"fontFamily":1,"text":"Option C: Dedicated\nDatabase per\nTenant (Silo Model)\n\nEach tenant gets its\nown database\ninstance.\n\nPros:\n+ Maximum isolation\n(no shared anything)\n+ Per-tenant region,\nperformance tuning,\nbackup\n+ Compliance-friendly\n(data residency,\nHIPAA)\n+ Noisy neighbor\nimpossible\n\nCons:\n- Expensive (100K\nDB instances =\nmassive cost)\n- Operational burden\n(manage 100K\ndatabases)\n- Schema migrations\nacross 100K\ninstances\n- Inefficient for\nsmall tenants (1\nuser, 100 MB, own\nDB?)\n\n• DB: acme (RDS\ninstance)\n\n• DB: bigcorp (RDS\ninstance)\n\n• DB: startup (RDS\ninstance)","originalText":"Option C: Dedicated\nDatabase per\nTenant (Silo Model)\n\nEach tenant gets its\nown database\ninstance.\n\nPros:\n+ Maximum isolation\n(no shared anything)\n+ Per-tenant region,\nperformance tuning,\nbackup\n+ Compliance-friendly\n(data residency,\nHIPAA)\n+ Noisy neighbor\nimpossible\n\nCons:\n- Expensive (100K\nDB instances =\nmassive cost)\n- Operational burden\n(manage 100K\ndatabases)\n- Schema migrations\nacross 100K\ninstances\n- Inefficient for\nsmall tenants (1\nuser, 100 MB, own\nDB?)\n\n• DB: acme (RDS\ninstance)\n\n• DB: bigcorp (RDS\ninstance)\n\n• DB: startup (RDS\ninstance)","textAlign":"left","verticalAlign":"middle","containerId":"shape-4","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":3}},{"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-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":16,"y":3859.6000000000004,"width":288,"height":1523.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":36,"y":3877.6000000000004,"width":248,"height":1487.2,"fontSize":22,"fontFamily":1,"text":"Recommendation:\nHYBRID (Tiered by\nPlan)\n\nFree tier (80K\ntenants):\n→ Shared pool (Option\nA)\n→ tenant_id column +\nRLS\n→ Sharded by\ntenant_id hash (50\nshards)\n→ Cost:\n~$0.01/tenant/month\n\nPro tier (18K\ntenants):\n→ Shared pool with\ndedicated shard\ngroups\n→ Higher resource\nquotas, priority\nqueries\n→ Sharded by\ntenant_id (smaller\ntenants share\nshards)\n\nEnterprise tier (2K\ntenants):\n→ Dedicated\ndatabase instance\n(Option C)\n→ Custom region,\ncompliance controls\n→ Dedicated cache,\ncompute resources\n→ Cost:\n$500-5000/tenant/\nmonth (justified by\ncontract value)\n\nMigration path:\nTenant upgrades\nFree→Pro→Enterprise\n→ Data migrated\nfrom shared pool to\ndedicated instance\n→ Transparent to the\ntenant (zero\ndowntime)","originalText":"Recommendation:\nHYBRID (Tiered by\nPlan)\n\nFree tier (80K\ntenants):\n→ Shared pool (Option\nA)\n→ tenant_id column +\nRLS\n→ Sharded by\ntenant_id hash (50\nshards)\n→ Cost:\n~$0.01/tenant/month\n\nPro tier (18K\ntenants):\n→ Shared pool with\ndedicated shard\ngroups\n→ Higher resource\nquotas, priority\nqueries\n→ Sharded by\ntenant_id (smaller\ntenants share\nshards)\n\nEnterprise tier (2K\ntenants):\n→ Dedicated\ndatabase instance\n(Option C)\n→ Custom region,\ncompliance controls\n→ Dedicated cache,\ncompute resources\n→ Cost:\n$500-5000/tenant/\nmonth (justified by\ncontract value)\n\nMigration path:\nTenant upgrades\nFree→Pro→Enterprise\n→ Data migrated\nfrom shared pool to\ndedicated instance\n→ Transparent to the\ntenant (zero\ndowntime)","textAlign":"left","verticalAlign":"middle","containerId":"shape-6","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":4}}],"appState":{"viewBackgroundColor":"#fbfbf8","gridSize":null},"files":{}}