TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Failing with MongoDB

154 pointsby lenn0xover 13 years ago

12 comments

nomongoover 13 years ago
Why is a database that fails so easily and most of the time even loses data so popular? Is it really all just a huge marketing budget?
评论 #3200912 未加载
评论 #3200921 未加载
评论 #3201241 未加载
评论 #3200897 未加载
评论 #3200933 未加载
评论 #3201481 未加载
评论 #3201737 未加载
评论 #3202900 未加载
评论 #3201116 未加载
评论 #3202200 未加载
gojomoover 13 years ago
Maybe there's a niche for "PostgreNoSQL", a layer atop Postgres that you start using like a NoSQL solution. (Perhaps, it's string keys and JSON blob values.) It's not very efficient, except for simple keyed lookups, but it works enough for a quick start.<p>Then, as you use it, the system optimizes itself (or makes suggestions) based on actual access patterns. A subset of objects could be a formal, indexed table? Have it happen automatically or offer the SQL as a suggestion.
评论 #3201600 未加载
评论 #3202294 未加载
评论 #3201711 未加载
christkvover 13 years ago
Seems to me they used the wrong setup they should have looked at a replicaset setup with secondaries for read and sharding if they needed more write performance and nonblocking reads. That said version 2 has less locking problems and I understand they are working on finer grained locking.
评论 #3201139 未加载
StavrosKover 13 years ago
All I need is a schemaless version of postgres (with ACID-compliance and everything), does anyone know of one?
评论 #3201130 未加载
lucian1900over 13 years ago
Sadly, MongoDB blows for actual usage. It locks, it's not crash-only, it has mutable data.<p>CouchDB is much better (you're as likely to lose data as with Postgres), but is potentially less efficient (no BSON).
bbulkowover 13 years ago
Disclosure: I wrote a product called Citrusleaf, which also plays in the NoSQL space.<p>My focus in starting Citruseaf wasn't features, it was operational dependability. I had worked at companies who had to take their system offline when they had the greatest exposure - like getting massive load from the Yahoo front page (back in the day). Citrusleaf focuses on monitoring, integration with monitoring software, operations. We call ourselves a real-time database because we've focused on predictable performance (and very high performance).<p>We don't have as many features as mongo. You can't do a javascript/json long running batch job. We'll get to features.<p>The global R/W lock does limit mongo. Absolutely. Our testing shows a nearly 10x difference in performance between Mongo and Citrusleaf on writes. Frankly, if you're still doing 1,000 tps, you should probably stick with a decent MySQL implementation.<p>Here's a performance analysis we did: <a href="http://bit.ly/rRlq9V" rel="nofollow">http://bit.ly/rRlq9V</a><p>This theory that "mongo is designed to run on in-memory data sets" is, frankly, terrible --- simply because mongo doesn't give you the <i>control</i> to keep you in memory. You don't know when you're going to spill out of memory. There's no way to "timeout" a page cache IO. There's no asynchronous interface for page IO. For all of these reasons - and our internal testing showing page IO is 5x slower than aio; the reason all professional databases use aio and raw devices - we coded Citrusleaf using normal multithreaded io strategies.<p>With Citrusleaf, we do it differently, and that difference is huge. We keep our indexes in memory. Our indexes are the most efficient anywhere - more objects, fea. You configure Citrusleaf with the amount of memory you want to use, and apply policies when you start flowing out of memory. Like not taking writes. Like expiring the least-recently-used data.<p>That's an example of our focus on operations. If your application use pattern changes, you can't have your database go down, or go so slowly as to be nearly unusable.<p>Again, take my comments with a grain of salt, but with Citrusleaf you'll have better uptime, fewer servers, a far less complex installation. Sure, it's not free, but talk to us and we'll find a way to make it work for your project.
t3mp3stover 13 years ago
Disclosure: I hack on MongoDB.<p>I'm a little surprised to see all of the MongoDB hate in this thread.<p>There seems to be quite a bit of misinformation out there: lots of folks seem focused on the global R/W lock and how it must lead to lousy performance.<p>In practice, the global R/W isn't optimal -- but it's really not a big deal.<p>First, MongoDB is designed to be run on a machine with sufficient primary memory to hold the working set. In this case, writes finish extremely quickly and therefore lock contention is quite low. Optimizing for this data pattern is a fundamental design decision.<p>Second, long running operations (i.e., just before a pageout) cause the MongoDB kernel to yield. This prevents slow operations from screwing the pooch, so to speak. Not perfect, but smooths over many problematic cases.<p>Third, the MongoDB developer community is EXTREMELY passionate about the project. Fine-grained locking and concurrency are areas of active development. The allegation that features or patches are withheld from the broader community is total bunk; the team at 10gen is dedicated, community-focused, and honest. Take a look at the Google Group, JIRA, or disqus if you don't believe me: "free" tickets and questions get resolved very, very quickly.<p>Other criticisms of MongoDB concerning in-place updates and durability are worth looking at a bit more closely. MongoDB is designed to scale very well for applications where a single master (and/or sharding) makes sense. Thus, the "idiomatic" way of achieving durability in MongoDB is through replication -- journaling comes at a cost that can, in a properly replicated environment, be safely factored out. This is merely a design decision.<p>Next, in-place updates allow for extremely fast writes provided a correctly designed schema and an aversion to document-growing updates (i.e., $push). If you meet these requirements-- or select an appropriate padding factor-- you'll enjoy high performance without having to garbage collect old versions of data or store more data than you need. Again, this is a design decision.<p>Finally, it is worth stressing the convenience and flexibility of a schemaless document-oriented datastore. Migrations are greatly simplified and generic models (i.e., product or profile) no longer require a zillion joins. In many regards, working with a schemaless store is a lot like working with an interpreted language: you don't have to mess with "compilation" and you enjoy a bit more flexibility (though you'll need to be more careful at runtime). It's worth noting that MongoDB provides support for dynamic querying of this schemaless data -- you're free to ask whatever you like, indices be damned. Many other schemaless stores do not provide this functionality.<p>Regardless of the above, if you're looking to scale writes and can tolerate data conflicts (due to outages or network partitions), you might be better served by Cassandra, CouchDB, or another master-master/NoSQL/fill-in-the-blank datastore. It's really up to the developer to select the right tool for the job and to use that tool the way it's designed to be used.<p>I've written a bit more than I intended to but I hope that what I've said has added to the discussion. MongoDB is a neat piece of software that's really useful for a particular set of applications. Does it always work perfectly? No. Is it the best for everything? Not at all. Do the developers care? You better believe they do.
nomoremongoover 13 years ago
I'd appreciate if someone would submit this story for me.<p><a href="http://pastebin.com/raw.php?i=FD3xe6Jt" rel="nofollow">http://pastebin.com/raw.php?i=FD3xe6Jt</a>
评论 #3201863 未加载
patrickodover 13 years ago
Wow there's a lot of Mongo hate in this thread all from one article. Yesterday MongoDB was the darling of HN and today it has to be defended from ridiculous claims. Why the mob attitude? Have you all had these issues?
vegaiover 13 years ago
All the commercial DBs have similar issues. Just deal with them and go on.
评论 #3202230 未加载
plasmaover 13 years ago
Ravendb (www.ravendb.net) is a solid competitor.
评论 #3201356 未加载
评论 #3202067 未加载
评论 #3201343 未加载
amalagover 13 years ago
If your data is easily modeled relationally, go for relation, if you are going to change it constantly and is not a natural fit for a relational model, Mongodb is worth a shot.<p>From this article, sounds like their data is pretty seriously relational.<p>Mongodb has been pushing the ops side of their product, but I can agree it has failings there. To me the advantage is the querying and the json style documents.
评论 #3201096 未加载