Database layout tagging system

Posted by Kurresmack on Stack Overflow See other posts from Stack Overflow or by Kurresmack
Published on 2010-03-19T18:21:13Z Indexed on 2010/03/19 18:31 UTC
Read the original article Hit count: 291

Filed under:
|
|

I am creating a web site for a customer and they want to be able to create articles. My idea is to tag them so I am going to implement the system.

What is the best design, both from an architectural and a perfomance perspective:

1. To have table with all tags and then have a one to many relationship table that links a tag like this:

articles table with ID
tags table  with ID
one to many table with columns Article.ID and Tags.ID

2. To have one table with articles and one with tags for articles like this:

articles table with ID
tags table with Article.ID and tag text

Thanks in advance!

© Stack Overflow or respective owner

Related posts about tags

Related posts about sql