
Multi-Tenant SaaS Data Isolation: A Practical Design Review for Founders
Review tenant boundaries across requests, storage, background jobs, files, search, support access, and AI features before a SaaS launch.
MVPs & SaaS Projects
Design SaaS custom-domain onboarding with distinct ownership, DNS routing, certificate, tenant-binding, and live verification states, plus a deliberate removal path.

LET’S BUILD SOMETHING USEFUL
Talk to Ataraxy Developers about your website, app, or custom software.
A custom domain feature can look simple from the settings page: enter a hostname and add a DNS record. Behind that interface, several independent checks must agree before the hostname should serve a customer’s workspace. The customer must control the name, traffic must reach the intended service, a valid certificate must be ready, and the application must map the request to the correct tenant. Combining those checks into one Connected badge makes failures difficult to explain and can hide an unsafe activation path.
Design the feature as an onboarding workflow with observable states. A useful first version can support a narrow set of hostname types and a clearly documented provider integration. It does not need to solve every apex-domain or proxy configuration immediately. The important part is to tell an administrator exactly which step is pending, what evidence the system has observed, and what action is appropriate next.
Create a durable record containing the normalized hostname, requesting tenant, authorized administrator, provider identifier, and current verification state. Validate the input as a hostname rather than accepting arbitrary URLs, paths, or port numbers. Define how internationalized names and case normalization are handled. Enforce uniqueness at the appropriate scope so two workspaces cannot independently claim the same active hostname through simultaneous requests.
Authorization matters before DNS verification begins. A regular workspace member should not gain permission to change the public entry point simply by knowing the settings endpoint. Check the administrator’s current role on every relevant action and retain an audit trail of activation, replacement, and removal. Keep the original platform URL available as a recovery route where the product permits it, so a mistaken DNS change does not make the entire administration interface unreachable.
Ownership verification proves a specific condition about control of the hostname. It does not necessarily prove that ordinary visitor traffic is already routed to the SaaS application. Cloudflare’s hostname validation documentation describes ownership verification and notes that pre-validation does not itself shift traffic to the SaaS zone. Use the exact verification procedure of the selected provider rather than inventing a generic record that only appears convincing in the UI.
Show the required record type, name, and value as separate fields, with clear copy actions. Explain whether the provider expects a full hostname or a relative label in its DNS editor. Avoid asking customers to replace unrelated records or copy broad instructions from another registrar’s interface. Include the last check time and a specific observed result, such as verification record not yet found, instead of treating every delay as an authentication problem.
A hostname may pass ownership verification while its certificate is still pending or while traffic still points elsewhere. Represent those conditions independently. The interface can show ownership confirmed, routing pending, and certificate pending without claiming the site is ready. Follow the current provider documentation for certificate validation and status handling. Do not assume a successful hostname-creation response means the HTTPS endpoint is already safe to advertise to customers.
Decide when the application activates the tenant binding and when the administrator can make the domain primary. Verify the live HTTPS result before the final transition. Check the requested hostname, certificate validity, expected application response, and tenant identity together. A generic successful page from a hosting provider is not sufficient. The result should demonstrate that the customer’s actual workspace is served at the intended name without crossing into another account.
The application should resolve an incoming hostname through an approved mapping, not trust an arbitrary Host header as a tenant identifier. Unknown or inactive names need a safe response. Do not fall back to the first workspace in a database or infer ownership from a similar-looking subdomain. Review proxy behavior so the application uses only trusted forwarding information. The mapping must remain correct across caches, redirects, and background-generated links.
For example, a SaaS client portal might use both a platform subdomain and a customer-branded name. Define which is canonical for generated invitations and which remains available for recovery. Check login redirects, logout, password recovery, and links sent from background jobs. A successful public landing page test can miss a sign-in flow that returns users to the wrong tenant or loops between the platform address and the branded hostname.
DNS and provider operations may take time, and responses can be uncertain. Store provider identifiers and reconcile the existing hostname before retrying creation. A timeout should lead to a read of the current provider state, not an automatic duplicate request. Keep a bounded checking policy and provide a manual recheck action that does not overwhelm the provider. Show when the last check happened so an administrator can distinguish stale information from an actively observed failure.
Use separate internal error categories for missing verification, conflicting ownership, routing mismatch, certificate failure, and application verification failure. Translate those into customer actions without exposing unnecessary provider internals. If the system cannot verify a condition, keep the domain pending. A reassuring Connected label is not helpful when it merely means the polling process stopped. Support should have access to the same state history and observations as the onboarding system.
A custom domain is not permanent proof of ownership. Customers may change DNS, close a workspace, or transfer control of a domain. Define what happens when an administrator removes the hostname and how provider resources and tenant mappings are released. Keep the sequence deliberate so an inactive mapping cannot continue serving a former customer’s data. Review the case where DNS still points to the platform after the SaaS record has been removed.
Require appropriate verification before a hostname is assigned to a different tenant. Do not treat knowledge of an old domain name as sufficient evidence to reclaim it. Maintain a concise audit history that supports investigation without preserving obsolete credentials or challenge material longer than needed. Include removal and re-addition in testing; onboarding-only tests often miss the lifecycle transitions that create the most confusing support cases.
Test a valid setup, a wrong record value, a hostname already claimed, a certificate delay, and a DNS change after activation. Use dedicated test domains and avoid altering a customer’s unrelated production records. Check the public endpoint from outside the hosting environment and verify login and generated links. AI can help draft provider-specific explanations from reviewed documentation, but it should not invent DNS values or automatically edit a customer’s zone from a vague support message.
A dependable custom-domain feature verifies several facts before declaring success. Keep ownership, routing, certificate readiness, and tenant binding separate; reconcile uncertain responses; and test the full lifecycle through removal. Administrators then receive clear next steps, while the application has a concrete record of why a hostname is allowed to serve a particular workspace.
LET’S BUILD SOMETHING USEFUL
Talk to Ataraxy Developers about your website, app, or custom software.