Live data from Hacker News

MongoDB 1.8 (stable) released

blog.mongodb.org

41–50 of 69 posts

Re: MongoDB 1.8 (stable) released

#41
post #2

Starting to get excited once again about MongoDB. I was kind of down about it after having some issues with real world implementations. Considering journaling is something I would never have thought would have made it in, I wonder if they will come around on the memory mapped I/O like everyone else eventually does. EDIT: Also... does the group commit mean that ALL write transactions will be un-acknowledged to the cli…

I'm curious what you're getting at IRT memory mapped I/O. To me, one of Mongo's selling points is the way it lets the OS manage caching for you instead of bothering you with tuning a bunch of buffers and things along those lines. For the sake of disclosure, I'm running 6 servers in a pretty high volume cluster, and while I've had to address some issues here and there, memory management hasn't been one of them.

Re: MongoDB 1.8 (stable) released

#42
post #40

As a newb to non-relational databases, but planning on learning one soon, what is the advantage of MongoDB vs Redis? I'm planning to use ruby with either, but was interested if there was a reason to pick one over the other.

I don't think you should just learn one; they are all used for different niches. It depends how your app trades off different things (consistency, reliability of reads, reliability of writes, speed of reads, speed of writes, efficiency of hardware use, and so on).

See http://news.ycombinator.com/item?id=2052852 for a comparison.

Re: MongoDB 1.8 (stable) released

#43
post #40

As a newb to non-relational databases, but planning on learning one soon, what is the advantage of MongoDB vs Redis? I'm planning to use ruby with either, but was interested if there was a reason to pick one over the other.

That totally depends on what you want to do with Redis/MongoDB. Do you intend to use it as your primary data store? AFAIK One of MongoDB's goals is to be useful for a lot of things you'd normally use a relational database for. Redis on the other hand has a lot of nice things to handle more specialized cases of data.

Re: MongoDB 1.8 (stable) released

#44
post #42
post #40

As a newb to non-relational databases, but planning on learning one soon, what is the advantage of MongoDB vs Redis? I'm planning to use ruby with either, but was interested if there was a reason to pick one over the other.

I don't think you should just learn one; they are all used for different niches. It depends how your app trades off different things (consistency, reliability of reads, reliability of writes, speed of reads, speed of writes, efficiency of hardware use, and so on). See http://news.ycombinator.com/item?id=2052852 for a comparison.

I'm not planning on just learning one, just trying to pick one to learn first

Re: MongoDB 1.8 (stable) released

#45
post #40

As a newb to non-relational databases, but planning on learning one soon, what is the advantage of MongoDB vs Redis? I'm planning to use ruby with either, but was interested if there was a reason to pick one over the other.

They're really two different beasts. Mongo stores things in a manner similar to a relational DB (minus the relations). Think of it as a store for JSON that allows indexing and SQL-style queries using a JSON style syntax. Redis data structures are closer to what you'd find in computer science books (lists, sets, hashes, etc.). You should explore both and see what meets your needs.

Re: MongoDB 1.8 (stable) released

#46
post #12

But is it web scale?

I got in so much trouble for a very similar web scale comment. Never shall trite jokes be used on hacker news. You'll get your head bit off. Personally, it gives me a giggle, and I guess that means I am much less mature than most consumers of Hacker News. http://news.ycombinator.com/item?id=2104276

Re: MongoDB 1.8 (stable) released

#47
post #9

MongoDB is not something I have a good handle on yet. What's its sweet spot? Where should I consider using it instead of Postgres?

I've used it once, for an app that holds data which was not a good fit for a traditional relational database. The app in question essentially involved collecting data in a web app and then using that data to fill out hundreds of PDF forms. It gets really complicated as the data has to be potentially formatted (say a phone number might need to be split 555-555-5555 on one form but one number per square on another), concatenated (name might need to join first, last mi), as well as data about what page and x/y coordinates things go on for each form.

Initial attempts in SQL were painful. The only real way to do it was a key value table, but that gets painful when it comes to formatting for web presence (notably, each document has sections with a group of fields, plus some fields may need to be grouped together such as a series of checkboxes, or parts of a name). So at that point we're looking at writing up XML files to describe the presentation of these 200 forms from a key/value table to the web app.

At that point I realized this was doable, but going to be a mess. Enter mongo. Mongo essentially let's us store a dynamic schema of documents. For each form we can stick it all in a single document, as a series of embedded models, with all metadata and values needed in one go. We also get nice revision control within that using mongoid. We can now fetch all the data for a form, as well as save all the data for the form, in one VERY fast atomic operation (we're talking 100-800 field definitions for each form). Having never used mongo, it only took me a few days to implement this complete with handling for all field types and performance was fantastic.

Mongo also made it quite easy to populate our data since we're essentially just storing a tree of key and values. We wrote up a tool that loads up the PDF's and let's us draw boxes on top of the fields and set up the metadata, then export that to a YAML file for each form. The YAML is then stored in a tradiational SQL database and is used to create a new form in the system by simply converting it to a nested hash and having mongoid save it. Slick.

I'm getting a bit wordy here, but I think it's a great real world example of the type of problem mongo is a good fit for. I wouldn't personally use mongo for something that a relational database is a good fit for, but for something like this it allows you to solve the problem quicker and with significantly less code to maintain (really, the CRUD code for forms is no more than with SQL and probably less since it's only one operation on a document, and my pdf form generator is < 200 lines of ruby).

Re: MongoDB 1.8 (stable) released

#48
post #12

But is it web scale?

I got in so much trouble for a very similar web scale comment. Never shall trite jokes be used on hacker news. You'll get your head bit off. Personally, it gives me a giggle, and I guess that means I am much less mature than most consumers of Hacker News. http://news.ycombinator.com/item?id=2104276

The thing you have to understand about the NoSQL crowd is there's no actual thinking here, just religious fervour.

Re: MongoDB 1.8 (stable) released

#49
post #24

Earlier quoted context omitted.

If you are working with location data, Mongo has built in geospatial indexing built in since 1.4 (earlier in the unstable builds) - http://www.mongodb.org/display/DOCS/Geospatial+Indexing which has been a big draw for a number of people I know using it (it looks like 1.8 brings spherical distances to the stable branch which makes the geo lookups a lot more useful if you need accurate distances and not just near by lo…

I got excited and looked it up. > We don't currently handle wrapping at the poles or at the transition from -180° to +180° longitude, however we detect when a search would wrap and raise an error. generalized grumble Why does everyone always seem to punt on doing geospatial right? It's not _that_ hard.

Why not go ahead and help them? I'm sure they'd be happy to have the assistance. Fork mongo from github at https://github.com/mongodb/mongo . Happy hacking!
Post reply on HN