Database Structure - Php and Mysql - Marketplace

1

Good evening, I have a store system. A database in MySQL for all, I am re-structuring, but I have a dilemma to solve.

Customer registration! Because I have only one bank, I have only one registration for each client. But the customer can buy in Store X and Store Y, which could possibly be a different store for each store.

What is the best scenario?

  • Create a database for each store?
  • A database but collections / customer tables for each store?

There is a possibility in the future of unifying all stores in a single site / app, so if you have multiple databases could not make this integration difficult?

Thanks in advance.

    
asked by anonymous 10.08.2018 / 04:31

1 answer

0

What you are asking is whether to choose multi-tenancy or not. This is what you should look for. And I already answered on it.

We can not tell you what is the best case scenario for you. There are advantages and disadvantages to each case and even if we knew its architecture we still can not say without knowing the actual volume that will deal, which interferes in the decision. And when you think about architecture you should consider what to do first and then choose the technology you are going to use, it may be that the one you chose is not the most appropriate for any of the scenarios.

There is always a chance to change, it does a bit of work, but it is possible, if you think this can happen, plan on thinking about it to make it easier to migrate.

Particularly if you keep everything together or separate, it does not matter so much when you talk about customer registration, both are possible, they may be together physically but logically separated, but if you want to share the same customers for all the stores you need to ask them if they are from all stores. Is it a multi-store business? It seems to make sense to share, there is a question of doing it properly. Is each store a different company? It has zero sense in sharing customers. But it's a non-architecture business decision.

    
10.08.2018 / 04:50