Best way to implement keywords for image upload gallery
- by Dan Berlyoung
I'm starting to spec out an image gallery type system similar to Facebook's. Members of the site will be able to create image galleries and upload images for others to view. Images will have keywords the the uploader can specify.
Here's the question, what's the best way to model this? With image and keyword tables linked vi a HABTM relation? Or a single image table with the keywords saved as comma delimited values in a text field in the image record? Then search them using a LIKE or FULL TEXT index function?
I want to be able to pull up all images containing a given keyword as well as generate a keyword cloud.
I'm leaning toward the HABTM setup but I wanted to see what everyone else though. Thanks!!