Answer the question
In order to leave comments, you need to log in
Service design on YII2. How smarter?
I would like to understand how to organize data storage. I am designing a service in YII2. The service is something like CRM. The user registers, receives CRM on a subdomain, can create an account for managers with the assignment of different rights. Managers can leave messages, get clients, and so on.
Is it right to store each CRM on a subdomain in one database? If so, how to isolate them from each other?
For example, a table with messages will store many records, is it enough to select only by CRM ID.
Where can I get knowledge on designing and developing such systems in PHP.
Answer the question
In order to leave comments, you need to log in
We have our own subdomain and our own database for each client. Clients are registered after a bureaucratic procedure - the conclusion of an agreement. If you store all clients in the same database, you will still come to the table partitioning procedure, otherwise everything will work very slowly.
In our version, there are difficulties - updating the database structure, you need to apply migrations for each database. Now this is solved by a bash script + a file with a list of clients. Of course, there is also a plus - if the migration fell off - we broke only one client, the rest can work fine. So if you configure the deployment correctly, there will be no problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question