There's quite a bit of discussion out there, regarding tag schema's, but I've noticed that most of it focuses on a single content type, such as bookmarks or photos.
I'm interested in using tags across multiple features of a multi-tenant business app; one where tags could be related to form fields, documents, photos, configuration settings and more.
I'd like to design a smaller set of tables that can scale to these different needs, rather than stamp out link tables for each content type, which adds some complexity:
tags {
tagsID
tagName
}
tagChildren {
childID
childValue
}
tagType {
typeID
typeName
}
entity {
entityID
entityName
...
}
tagMap {
mapID
tagsID (FK)
childID (FK)
typeID (FK)
entityID (FK)
}
The tagMap could be used to connect any number of these items, but would connect at least tags and tagType, at a minimum. For instance, a tag may be associated with a drop-down field type. It may be a registry key with a registry type, a child value and be associated with an entity. A tag child might be another tag, to allow for multi-level parent-child relationships.
There's a risk with distribution, in that many features become dependent on a small set of tables.
If you've been challenged by a similar decision or if you have an idea that would help, please share your thoughts, approach, and how performance relates to the distribution risk.
Thanks!