Results 1 to 2 of 2

Thread: Best approach to relating databases or tables?

Hybrid View

  1. #1
    Join Date
    Jul 2008

    Best approach to relating databases or tables?

    Hello everyone,

    How are all you fellow programmers on this fine "Monday" morning?

    I wonder if anyone can help with a database dilemma that I am having please?

    DB: MySQL 5
    Platform: Ubuntu

    I would really appreciate some advice on the correct avenue to take with a project I am working on.

    What I have:
    *I have a database that maintains a large table of articles. (similar to wordpress).
    *I intend to relate a given article to another set of data. This set of data will be fairly huge.
    *There maybe various sets of data that will be related.

    The query:
    * Is it better to contain these various large sets of data within the same database of articles, which will have a large set of traffic on it.
    * Is it better to create different databases (on the same server) that relate by a primary key to the main database with the articles.

    I didn't want to plough ahead with this without getting some advice or opinion from the community.

    I really appreciate anyone who takes the time to offer some thought on the matter.

    Many thanks


  2. #2
    Join Date
    Aug 2004
    I don't think a separate database on the same server gains you anything, while adding extra complexity. At the most you should just need a separate table within the same DB. If there is a one-to-one relationship between article and "extra data", it should not even hurt to have it in the same table, as long as your queries which to not utilize that extra data do not select all columns ("*") and thus retrieve bytes you don't need.

    If there is a one-to-many or many-to-many relationship, then you'll want a second table with a foreign key relation, or in the latter case a third table to define the relationships.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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