Hello, quick db question. I'm working on a project...
# orm-help
m
Hello, quick db question. I'm working on a project where I take a string like this
Hello world #welcome #message #other
and store it. Later they should be able to quickly search by the hashtag. However the string is also editable and I can forsee it being edited multiple times in its lifetime. I was initially thinking of having a
messages
table and a
message_tags
table. However I realize that since the string can be edited and
#welcome
can easily become
#howdy
, keeping the
message_tags
table in sync might be difficult. In this case am I better off just putting a
tags
array column on the
messages
table and indexing it?
1
j
I think this is a better option: ” putting a
tags
array column on the
messages
table and indexing it ” I think that each column should have a single responsibility
m
Yep so I found this
Seems like array is the way to go performance wise?