I am about to design an enterprise solution for a large scale application in which a windows service, MVC, and many other projects will use a database, so I am thinking about load balancing and best practices to organize my database.
I have two options :
- use different schemas (I know schema is much like a folder)
- use different databases
From the point view of database design which is better, and what's the best practice?
Best Answer
If the databases are going to live on the same server, then from a straightforward performance perspective, using a single database divided by schema vs. a bunch of separate databases isn't going to be any different. There is no "cost" to calling database A vs. database B (unless they are both set to auto-close, a "feature" you should avoid like the plague).
I typically advocate for separate databases, though, for a variety of reasons:
In a previous life I managed a system with many databases; they were one per client with (largely) identical tables/views/procedures. I've answered multiple questions here based on my experience and knowledge through that architecture (including some drawbacks to be aware of in the first answer):
I have yet to hear anyone argue successfully for storing different data (different apps, different customers, etc.) in the same database. I think anyone who chooses to do this is either confident that their data will never outgrow that server, or is focusing on the near term goal of simplicity & minimal effort (which can be quite short-sighted, and bite you in the long run).