What is the best design for these data base tables?

Posted by Mohammed Jamal on Stack Overflow See other posts from Stack Overflow or by Mohammed Jamal
Published on 2011-01-09T04:34:18Z Indexed on 2011/01/09 4:54 UTC
Read the original article Hit count: 250

Filed under:
|

I need to find the best solution to make the DB Normalized with large amount of data expected.

My site has a Table Tags (contain key word,id) and also 4 types of data related to this tags table like(articles,resources,jobs,...).

The big question is:- for the relation with tags what best solution for optimazaion & query speed?

  1. make a table for each relation like:

    • table articlesToTags(ArticleID,TagID)
    • table jobsToTags(jobid,tagid)
    • etc.
  2. or put it all in one table like

    • table tagsrelation(tagid,itemid,itemtype)

I need your help. Please provide me with articles to help me in this design

consider that in future the site can conation new section relate to tag

Thanks

© Stack Overflow or respective owner

Related posts about sql

Related posts about database-design