Home  >  Q&A  >  body text

redis - 像做的关注标签功能,其数据库是怎样设计的

前几天看到flask-SQLAlchemy怎么添加多对多数据这个问题,引起了我对于这样一个关注功能的好奇,每次进segmentfault的时候对于我关注的内容都会高亮显示。

在数据库中是专门建一张关系表来维护usertag之间的关系?

还是像我想的那样,在user表中给个tags字段,字段里面存放所有的tag并用逗号分隔开?

或者是用其他专业的方式?

类似问题有新浪加关注问题,希望高手出现热心的解答我的疑问。谢谢。。。

天蓬老师天蓬老师2709 days ago532

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-21 11:19:28

    When there is a large amount of key:value data that needs to be stored, it is most convenient to use Nosql databases such as redis.

    Pay attention to the behavior of tags, as long as the tag id and user id are written to redis.

    reply
    0
  • Cancelreply