12-19-2020, 04:14 AM
Hi All,
Does anyone have suggestions on best practices to allow multiple users to access specific databases, from the same instance of the application using CI4?
I've developed a customer application using CI4, however other companies are interested in using the application. I do NOT want to copy the application for each company (with their own config) as this will cause major headaches with any sort of change management and maintenance.
My first thought was to replicate the database tables, prepend the table name with a unique identifier and tie the identifier to the customer "profile" and make this available via some variable or other. However I do not think this is robust enough or secure enough.
I'm now thinking of creating a separate database instances for each customer, and somehow identifying the correct database instance in CI4 (app->config->database.php), when the user logs in.
Any tips, suggestion or nudges in the right direction will be very much appreciated?
Does anyone have suggestions on best practices to allow multiple users to access specific databases, from the same instance of the application using CI4?
I've developed a customer application using CI4, however other companies are interested in using the application. I do NOT want to copy the application for each company (with their own config) as this will cause major headaches with any sort of change management and maintenance.
My first thought was to replicate the database tables, prepend the table name with a unique identifier and tie the identifier to the customer "profile" and make this available via some variable or other. However I do not think this is robust enough or secure enough.
I'm now thinking of creating a separate database instances for each customer, and somehow identifying the correct database instance in CI4 (app->config->database.php), when the user logs in.
Any tips, suggestion or nudges in the right direction will be very much appreciated?