i'm wondering if maybe someone could share any example project or code on how this exactly is implemented in practice. i've tried around multi database but there are certain things i do not understand correctly.
basically i'm having a centralized database for accounting (acounting_db), which stores all accounts and tenant instances available. when a new tenant instance is created, a new tent database should be created and the default database migration should be performed. this step happens for every new instance created. the new tenant databases contain all the data related to the tenants instance and are named like tenant_db_1, tenant_db_2, tenant_db_3, etc.. an overview of all available instances is kept in a table inside the accounting_db.
when a user logs in, i want to select the instance_id he belongs to from the accounting_db and open up a second db connection to his assigned tenant_db_x.
is tenanti capable of achieving this and how would i perform the according (second) tenant database connection after a user logs in? maybe i need a middleware?
hello,
i'm wondering if maybe someone could share any example project or code on how this exactly is implemented in practice. i've tried around multi database but there are certain things i do not understand correctly.
basically i'm having a centralized database for accounting (acounting_db), which stores all accounts and tenant instances available. when a new tenant instance is created, a new tent database should be created and the default database migration should be performed. this step happens for every new instance created. the new tenant databases contain all the data related to the tenants instance and are named like tenant_db_1, tenant_db_2, tenant_db_3, etc.. an overview of all available instances is kept in a table inside the accounting_db.
when a user logs in, i want to select the instance_id he belongs to from the accounting_db and open up a second db connection to his assigned tenant_db_x.
is tenanti capable of achieving this and how would i perform the according (second) tenant database connection after a user logs in? maybe i need a middleware?
thanks in advance