Lex-van-Os / ApproveAI

Multitenant approval system for GPT answers, through the use of user management and workflow approval
1 stars 0 forks source link

Introduce best practice multitenancy database definition #17

Open Lex-van-Os opened 1 month ago

Lex-van-Os commented 1 month ago

To ensure that the platform will be able to work with multiple database connections, configuration of the database should be enhanced so that an instance of the application will be able to access its own database

Lex-van-Os commented 1 month ago

FIY:

Lex-van-Os commented 1 month ago

Dynamic Database Connection Strings: Each tenant should have its own database connection string. The application must dynamically choose the correct connection string based on the tenant making the request. Tenant Identification: You'll need a way to identify which tenant is making a request (typically from the request header, subdomain, or authentication token). Connection Pooling and Caching: Since each tenant uses a different database, manage connections efficiently to avoid repeatedly opening new connections for each request. Database Migrations: Migrations should be applied to each tenant’s database individually.