I have a photo website and i want to support tags as my original category bucketing is starting to fail (some pictures are family and vacations, or school and friends). Is
if you want real performance with millions of records, you could store tags in one field, comma separated and retreive records with a full-text index/search daemon like sphinxsearch. All you have to add, is a table listing all tags with a count value to know how often they are attached to an item.
I know it's not the usual way and a little more complicated than a pure database solution, but it's really really fast to search tag related items.
You could use full-text search fonctionnality of your database engine too, but when there's lots of records, most engines tend to be slow.
If it's for a small project, you can go your way, seams good and proper way to do. But I would just share with you this other solution. What do you think of ?