← Graph

Schema-Level Partitioning

concept 4 connections

Multi-tenancy approach where each tenant lives in its own Postgres schema (a namespace of tables) and the application switches schemas via the search_path session parameter. Very low-effort migration — transparent to most of the app. Drawbacks: Rails migrations only target the public schema, so a custom migration process must be built; creating a new tenant is expensive (new schema + migration); backups become much harder (cited as Heroku's reason to advise against it); you must manage shared (public) vs tenant schemas. Original authors of the 'apartment' gem publicly stated the approach didn't work for them long-term.

category
pattern
about
Schema-Level Partitioning concept
Second partitioning level covered.
about
Schema-Level Partitioning concept
Question compares partitioning approaches for cross-tenant aggregation.
concept Schema-Level Partitioning
related_to
PostgreSQL tool
Uses Postgres search_path session parameter to switch schemas.
tool Apartment
related_to
Schema-Level Partitioning concept
Apartment was the de-facto implementation of schema-per-tenant.

Provenance

Read by
5 extractions