Multiple databases across application

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Multiple databases across application

Post by GeXus »

I'm working on a project that could very easily make sense to have multiple databases, due to the way it could logically be broken up. I'm wondering what the best way is to handle connection strings. I'm using a wrapper class that defines the connection string, I'm thinking I could add to that and create a function that just lists all the connection strings, then call that in my page after i initiate the class.. not sure if that's the best way.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's often pretty difficult to justify needing more than one database for an application. If the same connection combination (user/password/client/server) match then you just need to add the database name before the table name references to access the other databases. If they are separate servers you'll need separate connections and separate queries.
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

How would you justify using more than one database? I've just thought that having several smaller databases is more efficient than having one big one
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I've never been able to justify the need for more than one database for a given application. That's why I'm saying it's pretty difficult. :)
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

That works for me :)
Post Reply