Professional Web Applications Themes

Multiple databases or just one... - MySQL

I suspect thuis is quite a basic question... Currently I have a large number of databases, but each is identical in structure. Each refers to a specific site - so there is the site A database, the site B database, the site C database etc, and each contains a series of tables. But each database has the same structure because the information sotred about each is of the same type. Is there a way to bring all these into one database - instead of having multiple databses, have a table showing the name of each previously independant database which I ...

  1. #1

    Default Multiple databases or just one...

    I suspect thuis is quite a basic question...

    Currently I have a large number of databases, but each is identical in
    structure. Each refers to a specific site - so there is the site A
    database, the site B database, the site C database etc, and each
    contains a series of tables. But each database has the same structure
    because the information sotred about each is of the same type.

    Is there a way to bring all these into one database - instead of
    having multiple databses, have a table showing the name of each
    previously independant database which I can then access? Would this be
    a good thing to do? I ask because putting a frontend on a database
    seems to be easier when you just have one...

    Any comments or suggestions?

    Cheers,

    Ben

    Ben Guest

  2. #2

    Default Re: Multiple databases or just one...

    Wording this slightly better, I suppose I'm asking whether there is a
    better way in MySQl of making a heirachical database than using
    multiple databases :-)

    Cheers,

    Ben


    Ben wrote:
     

    Ben Guest

  3. #3

    Default Re: Multiple databases or just one...

    I think I can put all the data into the same tables with monor
    modifications actually.... that would make things a lot simpler :-)

    Ben


    Ben wrote:
     [/ref]

    Ben Guest

  4. #4

    Default Re: Multiple databases or just one...

    I don't think there is a general better way. You reduce database
    maintenance when all the tables are not duplicated anymore, but if your
    website code is still as duplicated as the tables are, you'd have
    created a code maintenance problem (which can be solved by combining the
    code as well, off course).

    The combination of the tables may be a nuisance if you want to host any
    of the websites on another server.

    There is, off course, a middle way. You can put all the duplicated
    tables in one database, and leave more custom tables in a separate one.

    When it comes to test versions of a database, however, I prefer a
    separate MySQL instance, so I switch on the test server's query log.

    Best regards

    Ben wrote: [/ref]
    >[/ref]
    Dikkie Guest

  5. #5

    Default Re: Multiple databases or just one...

    Instead of having a separate database for each site you can have one
    database for all sites, but add SITE_ID into each primary key. In that way
    you can still extract info for individual sites.

    --
    Tony Marston
    http://www.tonymarston.net
    http://www.radicore.org

    "Ben" <com> wrote in message
    news:googlegroups.com... 


    Tony Guest

Similar Threads

  1. Replies: 0
    Last Post: August 25th, 09:25 AM
  2. multiple databases
    By Paulo Neves in forum PHP Development
    Replies: 6
    Last Post: July 7th, 05:33 PM
  3. Query using multiple databases?
    By Gary1 in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: July 4th, 11:44 AM
  4. One ASP Site...Multiple Databases
    By Mike Hill in forum ASP Database
    Replies: 3
    Last Post: April 16th, 06:44 AM
  5. [PHP] multiple databases
    By Jeff Harris in forum PHP Development
    Replies: 0
    Last Post: July 16th, 03:56 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139