0

I am running three different sites with ImpressPages CMS v 2.6.. ImpressPages is built on PHP 5.3 and MySQL 5. Each site have about 33 MySQL tables and the databases is using MyISAM engine.

I have two configuration options. First: I can create 3 different databases for each site. Second: I can use single database with different table_prefix_ for each site.

I am confused with above two options. Which option will save resources on my shared hosting plan and without hitting website performance.

I am coming through database count limit question, it states that there is no limit for no. of databases, but my question is Having Multiple databases or multiple tables in one database, which one is better option without effecting performance?

2 Answers2

1

Multiple databases would be better than multiple tables although performance would be the same in most situation. This is because you can replicate and dump separate databases easier and less chance of affecting other databases.

neo
  • 203
  • 3
  • 7
  • Can you please provide me some reference for your answer. I just want to learn more about how to fine tune my application. – Nishant Kumar Apr 18 '13 at 05:10
0

There is little (if any) performance benefit to either approach.

In terms of security however, you can set up each site with its own MySQL user and only grant permissions to the appropriate database. That way, if (worst case) a site gets compromised and the attacker has access to your MySQL password, the attack is contained to a degree.

There is an argument that if they have filesystem access, they can navigate to the other sites and get their passwords too, but at least you're adhering to sound security principles.

The only time I would advise deviating from this is if you are limited to a certain amount of databases with your shared host (most only allow you a small number on their starter packages).

There's no real reference to back this up AFAIK, but I run 16 WordPress websites using the approach above if that counts.

Craig Watson
  • 9,370
  • 3
  • 30
  • 46