0

Similarly to this question, I am trying to build a system that can handle a large number of users. It is intended for use by organizations, which means that each organization must have completely separate data and each organization can have hundreds of users each generating hundreds of records.

I want to use MongoDB to store this data, but I am not sure what the recommended way to organize such a database is. I am thinking that I will simply create a separate database for each organization (myapp-org-1, myapp-org-2) on my server and each database will have similar collections (Users, Passes, Areas, etc) because this seems like a faster and less error-prone solution than storing everyone's data in a single database and using some sort of key to separate them by organization.

Which method is faster / otherwise better, and why?

laptou
  • 6,389
  • 2
  • 28
  • 59
  • y mongodb and not traditional database? sounds like a classical relational case for the data – DZDomi Jan 13 '19 at 18:57
  • @DZDomi Why does this situation sound like a relational database would be better? And I am using MongoDB mostly because it's convenient. – laptou Jan 13 '19 at 18:58
  • i dont know your structure/requirements exactly, but if they all have references to each other (per database) then relational makes more sense then MongoDB – DZDomi Jan 13 '19 at 19:00
  • @DZDomi The items in my collections do have lots of many-to-many references within each database, but those items also do not all have the same shape/structure (for example, some `User`s are administrators and have several additional properties that do not apply to other users) – laptou Jan 13 '19 at 19:07
  • Never mind, I found my answer here: [MongoDB performance - having multiple databases](https://stackoverflow.com/questions/16916903/mongodb-performance-having-multiple-databases) – laptou Jan 13 '19 at 19:08

0 Answers0