-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Title:
Description:
We need to enhance EnrollNow’s architecture by introducing a multi-tenant database structure to ensure proper data isolation and scalability for multiple organizations (tenants).
Currently, all tenant data resides in a shared schema without strict isolation. This poses risks in terms of data security, performance, and customization.
Proposed Approach:
-
Architecture Choice:
- Database-per-tenant: Each tenant gets its own database.
- OR Schema-per-tenant: Shared database but separate schemas per tenant.
- Evaluate trade-offs for performance, cost, and ease of maintenance.
-
Tenant Identification:
- Implement tenant resolution logic based on subdomain, custom domain, or authentication metadata.
-
Automated Provisioning:
- On new tenant signup, automatically create the database/schema and run migrations.
-
Connection Management:
- Implement dynamic connection handling in Sequelize based on the resolved tenant.
-
Data Security:
- Ensure strict separation so that no tenant can access another tenant’s data.
-
Migration Strategy:
- Create a robust migration script to handle new tenant database initialization and updates.
Acceptance Criteria:
- ✅ System should automatically provision a database/schema for a new tenant.
- ✅ Tenant isolation must be enforced at the database level.
- ✅ No downtime when onboarding a new tenant.
- ✅ Document the multi-tenant structure in
README.md.
References:
- [Sequelize Multi-Tenant Pattern Example](https://sequelize.org/master/manual/advanced-many-to-many.html)
- [Best Practices for SaaS Multi-Tenancy](https://learn.microsoft.com/en-us/azure/architecture/saas/)
Priority: High
Type: Enhancement
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request