SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Jun 8, 2007, 01:04 #1
- Join Date
- Mar 2006
- Location
- Gold Coast, Australia
- Posts
- 1,369
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
when is the time to make a new database on a php site?
I'm used to the concept of working with functions and php files, where there is a need to organise things into logical files/functions... rather than a 10,000 line index.php file.
But I have a situation where it seems like I should start a new database, because even though the applications will talk to each other down the development track, they are also stand-alone entities. I know its possible to work with different databases at the same time in php, but it is a bit of a pain to do... with connection handlers, extra db users etc.
What is the general consensus? To have a very large database with dozens of tables, or to split it off.Studiotime - Time Management for Web Developers
to-do's, messages, invoicing, reporting - 30 day free trial!
Thomas Multimedia Web Development
-
Jun 8, 2007, 01:43 #2
- Join Date
- Feb 2005
- Location
- Brisbane, Australia
- Posts
- 306
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It really comes down to whether it would work more logically one way or the other.
If each application is a standalone entity, I would suggest that seperate databases be used for each. What will you do in the event that you need to seperate one of these applications? Take a copy of the entire database with it?
-
Jun 8, 2007, 02:33 #3
- Join Date
- Mar 2006
- Location
- Gold Coast, Australia
- Posts
- 1,369
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I guess that is a point that it makes it more difficult to backup/seperate with only 1 database
Studiotime - Time Management for Web Developers
to-do's, messages, invoicing, reporting - 30 day free trial!
Thomas Multimedia Web Development
-
Jun 8, 2007, 02:41 #4
- Join Date
- Jan 2002
- Location
- Australia
- Posts
- 2,634
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You don't necessarily need to make 2 connections. As long as the DB user has access to both you can talk to both with a single connection.
You can use mysql_select_db or just specify the DB name in query. JOINS across databases are also possible.
cPanel allows a given user to access multiple database, though I think Plesk does not.
Just decide what's logical. It may be confusing to have a lot of unrelated tables sharing a DB, particularly when viewing an alphabetical list. I have no qualms about dividing my data.
-
Jun 12, 2007, 02:49 #5
- Join Date
- Mar 2006
- Location
- Gold Coast, Australia
- Posts
- 1,369
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Studiotime - Time Management for Web Developers
to-do's, messages, invoicing, reporting - 30 day free trial!
Thomas Multimedia Web Development
Bookmarks