My team is building an application and a question came up during a brainstorming meeting that I was unsure about so I figured I'd reach out to the Stack Overflow community to get some more opinions. Here's the gist of it:
- Our application creates an account for organizations which have multiple users. Those users have posts and comments.
- The original database design was to have a table for organizations and then each user would be related by the organization's
id
.
One of the developers suggested that we use a separate database for each organization's account to separate data between organizations and to increase performance. I'd never seen any Rails app that used multiple databases that way and I wasn't sure how to even do that in Rails.
My question to you then is:
Would we gain any benefit from using separate databases or is this adding an unneccessary level of complexity to the application?
Example
Say there are 100 organizations. Each organization has 100 users. Each user has 100 posts and 100 comments.
Would querying through these tables be a major performance drain or would having 100 separate databases be unwieldy and cause more issues than it would be worth? Does this cause issues with migrations? The schema would be identical between organizations.
I'm not sure if that was a clear enough question so let me know if you need more information before answering.
I did read the following Stack Overflow articles but they really didn't help me with this decision.