Live data from Hacker News

MongoDB 1.8 (stable) released

blog.mongodb.org

31–40 of 69 posts

Re: MongoDB 1.8 (stable) released

#31
post #28

Could someone with Mongo experience help me gut-check this? I want my data store to be durable and unsurprising -- barring a hardware failure or such, if I submit data it should either tell me that it failed to commit or it should be stored durably and without surprises (e.g., it should not truncate a long string to fit). I've read some of the Mongo docco, and it's pretty exciting, but the lack of ACID -- primarily t…

Don't know, I'm going to be testing this tomorrow, but came to work today to a server that was grinding to a halt due to wild running node.js processes. Restarted the server, but that doesn't cleanly shutdown Mongo, and spent an hour repairing everything and setting permissions right (somehow they had gotten reset). This exact problem, so hope the --journal switch in the init file makes the difference.

Re: MongoDB 1.8 (stable) released

#33
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 use it for offline operations since we only have a single overloaded MS SQL database server. So i sync the data to my local mongo instance creating documents with only the fields that i need. And i have scripts written to do analytics and partition the data to reveal patterns and generate reports and so on.

It's very fast and the flexible schema makes the code much more flexible and easy to write. And did i mention it was fast?

You should definitely give it a try and consider using it for such systems.

My only issue with it is that i am running it on a 32-bit system and so i'm limited to 2GB a database.

Re: MongoDB 1.8 (stable) released

#34
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?

If you are in the NYC area, you should check out the MongoDB track at PgEast next week to find out ;) https://www.postgresqlconference.org/

Re: MongoDB 1.8 (stable) released

#35
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?

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…

In reference to the OP, when comparing Mongo and Postgres, I wouldn't bring up geo...

Re: MongoDB 1.8 (stable) released

#37
post #28

Could someone with Mongo experience help me gut-check this? I want my data store to be durable and unsurprising -- barring a hardware failure or such, if I submit data it should either tell me that it failed to commit or it should be stored durably and without surprises (e.g., it should not truncate a long string to fit). I've read some of the Mongo docco, and it's pretty exciting, but the lack of ACID -- primarily t…

Yes, if you combine journaling with safe write operations. This allows you to call the appropriate driver method to confirm that the data has been written. You can also wait for it to be written to n slaves in replication. I believe that "written" means either to the data files or the journal. In the case of the journal, a hard crash would result in the journal being replayed so that the data is then written to disk and you don't get corruption.

For example in the PHP driver, calling insert with the safe option. http://www.php.net/manual/en/mongocollection.insert.php

"If safe is an integer, will replicate the insert to that many machines before returning success (or throw an exception if the replication times out, see wtimeout)."

You can then immediately called http://www.php.net/manual/en/mongodb.lasterror.php to confirm the last operation didn't error.

Re: MongoDB 1.8 (stable) released

#38
post #28

Could someone with Mongo experience help me gut-check this? I want my data store to be durable and unsurprising -- barring a hardware failure or such, if I submit data it should either tell me that it failed to commit or it should be stored durably and without surprises (e.g., it should not truncate a long string to fit). I've read some of the Mongo docco, and it's pretty exciting, but the lack of ACID -- primarily t…

Journaling should give you the crash-safety you're looking for. You should combine it with safe writes to get the commit safety you want (not the default, but is easy to choose, see your driver's documentation).

The mailing list is a great place for this type of question, too (http://groups.google.com/group/mongodb-user).

Re: MongoDB 1.8 (stable) released

#39
post #36

I was really hoping for full-text search support, but I understand the team is busy :/

All you need for full-text search is to add a multikey of tokens to the documents you want indexed. Tokenizers and stemmers are actually really easy to write, and there are libraries you can use to do that for you.

Re: MongoDB 1.8 (stable) released

#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.
Post reply on HN