Exploiting Relationship Graphs to Isolate Tenant Data
summary
Shows a concrete exporter that reads PostgreSQL metadata (information_schema / pg_catalog), builds a directed graph of tables and foreign keys, traverses to produce a connected subgraph for one tenant, and then toposorts that graph to emit constraint-safe COPY/INSERT statements. Example Node.js tool Arachnne handles type metadata from the pg driver, demonstrates extracting one tenant from a three-tenant demo, warns about lookup tables/enums and cycles, and is available on GitHub as a reference implementation.
AI-written summary · about
chapters (7)
- 0:00Start
- 1:33We've got too many databases
- 2:44Multitenant Database Architectures
- 10:09Digraphs
- 12:25The Information Schema
- 16:19Multiple vertices can exist for the same table
- 19:18Lookup Tables Ruin Everything
related talks
51mExploring Postgres Databases with Graphs
52mRe-engineering Postgres for Millions of Tenants
45mGraph databases, PostgreSQL and SQL/PGQ
27mExploring property graphs with SQL/PGQ in PostgreSQL
46mPostgreSQL as a Graph Database: Who Grabbed a Beer Together?
28mDivide and Conquer: Multi-tenancy in Postgres
15mEasy Metadata Management (Git for Data) Using Neo4j
22mQuerying & Visualizing Graphs in Postgres with Apache AGE
