How to model tags in the database?

前端 未结 3 917
萌比男神i
萌比男神i 2021-01-04 20:35

I have an existing webapp and want to add a tag feature so that users can tag existing objects. The question is should I add a tag column to each object? or should I normali

3条回答
  •  长发绾君心
    2021-01-04 20:56

    Definitely normalize. A table for tags, a table for your existing objects, and a table of links between them.

提交回复
热议问题