Good example will be shopify. Where you have N number of users (in this case each user assume site). And each user will have it's own records in DB. But db schema will be the same (same tables for each user,
So question is what will be the best way to organize this kind of solution?
Store everything in one DB but in a different tables, or run separate DB for each user (but then will be question with maintaining, scalability and automatization)
We can use one DB with common tables like
etc. And we will have table
where we store records about each site.
we will group all records by
This is one of possible solutions. But if we will have 1000 users (sites), each will have ~2k products, and ~100k customers, we can end up with tables which has millions of records, so questions will be:
- how it will perform compare to each user (site) would have it's own DB?
- how reliable this approach? bigger data, harder maintain, backup/restore
- safety, if something wrong with one source thousands will be affected
Any links etc. will be much appreciated, thanks!