TENANCY FEATURE
Tenant Context Resolution
See how Semitexa resolves the active tenant from subdomain, header, path, or query input before the rest of the platform runs.
Resolution Story
Resolve the tenant once, then the rest of the stack can trust it
This is the moment where a request stops being generic traffic and becomes tenant-scoped execution. Once that choice is made, configuration, data isolation, and background work can all stay deterministic.
SubdomainStrategy
FallbackExtracts tenant from the subdomain.
Best for: White-label apps and branded customer entrypoints
Tradeoff: Requires DNS and routing setup for each tenant-facing host.
acme.demo.semitexa.dev
HeaderStrategy
Wins nowReads X-Tenant-ID request header.
Best for: API gateways and internal service calls
Tradeoff: Only works when upstream systems reliably forward the tenant header.
X-Tenant-ID: acme
PathStrategy
FallbackReads the first path segment as tenant ID.
Best for: Admin consoles and shared hosts where subdomains are not practical
Tradeoff: URLs stay explicit, but tenant identity becomes part of every visible path.
/acme/products
QueryParamStrategy
FallbackReads the ?tenant= query parameter.
Best for: Testing, debugging, and temporary operator tools
Tradeoff: Useful for diagnostics, but usually too weak as the primary production entrypoint.
?tenant=acme
Resolver Chain
Priority order stays explicit
The first strategy that confidently resolves a tenant stops the chain. That keeps the behavior reviewable instead of scattering tenant guessing across controllers or middleware fragments.
acme.demo.semitexa.devX-Tenant-ID: acme/acme/products?tenant=acmeWhat this boundary protects
Each strategy implements TenantResolverInterface::resolve(Request $request): ?TenantContext. Returning null means "not matched, let the next strategy try".
Once the chain resolves a tenant, that TenantContext becomes the foundation for configuration, data isolation, and background propagation. In a Swoole runtime the context is coroutine-scoped, so concurrent executions in different tenants do not bleed into each other.
The real message is simple: multi-tenancy is not a decorative mode. It is an execution boundary.