Do you create an extra database for each site running on same drupal core or use replication, what is the best practice at the outset for setting up multisite databases on a vps centos server?

  • Can you explain why you want to use multiple databases? Are you using a mulit-site setup, or separate instances of Drupal? – user5681 Mar 7 '13 at 3:18
  • I am using multi-sites working from one drupal core in a subsite but also I will be having multi-sites from a non drupal core when I've finished setting up this. – cea Mar 7 '13 at 4:10
  • Anyway I just went ahead and created another database rather than follow replication tutorial. – cea Mar 7 '13 at 5:53
  • Ok cool. I would have thought you couldn't simple set a different connection string and Drupal would recreate the schema. – user5681 Mar 7 '13 at 6:20
  • Guess will learn other ways as I go along- thanks. :) – cea Mar 7 '13 at 7:09

This question is dangerously off-topic, but as far as Drupal is concerned there are two primary things to consider.

True multisite (multiple independent sites running our of the same DOCROOT) versus multiple sites on the same server don't really come into play. In fact, you could also apply this to multiple sites using the same database server instance.

Running multiple sites out of the same database catalog is used when

  1. You only have one catalog to use and need to share it (eg, shared hosting).
  2. You want to share some tables between instances.

However, as those state, this isn't a good idea. Apart from the stability issues with sharing tables, you also have the security issue of an exploit in one site potentially getting at the data from another site.

Ideally, each site should have its own catalog in your database server, and each of these should have a unique user associated with it that has full access (minus GRANT) with connections limited to where the site is running from (either localhost or the IP address of the webserver). This is the username/password that you should use in your settings.php

Database replication doesn't really factor into the decision here. It is use for performance and/or redundancy reasons. Drupal has some support for master/slave arrangements, but it is not really transparent.

  • Thanks MPD , what do you mean by 'minus GRANT'? I am not doing shared hosting. I have one site I will use in different geographical areas with own users for that area and some changes to site based on area – cea Mar 7 '13 at 23:30

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