1
Good night.
I’m creating a PHP system that looks like a virtual shopping mall (several "stores" and each store with its products).
For this I need to store data from users, stores, businesses, products, schedules, days, orders, payments, etc, etc and such.
In addition to all this of the user interface, it would still have the Helpdesk layer, administration (on the part of the stores), system administration, settings, Analytics, statistics and etc.
So my question is this, in terms of performance x organization, compensates me to separate these layers into separate databases?
For example, a main database with the essential tables (users, stores, products...) and other banks with the auxiliaries (statistics, Helpdesk and etc).
Taking into account that it will be common to query between banks (search for a user when saving a ticket in Helpdesk and etc).
Is that feasible? Does it affect performance (all the banks on the same server)? Anyone who has done this could tell me about their experience?
Thank you.
Typically multiple databases are used for better scalability. If the stores are independent and each one has their own data, I believe that the best thing to do is that each store has a separate database. The advantage of this is for maintenance (you can know who uses more and less resources, move databases to another server, monitor backups), this allows stores to have different versions, ie modifies to one but not to all. But separating data that have meaning among themselves I do not consider interesting, but I have never been through any situation of this kind, so...
– Inkeliz
You can use postgresql with schema, for example, the common tables you mentioned would be in a general schema, and each store would have its own schema, with the tables containing information only for the specific store. So everything would be in one bank and organized.
– fernandoandrade