Service 06
Multi-tenant SaaS development with real tenant isolation
One platform, many customers, and a data model where one customer can never see another's data.
- PostgreSQL
- Auth
B2B SaaS lives or dies on trust. If a single query forgets to filter by account, one customer can see another's data. I design multi-tenant apps so isolation is enforced in the database itself, using PostgreSQL row-level security (RLS) in Supabase, not just checks scattered through the app code.
Around that core you get the pieces every B2B product needs: organisations or workspaces, invites, roles and permissions, workspace switching, and admin views for your support team. Policies are tested, so a missing filter cannot leak data across tenants.
The same patterns scale from your first customer to your hundredth without a rewrite of the data layer.
What's included
- Tenant model: organisations, memberships and roles
- Row-level security policies for every tenant-owned table
- Policy tests that prove one tenant cannot read another's data
- Invites, role changes and workspace switching
- Per-tenant settings, limits and plan checks
- Support and admin views across tenants
- Documentation of the access model for future developers
From first call to launch
- 01
Model the tenants
We decide what a tenant is, who belongs to it and what each role can do.
- 02
Enforce in the database
RLS policies and memberships are built first, with tests, before feature screens.
- 03
Build the team features
Invites, roles, switching and settings are added on top of the safe core.
- 04
Audit and hand off
A final tenant-leak check, then the access model is documented for your team.
Questions clients ask
What is row-level security (RLS)?
A PostgreSQL feature that checks every row a user tries to read or change against a policy, for example "only rows from your own organisation". Because the database enforces it, a bug in app code cannot bypass it.
Shared database or one database per customer?
For most B2B SaaS, a shared database with a tenant id on each table and RLS is simpler and cheaper to run. Separate databases make sense for strict compliance needs; we decide this together in discovery.
Can you add multi-tenancy to an existing app?
Often yes. It usually means adding organisations and memberships, migrating existing data into them, and adding policies table by table with tests.