Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple databases vs. one database with IDs used to separate organizations

In the situation of a web application that organizations can sign up for and use to manage data, what are the pros and/or cons of the two following options?

  • One database per organization where the data for each organization is entirely separated into individual databases, with one (very small) centralized database that keeps a basic listing of the organizations and their database identifiers.

  • One database for the entire application where all the entities are stored in one large database and separated using an organization identifier column on each table.

Some other aspects to consider:

  • Data will never be shared between organizations in the database, nor will login credentials.
  • Some organizations will allow the general public to register an account with the application to submit data, others will not.
  • We plan on exposing a public API for organizations to integrate their current processes with our application. Organizations will be able to generate API keys to allow access to their data, but there won't be a public API that spans organizations.
  • Companies will be storing potentially sensitive data in the application.

From your experience and/or knowledge, what is the right way to go about this design decision (or is there a "right" way at all?)

like image 456
Adam Maras Avatar asked Nov 06 '10 21:11

Adam Maras


1 Answers

Here is an in-depth discussion on MSDN (Multi-Tenant Data Architecture).

I would add that there is no right/wrong way. It all depends on requirements, existing expertise and cost.

like image 182
Oded Avatar answered Sep 30 '22 05:09

Oded