Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We're a small startup and I need to setup several applications, almost all of which require a database.

I face the choice of setting up one instance of MySQL, with one database for each of our applications, or of setting up a separate instance of MySQL for each application.

What is the generally accepted best practice in this situation? One database to serve them all, or divide and conquer?

share|improve this question

Knowing nothing else, simpler is always better. One instance.

share|improve this answer
Is that really simpler? Generally all setup instructions seem to be written from the perspective that the mysql server will only be hosting that application. Setup documents don't seem to do a very good job about telling you how to setup permissions correctly to separate various applications. If you are only looking at this from the perspective of simplicity I don't think you can make a strong case for a single database server, there are pros and cons both ways on this point. – Zoredache Sep 16 '10 at 21:44
BTW, I am not saying I disagree with the single instance recommendation, I am just saying that it may not be as simple as it looks/sounds. – Zoredache Sep 16 '10 at 21:45

Agree with others - one instance of mysql, but:

  • seperate databases for each app
  • seperate user/password for each app

This will make it much simpler to migrate later. However do use innodb rather than c-isam as your storage engine - the latter (IIRC) still only process one request at time.

When you do need to upgrade to multiple servers, then I'd recommend using master-master replication so that each node still serves all the databases rather than splitting it, until you get to about 4 nodes, then start partitioning based on database.

share|improve this answer

One instance of MySQL, multiple databases is best practice.

I can't think of many scenarios where the ideal situation would be to run multiple instances of MySQL with one database per instance. It seems silly.

share|improve this answer

Once instance is better because:

  • you can use all available resources (ram and disk space)
  • mysql can assign the resources if needed
  • caching will be able to use the max. amount of memory (no stale caches)
  • single place for managment
  • easier to maintain
share|improve this answer

One instance on a high spec machine, fast disk array (SSD's maybe, LACP network) and create separate DB's and login's for each application.

This is a typical deployment for most database systems, especially SQL. You must consider availability however when centralising your database server. Therefore in most production environments you will see an SQL cluster consisting of a pair of servers replicating each other or sharing some SAN storage.

share|improve this answer

You always have to consider when you put multiple databases in one instance of MySQL, they can also corrupt each other if they share the same user.

Additionally you can only use one mysqld version. Maybe one of your databases need a different version.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.