Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
REDIS-如何存储评论_Redis - Fatal编程技术网

REDIS-如何存储评论

REDIS-如何存储评论,redis,Redis,您好,我需要您对REDIS设计模式的意见: 是否最好将1篇文章的文本评论存储为: - a single LIST where I will RPUSH all comments (may be up to 100chr each string) - a single LIST of commentID (with RPUSH) and a new comment object each time...? 谢谢大家! 1000条评论,每个评论100个字符,应该没问题。我喜欢约翰关于分类的建议 保

您好,我需要您对REDIS设计模式的意见:

是否最好将1篇文章的文本评论存储为:

- a single LIST where I will RPUSH all comments (may be up to 100chr each string)
- a single LIST of commentID (with RPUSH) and a new comment object each time...?

谢谢大家!

1000条评论,每个评论100个字符,应该没问题。我喜欢约翰关于分类的建议


保持简单,但如果以后发现自己有理由走另一条路,不要在客户端把自己画成一个角落。

您预期的访问模式是什么?读/写重?什么尺度?我必须假设它可能支持多达100/1000的注释。我建议使用按时间戳排序的排序集(历元作为分数)。这可能有助于按时间检索最新注释等用例。列表或排序集在这里是相同的模式-我可能最终得到一个1000条注释的列表/集合,每条注释100chr。可以接受吗?什么样的读/写速率?我在寻找每个时间单位的评论。1000条评论,每个评论1000个字符怎么样?它还适合redis吗?@programmer,我仍然认为你会没事的。编写一个shell脚本(或类似的脚本)来填充一些测试数据以查看它在您的环境中的行为非常容易。使用
info
命令开始了解Redis实例的容量。