Closed zspencer closed 2 months ago
@zspencer can you provide some justification for implementing tags using a relational architecture through a bridge table vs using an array column on a Product
? I generally understand the tradeoffs between these two methodologies, so was hoping you could help me understand why you might prefer one way over another for Convene.
Spitballing...I can imagine a Product
-> Tags
relationship using an array column, that also retains referential integrity if those tags are only chosen via a select dropdown from a pre-filled Tags
record table. (Presuming referential integrity being one major benefit to the relational model.) Of course, an underlying question is whether constraining the tags to a strict taxonomy might be preferable over user-generated values?
Does my question(ing) make sense?
To be honest, I don't really think there's enough difference to encourage one or the other in this particular use case.
My main goal here was making it so Members
can decide what Tags
are allowed in the Marketplace
context. Rails doesn't have great built-in support for searching / filtering by array fields in Postgresql; so this is the "most boring" way to go with it.
If we were to implement it as a field-on-a-row; we'd need to get into deeper arcana than I think is necessary.
A question I think is of greater importance here is what we call these things. label
and tag
are both methods defined in Rails views.
So, what should we call them? Do we call them tags
even though it's a name collision? In the Journal
, we call them Keywords
... Maybe it's actually Product#features
?
@rosschapman - I lied! I forgot that I didn't have clarity on the lesser of N evils, regarding what we call these.
Or maybe we just go hella specific and call them Product#dietary_restrictions
for now?
@zspencer can you provide some justification for implementing tags using a relational architecture through a bridge table vs using an array column on a Product? I generally understand the tradeoffs between these two methodologies, so was hoping you could help me understand why you might prefer one way over another for Convene.
The justification is that Rails people have a bizarre kink for bridge tables. 😉
(I hate bridge tables, because I'm not a Real Rails Person.)
Or maybe we just go hella specific and call them Product#dietary_restrictions for now?
Just to record a brief summary of the convo we just had during ensemble: seems like calling them tags
gives us a bit more flexibility.
The justification is that Rails people have a bizarre kink for bridge tables. 😉
Is it a kink if it's inflicted against our will through trauma... oh wait.
Products can now be tagged with things like
Gluten Free
orVegan
, and will show up as such under Product listingsAfter