Skip to content

Organizations

An organization is whatever your application calls a tenant: an account, a company, a workspace. Its rows are identified by a value in a column of the tables you choose (the tenant column), and child tables reach it through a foreign key to a parent (parent_column).

lokadb enable converts the chosen tables of your cloud database into tables partitioned by organization, in place, without copying rows. After that every organization is one partition:

  • an organization that stays in the cloud lives in a local partition;
  • an organization that moves gets a partition that is a postgres_fdw foreign table pointing at its own database, reached through the tunnel.

LokaDB promises one thing: the rows of the chosen tables of a moved organization are stored only in that organization's database. What it does not isolate is listed on the limits page; promise customers isolation only together with that list.

Which tables belong to an organization is described in the spec; check -org-table proposes it from your schema. Keys of type smallint, integer, bigint, uuid, text and composite keys are supported; the tenant column may be an integer or a uuid (schemas and keys).

Moving an organization out, and back, is online and reversible: see enable and move and move back.