Multiple Databases with Zend

carrattrezzi

New Member
I'm building an application (using the zend framework) where we will have multiple clients who login and use the application, and each of these clients will be storing lots of data about their users (I'm using MySQL btw).Basically I'm wondering 2 things:[*]Is having multiple databases, one for each client (ie. ipd_client_CLIENTNAME) with identical tables a stupid idea? Or will it actually be more responsive (than putting everything in one database) if we have 50 clients with 20,000 users' data in 'their' database?I've already managed to build the same system but all on one database, my model classes simply grab the name of the client logged in (in the model classes' init() method) and then dynamically change the name of the table they grab data from, is this going to be just fine?[*]If the "every client on the system gets their own database" makes sense, how exactly would I dynamically change what database my db models connect to (based on which client is logged in)?In case this made no sense, here's an example of what the databases would look like in the two different scenarios (given 2 clients registered on the system):Multiple Databases:ClientA has a database called "ipd_clients_ClientA" with tables "users", "lists".ClientB has a database called "ipd_clients_ClientB" with tables "users","lists".Single Database:ClientA has tables called "users_ClientA", "lists_ClientA".ClientB has tables called "users_ClientB", "lists_ClientB".Hopefully that makes sense.Any help would be GREATLY appreciated, thanks!
 
Back
Top