Max Tables & Design Pattern

后端 未结 5 618
谎友^
谎友^ 2020-12-18 15:32

I am working on an app right now which has the potential to grow quite large. The whole application runs through a single domain, with customers being given sub-domains, wh

5条回答
  •  情话喂你
    2020-12-18 15:56

    You can do whatever you want.

    1. If you've got the customer_id in each column, then you've got to write the whole application that way. That's not exactly true as there should be enough to add that column only to some tables, the rest could be done using some simple joins.

    2. If you've got one database per user, there won't be any additional code in the application so that could be easier.

    3. If you take to first approach there won't be a problem to move to many databases as you can have the customer_id column in all those tables. Of course then there will be the same value in this column in each table, but that's not a problem.

    Personally I'd take the simple one customer one database approach. Easier to user more database servers for all customers, more difficult to show a customer data that belongs some other customer.

提交回复
热议问题