Multitenant Mystery Only Rockers in the Building
summary
Shows how a Java Spring Boot 3.1 app implements schema-per-tenant isolation with Hibernate and Postgres, uses Testcontainers and Flyway for dev, and wires Keycloak for per-tenant auth via a dynamic client-registration/authentication-manager resolver. Adds Micrometer/OpenTelemetry and MDC logs to tag traces and metrics with tenant IDs. Builds a Gateway to extract tenant from hostname. A surprising bug: a global cache returns another tenantβs guitar; fixed by a tenant-aware cache key generator, restoring correct isolation.
AI-written summary Β· about
chapters (12)
- 0:00Introduction
- 1:10Multi-tenancy overview
- 3:58Tenant resolution
- 7:27Tenant context management
- 11:06Data isolation strategies
- 14:20Implementing separate schemas
- 19:22Hibernate configuration
- 25:38Observability and logging
- 29:12Distributed tracing
- 38:46Gateway routing
- 41:12Dynamic security
- 45:19Debugging and conclusion
related talks
52mMultitenancy: cost-efficient and scalable patterns for Software-as-a-Service
25mMultitenancy with Rails
26mMultitenant Web Applications with Phoenix
28mDivide and Conquer: Multi-tenancy in Postgres
30mMulti-tenancy strategies with Django+PostgreSQL
25mMulti-Tenancy Architecture Lessons Learned
52mRe-engineering Postgres for Millions of Tenants
57mMulti-tenancy in Laravel
