RSS Forums RSS
Please support our Database Design advertiser: Programming Forums
Views: 2543 | Replies: 6
Reply
Join Date: Feb 2007
Posts: 1
Reputation: jboog is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jboog jboog is offline Offline
Newbie Poster

tag system

  #1  
Feb 18th, 2007
I'd like to add tags to my app. I have several different resources I would want to apply tags to, such as blogs, picture galleries and a few others. More efficient to add tag columns to each resource table or create a seperate table for tags that refrences each resource.

I can't decide on the trade off.

its a web app written in php5 and mysql5

I'd say I'm an advanced beginner at this stuff so my current implementation shows it.

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Posts: 2
Reputation: binaryten is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
binaryten binaryten is offline Offline
Newbie Poster

Re: tag system

  #2  
Jun 1st, 2007
Originally Posted by jboog View Post
I'd like to add tags to my app. I have several different resources I would want to apply tags to, such as blogs, picture galleries and a few others. More efficient to add tag columns to each resource table or create a seperate table for tags that refrences each resource.

I can't decide on the trade off.

its a web app written in php5 and mysql5

I'd say I'm an advanced beginner at this stuff so my current implementation shows it.

Thanks

It would be better to store the tags in a seperate table as you said with a reference to them in a cross reference table. This also has the benefit of avoiding duplication.
Reply With Quote  
Join Date: May 2007
Location: West Coast, US
Posts: 95
Reputation: Stylish is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 8
Stylish's Avatar
Stylish Stylish is offline Offline
Junior Poster in Training

Re: tag system

  #3  
Jun 2nd, 2007
Many to Many.

Tables:
Posts (id, title, text, etc)
Tags (id, name, description, etc)
PostsTags (postsid, tagsid)
I NEED AN ADULT!
Reply With Quote  
Join Date: Jul 2007
Posts: 21
Reputation: dezignwork is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
dezignwork's Avatar
dezignwork dezignwork is offline Offline
Newbie Poster

Re: tag system

  #4  
Jul 16th, 2007
I am in process of doing something similar for one of my web sites.

I would add another question here for anyone to discuss. Is there a better design that allows to group tags so that they don't grow exponentially over time.

Imagine tags like: tag, tags, the tags, tagg, etc.

Any ideas?

Tim
hosting :: development :: design
dezignwork.com
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,468
Reputation: debasisdas is on a distinguished road 
Rep Power: 4
Solved Threads: 88
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Nearly a Posting Virtuoso

Re: tag system

  #5  
Jul 24th, 2007
it would be better to store the tags in a separate table and maintain relationship by tagid or somthing that is more suitable according to the condition.
Share your Knowledge.
Reply With Quote  
Join Date: Jul 2007
Posts: 21
Reputation: dezignwork is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
dezignwork's Avatar
dezignwork dezignwork is offline Offline
Newbie Poster

Re: tag system

  #6  
Jul 25th, 2007
Thanks for reply.

You are right. That is exactly the approach that I am going with. Basically 2 tables where one holds the tag_id's and is easily searchable.

However, the solution looks too simple and possibly not very efficient. Is there any other solution that could be more efficient or is this as far as it goes?

I am talking about efficiency since I expect that there will be 300,000+ records (at least these are clients' estimations)
Last edited by dezignwork : Jul 25th, 2007 at 3:28 am. Reason: spelling
hosting :: development :: design
dezignwork.com
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,468
Reputation: debasisdas is on a distinguished road 
Rep Power: 4
Solved Threads: 88
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Nearly a Posting Virtuoso

Re: tag system

  #7  
Jul 26th, 2007
why are u thinkin g that 3 M records is too much. Creating index on useful column will solve all your problem.
Share your Knowledge.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:05 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC