TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Should we all start using MongoDB for new projects?

8 点作者 wesleyzhao超过 14 年前
I'm seeing more and more articles on HN with projects that are choosing MongoDB and other NoSQL data structures over MySQL. Is this what the future is going to be, so we might as well start adopting now? What are it's disadvantages if any?

4 条评论

aphyr超过 14 年前
I can't see using MongoDB for any production project. It combines a limited replication/sharding model with a poor single-server durability, lack of tunable CAP constraints, and some surprising performance bottlenecks.<p>If you want integrity and SQL, use PostGres. If you want volatile speed, use Redis or Membase. If you want a rich data model and excellent durability with limited but highly configurable replication, experiment with Couch. If you want federation, predictable horizontal scaling, and HA, perhaps look at Voldemort, Cassandra, HBase, or Riak. There are a lot of good datastores out there, and chances are one of them fits your needs better.<p>Edit: I think <a href="http://www.paperplanes.de/2011/1/10/mongodb_and_data_durability.html" rel="nofollow">http://www.paperplanes.de/2011/1/10/mongodb_and_data_durabil...</a> basically sums it up. When the Mongo folks started telling me that kill -9 should never happen to any database, I stopped taking them seriously.
评论 #2200049 未加载
clojurerocks超过 14 年前
Its very difficult to explain why you would use MongoDB and why its becoming so popular. The best way to learn it though is to do a project with it. Im actually working on a few right now, mostly games, and would be open to having you involved. If youre not into that then just read the mongodb books and understand what it is. Also learn what couchdb, riak, and membase are and why they are different since they are all "nosql" datastores but are very different from each other. Also a good way to learn it which is how i learned it is to learn jquery/ajax and specifically developing the json api that it will call and use. Once you understand json and key value pairs then why mongodb is so great will become apparent.
sim0n超过 14 年前
We use MongoDB on ww.interstateapp.com but only really because Interstate started out as a small fun project and not something we expected to take that seriously (so it didn't matter too much if MongoDB was a perfect fit or not - it turns out that it suits the app quite well). If your app is the type of application that would benefit from the advantages of having a NoSQL style setup (not all do) then go for it but I can't see MySQL being phased out (in terms of usage by devs, etc) anytime soon...<p>Also, if you don't know whether your app could benefit from using MongoDB it's kind of a general rule of thumb (from what I've seen) to just go with a traditional MySQL setup for now.
acangiano超过 14 年前
You shouldn't start using something just because others do. NoSQL databases are tools, and it makes sense to employ them when they actually are the right tool for the job. Does MySQL and relational databases in general satisfy your requirements for a given project? If yes, you don't need NoSQL.<p>Some projects will require NoSQL. Others will require both NoSQL and relational databases (a great combo). It's all about what problem you are trying to solve.