Home / Insights / Architecture and Modernization
Architecture and Modernization
Designing for Multi-Tenancy and White-Labelling from the First Release
Retrofitting tenancy into a product built for one customer is one of the most expensive refactors in software. The good news is that the decisions which matter most are cheap to make early. This guide sets out what to build into the first release, and what you can safely defer.
Key takeaways
- Decide what a tenant is (organisation, division, reseller, end customer) before writing the data model; it shapes identifiers, billing, permissions and branding.
- Isolation is a spectrum, not a binary. Most products start pooled, with a tenant identifier on every row, and keep the option to move premium or regulated tenants to dedicated resources.
- Enforce tenant context in one place, the request pipeline and the data layer, and add database-level safeguards such as row-level security rather than relying on every query being written correctly.
- Treat white-labelling as configuration, not code: design tokens, per-tenant assets, custom domains and email identities driven by a tenant settings record.
- Automate tenant onboarding and test cross-tenant access from day one; both are far harder to add after the first enterprise customer signs.
On this page
- What is a tenant in your product?
- Which isolation model fits the first release?
- How do you enforce tenant context safely?
- How do you make white-labelling configuration, not code?
- What should tenant onboarding and operations look like?
- What belongs in the first release, and what can wait?
- Multi-tenancy and white-label design checklist
- Frequently asked questions
- Sources and methodology
Many products begin life serving one customer. A platform built for a single clinic group, franchise or distributor works well, and then the business wants to sell it to a second customer, or to let a partner resell it under their own brand. At that point the team discovers that customer-specific assumptions are everywhere: in the database, in configuration files, in email templates, in hard-coded logos and in reports that quietly read every row.
This article is for CTOs, founders and product leads planning a SaaS product, a platform for several business units or a white-label offering for partners. It explains how to define tenants, choose an isolation model, carry tenant context safely through the system, make branding configurable and automate onboarding, with a view to what belongs in the first release. It reflects the trade-off thinking we bring to software architecture consulting: make the decisions that are expensive to reverse visible early, and keep everything else simple.
What is a tenant in your product?
Before choosing databases or deployment patterns, agree what a tenant is. Microsoft’s Azure Architecture Center guidance on tenancy models notes that in B2B products tenants usually map to customer organisations, but a large customer may need several tenants for divisions or regions, or separate environments for testing and production. In consumer products a tenant may be an individual, a family or a club.
Questions that settle the definition
- Who signs the contract and pays? That is usually the billing tenant.
- Whose data must never be visible to anyone else? That defines the isolation boundary.
- Who controls branding? With resellers, the brand owner may differ from the end customer.
- Can a user belong to more than one tenant? Consultants, agencies and group administrators often do.
- Do tenants have sub-units (sites, teams, clinics) with their own permissions?
White-label adds a layer
White-labelling often introduces a hierarchy: the platform owner, partners who resell under their own brand, and the partners’ customers. Model this explicitly, for example as a parent-child relationship between tenants, so that a partner can see and manage its customers while customers stay isolated from each other.
Action: write a one-page tenancy definition with a diagram of platform, partner, tenant, sub-unit and user, and the rules for which can see what. Record it as an architecture decision; our guide to architecture decision records describes a lightweight format.
Which isolation model fits the first release?
The AWS Well-Architected SaaS Lens describes three broad patterns. In the silo, pool and bridge models, silo gives tenants dedicated resources, pool shares resources across tenants, and bridge mixes the two by service. Microsoft frames the same idea as a spectrum and stresses that each tier can be set differently: a shared web tier with isolated databases, for instance.
| Model | Data layout | Strengths | Risks and costs | Fits when |
|---|---|---|---|---|
| Pool: shared database, shared schema | Tenant ID column on every tenant-owned table | Lowest cost, one deployment, simple onboarding and upgrades | Leakage if a query misses the filter; noisy neighbours; one outage affects all | Many small or mid-sized tenants; first release for most SaaS |
| Schema per tenant | Same database, separate schema per tenant | Clearer separation, easier per-tenant export | Migrations multiply; connection and catalogue limits at scale | Tens to low hundreds of tenants with moderate isolation needs |
| Database per tenant (horizontal partitioning) | Shared application, dedicated database | Strong data separation, per-tenant backup and restore, noisy-neighbour relief on the data tier | Needs automated provisioning, migration and monitoring of many databases | Enterprise tenants, regulated data, large tenants |
| Silo: deployment per tenant | Dedicated stack per tenant, automated | Maximum isolation, per-tenant release timing | Highest cost; fleet management and reporting are hard | Few, large or highly regulated customers |
A sensible default
For most products the first release should be pooled, with a tenant identifier on every tenant-owned row, plus a tenant mapping layer that can route a tenant to a different database or deployment later. Microsoft’s guidance describes exactly this kind of lookup, from tenant to deployment, as the mechanism that lets tenants move between shared and dedicated infrastructure. Building the indirection in early costs little; adding it later means touching every data access path.
For example, an illustrative HR software vendor might launch with all tenants pooled, then move its two largest customers to dedicated databases once their data volume and contract terms justify it, without changing application code beyond configuration.
Action: choose the default model per tier (web, API, workers, database, file storage, search) and write down the trigger that would move a tenant to a more isolated option.
How do you enforce tenant context safely?
In a pooled system, isolation depends on every request carrying the right tenant context and every data access honouring it. Microsoft’s guidance is explicit that shared deployments rely on application code and a tenant identifier to keep data separate, which is why the enforcement design deserves more attention than the database choice.
Resolve tenant context once
- Derive the tenant from a trusted source: the authenticated user’s token claims or a verified domain mapping, never a client-supplied header or query parameter alone.
- Resolve it in middleware at the start of the request and make it available through a request-scoped context.
- Propagate it explicitly to background jobs, queues, caches and logs. Many leaks happen in workers and reports, not in the main API.
Enforce it centrally
The OWASP Authorization Cheat Sheet recommends denying by default and validating permissions on every request through global mechanisms such as middleware, rather than per-method checks, because one missed check can expose a resource. It also warns that hiding or randomising identifiers is not enough: access to each specific object must be checked. In multi-tenant terms, a user who guesses another tenant’s invoice ID must still be refused.
Add a database safety net
If you use PostgreSQL, row-level security can enforce tenant filters inside the database. The documentation notes that when row security is enabled and no policy applies, no rows are visible, which is the default-deny behaviour you want. It also notes caveats: table owners bypass policies unless you use FORCE ROW LEVEL SECURITY, and superusers and roles with BYPASSRLS always bypass them. Run the application under a non-owner role and set the tenant in a session variable that policies read.
Other shared resources
- Prefix cache keys and object storage paths with the tenant ID.
- Partition search indexes or filter every search query by tenant.
- Scope rate limits and quotas per tenant to limit noisy neighbours.
- Include tenant ID in every log line and trace for support and audit.
Action: add automated tests that log in as a user of tenant A and attempt to read, update and list tenant B’s records through every API endpoint and export. Run them in CI on every change.
How do you make white-labelling configuration, not code?
White-label requests start small (a logo and a colour) and grow: custom domains, branded emails, terminology changes, feature bundles, partner-specific legal text. If each request becomes a code branch, the product fragments. The rule is that every tenant runs the same code, and differences live in configuration.
What to make configurable from the start
| Area | First release | Later, if demand appears |
|---|---|---|
| Visual identity | Logo, favicon, primary and secondary colours via design tokens | Full theme overrides, typography, dark mode per brand |
| Domain | Tenant subdomain on your domain | Custom domains with automated certificate issuance |
| Tenant name and reply-to in templates | Sending from the partner’s domain with their authentication records | |
| Content and terminology | Product name and support links in settings | Per-tenant labels and translations |
| Features | Feature flags evaluated per tenant and plan | Partner-defined bundles and pricing |
| Legal and compliance | Tenant-specific terms and privacy links | Data residency choice per tenant |
Design tokens make theming cheap
Build the UI on named design tokens (colour, spacing, radius, typography) rather than hard-coded values, and load a tenant’s token set at runtime. A rebrand then becomes a data change. Check contrast for each brand palette, because a partner’s brand colour may fail accessibility requirements when used for text or buttons.
Custom domains and email
Custom domains look simple and are not: you need domain verification, certificate automation, routing from domain to tenant, and a support process when a partner’s DNS is misconfigured. Branded email sending similarly depends on the partner publishing the right DNS records. Defer both until a paying partner needs them, but design tenant resolution so a domain can map to a tenant later.
Action: create a tenant settings schema now, even if the first release only uses three fields, and route all branding through it.
What should tenant onboarding and operations look like?
Tenancy succeeds or fails operationally. A manual, spreadsheet-driven onboarding process becomes the bottleneck as soon as sales picks up.
Step-by-step: automated tenant onboarding
- Create the tenant record with a unique, immutable identifier and its parent partner if any.
- Assign plan, feature flags and limits.
- Provision or allocate data resources according to the tenant’s isolation tier (a row in a shared table, or a new database from a template).
- Apply branding settings and, if used, the tenant subdomain.
- Create the first administrator and send an invitation through the tenant’s branded template.
- Seed reference data and run a health check that confirms the tenant can sign in and that cross-tenant access is denied.
- Register the tenant in billing, monitoring and support tooling.
Operational capabilities to plan for
- Per-tenant observability: request volumes, errors and resource usage by tenant, to spot noisy neighbours and support issues.
- Per-tenant export and deletion: enterprise contracts and data protection law will ask for it.
- Tenant migration: moving a tenant between shared and dedicated resources, which the mapping layer makes possible.
- Support access: audited, time-limited impersonation rather than shared admin accounts.
- Schema migrations: one process that applies to pooled and dedicated databases alike.
Enterprise buyers will probe these during procurement; our article on SOC 2 readiness and security questionnaires covers the questions to expect, and multi-region architecture and data residency covers customers who need their data kept in a specific region.
Action: script tenant creation end to end before the second customer, even if it is run by an engineer at first.
What belongs in the first release, and what can wait?
Over-building tenancy delays launch; under-building it creates a rewrite. The test for each item is how expensive it would be to add later.
| Build now (expensive to retrofit) | Defer (cheap to add later) |
|---|---|
| Tenant ID on every tenant-owned table, index and storage path | Database-per-tenant or silo deployments |
| Central tenant context resolution and enforcement | Custom domains and certificate automation |
| Tenant-to-deployment mapping layer | Branded email sending domains |
| Tenant settings schema and design tokens | Per-tenant terminology and translations |
| Cross-tenant access tests in CI | Self-service partner portals |
| Tenant ID in logs, metrics and traces | Per-tenant release rings |
| Scripted onboarding | Advanced per-tenant billing models |
Risks to watch
- Customisation creep. Saying yes to tenant-specific code for a large customer starts a fork. Offer configuration or extension points instead.
- Reports and analytics. Ad hoc SQL and BI tools often bypass application-level filters; give analysts tenant-scoped views.
- Global admin tools. Internal tools that see all tenants need their own access controls and audit trails.
- Cost attribution. Without per-tenant usage data you cannot tell which customers are profitable or price premium isolation.
Automated checks can keep these rules from eroding; architecture fitness functions are one way to fail a build when a query or table lacks a tenant filter.
Action: review the build-now column against your current design before the first production release, and log each deferral with its trigger.
Multi-tenancy and white-label design checklist
- Tenant, partner, sub-unit and user relationships defined and recorded as a decision.
- Isolation model chosen per tier, with triggers for moving tenants to dedicated resources.
- Tenant identifier on every tenant-owned record, file path, cache key and search document.
- Tenant context derived from trusted identity, resolved in middleware and propagated to jobs.
- Deny-by-default authorisation and object-level checks on every request.
- Database-level safeguard in place (for example row-level security under a non-owner role).
- Cross-tenant access tests running in CI for every endpoint and export.
- Tenant settings schema driving logo, colours, product name and support links.
- UI built on design tokens; contrast checked for each brand palette.
- Tenant-to-deployment mapping layer in place, even if every tenant maps to one deployment today.
- Scripted onboarding, export and deletion.
- Per-tenant metrics, logs and cost attribution.
Frequently asked questions
Should we start with a database per tenant to be safe?
Usually not. It adds provisioning, migration and monitoring overhead from day one. A pooled design with strong central enforcement, database-level safeguards and a tenant mapping layer gives good protection and lets you move specific tenants to dedicated databases when contracts or scale require it.
Can we add multi-tenancy to an existing single-customer product?
Yes, but plan it as a modernisation project: add tenant identifiers and backfill data, centralise data access, introduce tenant context, then test cross-tenant access thoroughly. An architecture review first will show how widely customer-specific assumptions are spread.
How do we support a large customer who wants their own instance?
Offer it as an isolation tier rather than a separate product: the same code and release process, deployed to dedicated resources through automation, with the tenant mapping layer routing their users. Price it to reflect the extra infrastructure and operations.
What is the difference between white-labelling and multi-tenancy?
Multi-tenancy is about serving many customers from one system with isolated data. White-labelling is about presenting the product under another brand. White-label products are usually multi-tenant, with an extra partner layer that controls branding for its own customers.
How do we prove isolation to enterprise buyers?
Document the isolation model and enforcement points, show automated cross-tenant tests and their results, describe database-level controls, and include tenant isolation in penetration test scope. Buyers’ security questionnaires typically ask for exactly this evidence.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Microsoft Learn: Tenancy models for a multitenant solution (Azure Architecture Center) — accessed 9 November 2026. Tenant definitions, isolation as a spectrum, tenancy model trade-offs and tenant-to-deployment mapping.
- AWS Well-Architected SaaS Lens: Silo, pool, and bridge models — accessed 9 November 2026. Definitions of silo, pool and bridge isolation models.
- OWASP Cheat Sheet Series: Authorization Cheat Sheet — accessed 9 November 2026. Deny by default, centralised checks on every request and object-level access validation.
- PostgreSQL Documentation: Row Security Policies — accessed 9 November 2026. Default-deny row-level security and owner, superuser and BYPASSRLS caveats.
Related reading
Continue your research
Is your product’s tenancy model ready for its second customer, or its first reseller?
We can review your data model, tenant context and branding approach, and give you a short list of what to build now and what to defer.
