nosql 是像评论系统这样的多级论坛的合适工具吗?
我想构建一个类似于 Reddit.com 的网络应用程序,其中有多层评论、大量读取和写入。我想知道 nosql 和 mongoDB 是否是正确的工具?
I want to build a web app similar to Reddit.com, where you have multy level of comments, lots of reads and writes. I was wondering if nosql and mongoDB in particular is the right tool for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
评论——毫无疑问,这对于 nosql 数据库来说确实很重要。您避免了自身的多个连接。这意味着您的系统可以横向扩展!
使用 mongodb,您可以将所有层次结构存储在一个文档中。有些人可能会说原子更新会出现问题,但我想这不是问题,因为您可以加载并保存整个评论树。无论如何,您以后都可以轻松地重新设计系统以支持原子更新并避免并发问题。
Comments -- it's really thing for nosql database, no doubt. You avoiding multiple joins to itself. And it's means that your system can scale out!
With mongodb you can store all hierarchy within one document. Some peoples can say that here will be problems with atomic updates, but i guess that it's not a problem because of you can load and save back entire comments tree. In any way you can easy redesign your system later to support atomic updates and avoid issues with concurrency.
Reddit 本身使用 Cassandra。如果你想要“类似于 reddit.com”的东西,也许你应该看看他们的来源 - https:// github.com/reddit/reddit/wiki。
以下是 David King (ketralnis) 今年早些时候关于 Cassandra 0.7 版本的说法:“运行任何大型网站都是在扩展用户群和扩展基础设施以支持它之间进行的一场持续的竞赛。今年我们的流量增加了两倍多,而 Apache 为我们提供了透明的可扩展性。 Cassandra 在很大程度上使我们能够在有限的资源上做到这一点。Cassandra v0.7 代表了从我们这样的安装中学到的实际操作经验,并提供了更多功能,例如列过期,使我们能够扩展更多的基础设施。 ”
但是,Rick Branson 指出 Reddit 并未充分利用 Cassandra 的功能,因此如果如果你要从头开始,你会想做一些不同的事情。
Reddit itself uses Cassandra. If you want something "similar to reddit.com," maybe you should look at their source -- https://github.com/reddit/reddit/wiki.
Here's what David King (ketralnis) said earlier this year about the Cassandra 0.7 release: "Running any large website is a constant race between scaling your user base and scaling your infrastructure to support it. Our traffic more than tripled this year, and the transparent scalability afforded to us by Apache Cassandra is in large part what allowed us to do it on our limited resources. Cassandra v0.7 represents the real-life operations lessons learned from installations like ours and provides further features like column expiration that allow us to scale even more of our infrastructure."
However, Rick Branson notes that Reddit doesn't take full advantage of Cassandra's features, so if you were to start from scratch, you'd want to do some things differently.