-
-
Notifications
You must be signed in to change notification settings - Fork 1
Multi Tenancy
github-actions[bot] edited this page Sep 6, 2026
·
1 revision
SyncFlow supports multi-tenancy via tenant context threading and row-level isolation.
public record TenantContext(
TenantId tenantId,
String organizationId,
String workspaceId,
String projectId,
String userId,
List<String> roles,
Instant establishedAt
) {}- JWT Authentication — Login returns a JWT with tenant claims
-
Context Extraction — Filter extracts
TenantContextfrom JWT -
Explicit Threading —
TenantContextpassed through all orchestrators and workers -
Row-Level Scoping — Every domain table has
tenant_idcolumn; queries filter by it
All domain tables include tenant_id:
-
connections,pipeline_designs,snapshot_jobs,sync_jobs -
dead_letter_events,processed_events,active_captures -
api_keys,audit_records,quotas
The system tenant (UUID configured in migrations) is used for:
- Admin operations
- Agent registration
- System-level resources
Organization
└── Workspace
└── Project
└── Pipeline
Each level has its own RBAC scope. API keys can be scoped to specific organizations or projects.
Every state-changing operation is recorded in audit_records:
AuditRecord
├── tenantId
├── userId
├── action (CREATE, UPDATE, DELETE, EXECUTE)
├── resourceType (PIPELINE, CONNECTION, etc.)
├── resourceId
├── timestamp
└── details (JSONB)GDPR compliance: right-to-delete anonymizes audit records instead of deleting them.