What is multi-tenant architecture, and how is customer data kept apart?
Tenant, account and workspace: what the words mean
A tenant is one customer organisation using the system. It might be a company, a chamber, a clinic or a franchise group. Everything a tenant owns, including its users, records, files and settings, belongs to that tenant and to nobody else.
Vendors use different words for the same idea. You may see account, organisation, workspace or site. When you read a proposal, ask what the unit of separation is, because that single decision shapes how all the data is isolated.
The three main ways to separate tenant data
Most systems choose one of three patterns. Each one trades cost, simplicity and the strength of the boundary between customers.
- One set of tables with a tenant column. Every row carries a tenant identifier, and every query filters on it. This is the most common pattern, because it is cheap to run and simple to scale for many small customers.
- One database with a separate schema per tenant. Each customer gets its own group of tables inside a shared database. This gives clearer boundaries and easier per-tenant backups, at the cost of more maintenance when the structure changes.
- A separate database per tenant. Each customer runs in its own database. Isolation is strongest and restores are simple, but every change must be rolled out to many databases, and costs rise with the number of customers.
Enforcing isolation inside the database
With a shared table, the database itself can enforce the rule. PostgreSQL, for example, supports row-level security, which stops a query from returning rows that do not belong to the current tenant. The check then lives in the database rather than in application code, where one missed filter could leak data.
Application code still matters. The system should take the tenant from the signed-in user, never from a value the browser sends, and every route that reads or writes data should pass through the same check. A single unguarded endpoint is enough to expose a whole table.
Per-tenant settings and branding
Customers expect to configure the product: their logo and colours, their terms, their fields, their approval steps and the name their emails come from. Store these as tenant settings rather than as code changes. A new customer then becomes a set of configuration values, not a new branch of the software.
Limit what each tenant can change. Let customers adjust labels, workflows and notification rules within bounds your team defines, and keep security settings under your own control.
- Logo, colours and sender name.
- Time zone and currency.
- Roles and approval steps.
- Notification templates.
- Data retention period and enabled features.
The risks when isolation goes wrong
The most serious failure is one tenant seeing another tenant's data. It often comes from a forgotten filter, a cache that stores one customer's page and serves it to another, a search index that is not scoped, or a background job that runs without a tenant set. Each of these looks correct in a demonstration with one customer.
A useful test is to create two tenants with different data, sign in as one, and try to reach every record type of the other through the screens, the API and the export tool. Repeat the test after each release. Look especially at these common places:
- Caches keyed on a page address but not on the tenant.
- File links that work for anyone who holds them, with no check of the requester.
- Reports and exports that include every tenant by default.
- Logs that collect personal data from many customers in one place.
- Background jobs that loop over every tenant but forget to set which one they are working on.
Questions to ask before you choose a design
A good builder answers these in plain language. Vague answers are a warning sign, even when the proposal sounds impressive.
Check the data protection rules in every market where your customers live, and read the official guidance from the regulator there. Ask these before you sign:
- Which pattern do you use, and why does it suit the number of customers we expect?
- Where is the tenant check enforced: in the database, in application code, or in both?
- How are backups and restores done for a single tenant?
- Can one tenant move to its own database later without a rewrite?
- How is a tenant's data deleted when its contract ends?
How Hundred Seas helps
Hundred Seas is a product studio in Taipei that builds custom software, web apps and mobile apps. Chamberflow, our membership management software for chambers of commerce, handles members, renewals, dues and events on the web, iOS and Android. We bring the same care to tenant design: separation, settings and cross-customer testing are agreed before the first customer goes live.
The scope step takes about one week at a fixed price and finishes with a written plan, a clickable prototype and a firm quote. Building then runs in weekly releases of working software, and a monthly run plan keeps the system secure and current once customers depend on it.
Questions
- Is a multi-tenant system less secure than a separate system for each customer?
- Not inherently. Strong multi-tenant designs are common and well understood. The risk lies in how isolation is implemented and tested. A shared system with tenant checks in the database and regular cross-tenant tests can be safer than many hand-maintained copies, which drift apart and miss patches. Ask how isolation is tested, not only how it is described.
- Will one large customer slow everyone else down?
- It can, if the system shares resources without limits. Good designs set per-tenant limits on requests and background work, index queries by tenant, and move a very heavy customer to its own database when needed. Ask how the system behaves when one tenant sends a sudden burst of traffic or runs a very large export.
- Can a tenant move to its own database later?
- Yes, if the design was planned for it. The move involves copying that tenant's rows, switching its connection and verifying the data afterwards. Without planning, it can mean a rewrite. Ask a builder to describe the migration path before you sign, even if you do not expect to need it.
- How do we check that our customers' data is really separated?
- Create two test tenants with different records, then try to reach each other's data through every screen, API route, file link and export. Automated tests should repeat the same checks on each release. Keep the results, and run the checks again after any change to permissions, caching or background jobs.
- Do all tenants need the same features?
- Not usually. Most systems switch features on or off per tenant, based on the plan a customer bought or a setting it chose. This lets one codebase serve a small club and a large group without separate versions. Keep these feature rules in configuration, so you can review them and explain them to customers.