How to implement tag system

后端 未结 7 1674
悲&欢浪女
悲&欢浪女 2020-11-28 00:19

I was wondering what the best way is to implement a tag system, like the one used on SO. I was thinking of this but I can\'t come up with a good scalable solution.

I

7条回答
  •  情歌与酒
    2020-11-28 00:50

    Nothing wrong with your three-table solution.

    Another option is to limit the number of tags that can be applied to an article (like 5 in SO) and add those directly to your article table.

    Normalizing the DB has its benefits and drawbacks, just like hard-wiring things into one table has benefits and drawbacks.

    Nothing says you can't do both. It goes against relational DB paradigms to repeat information, but if the goal is performance you may have to break the paradigms.

提交回复
热议问题