This question reminds me of some legacy system which I've seen in the past :D :D :D
In summary it was working in the following way:
There was table client(id, name).
And then dozens of other tables. Don't remember exactly the structure, so I will just use some sample names:
- order_X
- order_item_X
- customer_X
- newsletter_X
"X" being ID from the client table mentioned earlier.
Now imagine dozens of "template" tables become hundreds, once you start adding new clients.
And then in the code, that beautiful logic to fetch data for given client :D
And to make things worse, sets of tables didn't have same DB schema. So imagine those conditions building selects depending on the client ID :D
In summary it was working in the following way:
There was table client(id, name).
And then dozens of other tables. Don't remember exactly the structure, so I will just use some sample names: - order_X - order_item_X - customer_X - newsletter_X
"X" being ID from the client table mentioned earlier.
Now imagine dozens of "template" tables become hundreds, once you start adding new clients. And then in the code, that beautiful logic to fetch data for given client :D
And to make things worse, sets of tables didn't have same DB schema. So imagine those conditions building selects depending on the client ID :D