The first thing to understand is that tenant resolution has to happen before the first database query.
By the time a request reaches your data layer, the system should have already proven, cryptographically.
which tenant that request belongs to.
The standard pattern uses a signed token, a JWT, or an opaque token backed by a session store that carries a tenant ID claim issued at login.
Subdomain or path-based routing resolves the tenant at the edge.
Middleware validates the token, cross-checks the claim against the subdomain, and attaches the resolved tenant to a request scoped context.
Nothing downstream reads the tenant from a header, a query string, or the request body.
If the token and the hostname disagree, the request is rejected before it ever touches a controller.
Two rules do most of the heavy lifting here.
First, every data access function reads the tenant from request context, never from its arguments.
Second, that context is immutable for the life of the request.
Background jobs that need to act on behalf of a tenant create a fresh context from a stored tenant reference, not from whatever thread local happened to be lying around.
This sounds mechanical, but it's the difference between isolation and the illusion of isolation.
The first thing to understand is that tenant resolution has to happen before the first database query.
By the time a request reaches your data layer, the system should have already proven, cryptographically.
which tenant that request belongs to.
The standard pattern uses a signed token, a JWT, or an opaque token backed by a session store that carries a tenant ID claim issued at login.
Subdomain or path-based routing resolves the tenant at the edge.
Middleware validates the token, cross-checks the claim against the subdomain, and attaches the resolved tenant to a request scoped context.
Nothing downstream reads the tenant from a header, a query string, or the request body.
If the token and the hostname disagree, the request is rejected before it ever touches a controller.
Two rules do most of the heavy lifting here.
First, every data access function reads the tenant from request context, never from its arguments.
Second, that context is immutable for the life of the request.
Background jobs that need to act on behalf of a tenant create a fresh context from a stored tenant reference, not from whatever thread local happened to be lying around.
This sounds mechanical, but it's the difference between isolation and the illusion of isolation.
The rest of this transcript — segmented and speaker-labeled, so you land on the exact moment something was said
Search every transcript — by keyword, by phrase, or by meaning, across every show Radar indexes
Trends — what is surging across podcasts, measured against its own baseline
Alerts — when a name you follow appears in a newly indexed episode
No account is needed to search Radar.