multi-tenancy

Installation
SKILL.md

Multi-Tenancy

Treat tenant identity as an authorization boundary, not a query convenience.

Choose an isolation model

  • Database per tenant: strongest isolation and highest operational cost.
  • Schema per tenant: strong logical isolation with shared infrastructure.
  • Shared schema with tenant_id: simplest operations, but every access path must enforce scope.
  • Document the selected model and prohibit repositories from bypassing it.

Resolve tenant identity

  • Derive the tenant from a verified token claim, trusted host mapping, or authenticated API key.
  • Reject missing, unknown, disabled, or conflicting tenant identifiers.
  • Never trust a public X-Tenant-Id header by itself.
  • Clear servlet thread-local context in finally; use Reactor Context for reactive flows.

Enforce isolation

Installs
25
GitHub Stars
271
First Seen
Aug 12, 2026
multi-tenancy — rrezartprebreza/spring-boot-skills