mysql - Max Tables & Design Pattern -


I am currently working on an app that has the potential to grow significantly. The whole application is run through a domain, customers are given sub-domains, which means that it all runs through a normal code-base.

What I'm doing is database design. I'm not sure that to specify the customer ID, it would be better to have a column in each table or create a new set of tables (in the same database), or create a whole new database per customer.

The good thing about the "flag" in the customer ID designated database is that everything is in one place, the flaws are clear-Tables can get very much, and maintenance can be a complete nightmare If development happens, it is a great pain to split on many servers.

Good thing about creating a new table is easy to do, and keeps tables tiny and since there is no need to interact for customer data, there is no problem at all. But then, maintenance can be an issue (although I have a migration library that will update on the fly every client, so there is no big deal). I do not know the other issue as to how many tables can be in a single database. Does anyone know what the limit is, and what will be the performance issues?

The good thing about creating a new database per customer is that when I need to scale, then I very well There are many sites that use this design (wordpress.com, etc.). It has been shown to be effective, but it also has some disadvantages.

So, basically I'm just looking for some advice, in which direction I should go (maybe).

Single Database Pro

  • To maintain a database <
  • Security: / Ul>

    Conclusions

    • Support for optimization based on per customer
    • H2>

      If you plan to support customer customization, separate database The view will be valid. Otherwise, security is not seen as a big problem - if someone receives DB credentials, do you really think that they will not be able to see other databases on that server?


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -