Files
SmartSeat/.brain/postgres-multi-tenant.md

654 B

PostgreSQL 16 Hybrid Multi-Tenant Setup

Architektur Overview

  • Docker Setup: PostgreSQL 16 Alpine via Docker Compose.
  • Rollen-Isolation: app_user (DML) & migration_user (DDL).
  • Master Schema: tenants Tabelle in V1__init_master_schema.sql.
  • Tenant Schemas: dining_areas, restaurant_tables, guests, reservations, reservation_table_assignments, staff_users in V1__init_tenant_schema.sql.

Backend Integration

  • TenantContext (ThreadLocal Schema Resolver)
  • SchemaBasedMultiTenantConnectionProvider (Hibernate Connection Handling)
  • HikariCP Connection Pool optimiert für Postgres in application.yml.