0

how can I make app for restaurant and need to create separated database for each restaurant , beside that I need to create another database that contain all customers only from all restaurant

this will be the structure

restaurants --->
----restaurant-1
----restaurant-2
----restaurant-3

customers --->  all customers in restaurant-1, restaurant-2, restaurant-3

I also need to make user in any restaurant separated from others so he can have one account and it contains 2 restaurant

Mohamed Adel
  • 211
  • 3
  • 3
  • I would do exactly that, but you should include the restaurant ID in the customer object. It could be a string or an array. You should think what queries you would normally run...and don't create unbounded arrays – Minsky Nov 14 '20 at 13:12
  • Hard to answer this Q by StackOverflow (Too broad + based on opinion). Sometimes it is a good idea to separate your DB. Anyway, Create a separate DB for each restaurant sound like "mega overkill" (Easier to manage the front/backend/API of one collection of restaurants VS 500). Maybe helpful: https://stackoverflow.com/questions/16916903/mongodb-performance-having-multiple-databases – Ezra Siton Nov 14 '20 at 18:30

0 Answers0