---
title: "Architecture"
url: "https://nsta1.github.io/Orleans.Lattice/docs/lattice.api.tenantadmin/architecture.html"
source: "https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/docs/lattice.api.tenantadmin/architecture.md"
package: "Orleans.Lattice.Api.TenantAdmin"
version: "10.5.0"
documents: "Orleans.Lattice 10.5.0 (release line 10.5)"
built: "2026-12-05"
all-pages: "https://nsta1.github.io/Orleans.Lattice/llms.txt"
bundle: "https://nsta1.github.io/Orleans.Lattice/docs/lattice.api.tenantadmin/llms-full.txt"
---
# Architecture

Part of the [Api.TenantAdmin documentation](README.md).

The facade resolves caller authority and composes tenancy, membership, authorization and tree administration. It is transport-independent; gRPC and MCP adapt the same control contracts rather than independently implementing tenant lifecycle.

## Authorization before mutation

Registration requires the tenancy registry and supplies a monotonic write clock and tenant-tree cascade seam. Lifecycle and quota writes use operator authority. Tenant-specific operations consult the target tenant and the relevant operator or tenant-admin tier. Self-service derives visibility from the caller and returns no inaccessible record. Delegated directory/policy operations additionally require the tenancy opt-in and enforce tenant group/tree/rule confinement.

These boundaries are separate: an asserted tenant is not proof of authority, transport authorization is not a tenant-admin grant, and a tenant administrator cannot raise its own quotas or widen the operator-allowed region set. See [the authorization seams](README.md#authorization-seams) for the public contracts.

## Definition writes and side effects

Accepted registry changes carry monotonic last-writer-wins timestamps. Tenant deletion suspends the tenant first, soft-deletes its trees through the tree-cascade seam, and then removes the registry record, which first purges the tenant's tenant-tier rules, tenant groups and their edges, and every cross-tenant grant issued to it. Region-residency changes drive backfill and drain through resumable work. Hosted discovery re-finds owed backfill, and region-status listeners advance the lifecycle as work completes. A recorded target state is not proof that every tree has already moved or been purged.

Backfill discovers logical tenant trees through registry provenance as well as current aliases. A derived physical copy can precede its alias or outlive it; the same-tenant logical tree its registry entry records it as derived from remains the backfill candidate unless the copy is independently configured for replication. Discovery does not enroll either tree: an unenrolled logical owner still blocks the region, as does an independent tree or a copy with foreign-tenant provenance. The region remains `Backfilling` until each candidate finishes receiver bootstrap with its read fence released and its parked tenant-offline replication dead letters replayed. After replaying them the driver re-reads the queue and holds the region while any tenant-offline entry is still parked; a replay the tenant-isolation gate refuses again leaves its entry parked, so that check passes only once every entry has actually applied or settled.

Directory member/group operations use the membership-store seam. Tenant policy operations use the policy-store and policy-decision seams, filtering tenant-visible rules and usage rather than exposing unrestricted cluster policy administration.

## Namespace-confined tree facade

`ILatticeTenantScopedTreeAdmin` composes logical names into the active tenant's tree namespace (refusing with `TenantScopeRequiredException` when no active tenant is in scope), delegates lifecycle operations to `ILatticeTreeAdmin` and schema-policy operations to `ILatticeSchemaAdmin`. Tree creation is authorized here (whole-tree `Admin`) before the delegated create counts it against the tenant's quota, and schema-policy reads and changes are authorized by the tenant-scoped facade itself, because the in-process schema admin performs no authorization. This service does not expose a route for administering another tenant by passing an already-qualified or reserved tree id.

## Source map

- [Registration](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/LatticeApiTenantAdminServiceCollectionExtensions.cs)
- [Lifecycle implementation](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/LatticeTenantAdmin.cs)
- [Region administration](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/LatticeTenantRegionAdmin.cs)
- [Backfill discovery](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/TenantRegionBackfillDiscoveryService.cs)
- [Scoped tree contract](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/ILatticeTenantScopedTreeAdmin.cs)
- [Directory registration](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/Directory/LatticeApiTenantAdminServiceCollectionExtensions.Directory.cs)
- [Policy registration](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.tenantadmin/Policy/LatticeApiTenantAdminServiceCollectionExtensions.Policy.cs)

## Related

- [Public API](api.md)
- [Configuration](configuration.md)
- [Tenancy architecture](../lattice.tenancy/architecture.md)
