One or many databases for application for many clients in PHP

I am writing a PHP application in ZF. Customers will use it to sell their products to final customers. Customers will host their application on my server or they could use their own. Most of them will host this application on my server.

I could design one database for all customers at once, so every customer will use the same database, but of course products etc. will be assigned to particular customer. Trivial.

I could use separate database for every customer, so the database structure will be simpler. I will then probably use separate subdomains and maybe even file location, but that is just a detail.

Which solution will have better performance and how big will be the difference? Which one would you choose?

Answers


I would use a separate database for each customer. It makes backup and scaling easier. If you ever get a large customer that needs some custom changes to the schema, you can do it easily.

If one customer needs you to restore their data, with a single database it is trivial. On a shared db, much harder.

And that if large customer ever gets a lot of traffic, you can easily put them on another server with minimal changes.

If one site gets compromised, you don't have all of teh data for everyone in one place, the damage is mitigated to just the site that was hacked.

I'd definitely recommend going with 1 db per customer if possible.


Need Your Help

trying to link two cpp files with a header

class visual-c++ header linker-error

I'm trying to call a function from a cpp file (with a list of functions) in another cpp file, I'm using a header file to set the function prototype in both cpp files, my problem is that I'm getting...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.