Database Structure - Php and Mysql - Marketplace

Asked

Viewed 223 times

1

good evening, I have a store system. A database in Mysql for all, I am re-structuring, however I am with a dilemma to solve.

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

Best case scenario?

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

There is possibility in the future to unify all stores in a single site/app, so if you have multiple databases could not hinder this integration?

From now on, thank you.

1 answer

0


What you’re asking is if you should choose multi-tenancy or not. That’s what you should look for. And I already answered about him.

We have no way of responding to your best-case scenario. There are advantages and disadvantages to each case and even if we knew its architecture we can not yet state without knowing the actual volume that will handle, which interferes with the decision. And when you think about architecture you should consider first what to do and then choose the technology you’re going to use, it may be that the one you chose is not the most suitable for any of the scenarios.

There is always the possibility of change, it takes a little work, but it is possible, if you think this can happen, plan thinking about it to facilitate migration.

Particularly if you’re going to keep it all together or separate doesn’t matter so much when it comes to customer registration, both are possible, you can be together physically but separately logically, but if you want to share the same customers for all stores you need to ask yourself if they are from all stores. Is it a company with only several stores? It seems to me that it makes sense to share, so it’s a question of doing it properly. Is each store a different company? It has zero sense in sharing customers. But it’s a business decision not architecture.

  • Thank you for the reply

  • @Legal Jeffersonfernandes, now you can also vote on everything you think is cool on the site.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.