// the take
Triplex adds Postgres-schema-per-tenant (or MySQL database-per-tenant) multitenancy to Ecto-based Elixir apps, following the same pattern as Rails' apartment gem. It's for teams building a SaaS on Phoenix/Ecto who want tenant isolation without hand-rolling schema switching and tenant-aware migrations themselves.
Integrates through Ecto's existing `prefix` option rather than inventing a new query API, so you keep using `Repo.all/get!` as normal. Ships mix tasks for generating and running tenant-scoped migrations, and the migrate task is resumable — if it fails partway through a few hundred tenants, the next run picks up where it left off instead of starting over. Includes ready-made plugs for the three common ways to resolve the current tenant (subdomain, session, URL param), which covers most real SaaS routing setups out of the box.
Last pushed July 2024, so it's been over two years without a commit — for a library that sits directly on your schema and migration path, that's a real concern if Ecto or Postgres behavior shifts underneath it. Schema-per-tenant isolation is only as strong as your discipline: Triplex doesn't enforce the prefix everywhere, so a missed `prefix:` option on a raw query silently reads or writes the wrong tenant's data. Tenant migrations run one tenant at a time, so deploy time scales linearly with tenant count — fine at dozens of tenants, painful at thousands. The MySQL path is a second, less-exercised code path (one database per tenant plus a separate tracking table) rather than a first-class equal to the Postgres schema approach.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →