前几天看到flask-SQLAlchemy怎么添加多对多数据这个问题,引起了我对于这样一个关注功能的好奇,每次进segmentfault的时候对于我关注的内容都会高亮显示。
在数据库中是专门建一张关系表来维护user
和tag
之间的关系?
还是像我想的那样,在user
表中给个tags
字段,字段里面存放所有的tag
并用逗号分隔开?
或者是用其他专业的方式?
类似问题有新浪加关注问题,希望高手出现热心的解答我的疑问。谢谢。。。
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.