SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Wizard wheeler's Avatar
    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

  2. #2
    SitePoint Addict
    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?

  3. #3
    SitePoint Wizard wheeler's Avatar
    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

  4. #4
    SitePoint Wizard cranial-bore's Avatar
    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.

  5. #5
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    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.
    good point, plesk I think is pretty hopeless in managing databases, from memory you can't even select permissions for the db user, they must have complete permission.
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •