

MongoDB 2.6 Released - francesca
http://blog.mongodb.org/post/82092813806/mongodb-2-6-our-biggest-release-ever

======
danielrpa
A lot of hype... And we still have db level locking. If document level is too
difficult, at LEAST do collection level (not that it is too much better, but
least it some real improvement).

~~~
z92
I was reading somewhere that Mongo can't do document level/record level
locking because of mmap'ed files. The whole database is memory mapped. And
mmap doesn't understand underlined data structure, it views the whole file as
a large single blob.

Ditching mmap will not be that easy, cause most of the speed and simplicity of
Mongo comes from using mmap.

~~~
AlisdairO
mmap does complicate things. A traditional database often works using write
ahead logs. The log holds changes made to the database over time - so when you
want to write a change to your DB, you put 'I'm changing value x.y to 50' in
your WAL. Sometime later the actual data pages holding the modified x data
structure can be written out to disk. If you have a crash before the data
pages get written out, you can 'replay' your WAL file to redo all the lost
changes.

Unfortunately, a central requirement of a write ahead log is that the data
pages must not get written before the WAL. If that were to occur, and there
were a crash, the system wouldn't know that it had to undo the changes to the
data pages, leaving you with corrupt data. mmap generally doesn't provide the
ability to pin your dirty pages in memory - they're subject to getting flushed
any time the system is under memory pressure - so it makes logging a lot more
complicated to get right.

~~~
arkham
Just to note, the MongoDB journal is basically a write ahead log and has been
around since 1.8. It's not simple, you are correct, and involved remapping
portions of memory privately, and leads to some inflated numbers on the
virtual memory reporting side. There's a great write up here:

[http://blog.mongodb.org/post/33700094220/how-mongodbs-
journa...](http://blog.mongodb.org/post/33700094220/how-mongodbs-journaling-
works)

~~~
AlisdairO
That's interesting, thanks!

------
fiatmoney
And it _still_ relies entirely on the OS's scheduling algorithms for caching
and IO. mmap is nice but it has no idea you're running a database.

------
lazyloop
Here are the release notes. [http://docs.mongodb.org/master/release-
notes/2.6/](http://docs.mongodb.org/master/release-notes/2.6/)

------
ChrisGaudreau
_Finally, MongoDB 2.6 lays the foundation for massive improvements to
concurrency in MongoDB 2.8, including document-level locking._

This is exciting even if I don't expect it to happen soon.

~~~
zardosht
TokuMX, which I work on, has document level locking and compression right now.

~~~
int64
trying amisaserver found it somewhere in the comments below. claims to have
MVCC.

~~~
int64
sweet then, will give tokumx a shot as well. Thanks

------
anvarik
With this release aggregation framework got super powerful. Now it returns a
cursor. Now we can get the aggregation results and iterate over them. No more
16mb result limitation as well...

~~~
jeffdavis
Can you elaborate for people who don't understand the feature? Is the
aggregation result large because of grouping?

~~~
anvarik
Well, aggregation in MongoDB allows you to write sql like queries, and before
2.6 if aggregated result was > 16mb it was throwing an error, but now it gives
you a cursor. Now you can fetch the results and send to another collection.
For an example aggregation query in mongo have a look here:
[http://docs.mongodb.org/manual/tutorial/aggregation-zip-
code...](http://docs.mongodb.org/manual/tutorial/aggregation-zip-code-data-
set/)

------
nicklovescode
I've been using Elasticsearch as a primary database for my new project, which
has basically been a good NoSQL db that happens to have great search. However,
peripheral tools(performance testing, hosting) have been a bit rough.

How do the two databases compare now. Is search improving in Mongo or is that
something they are not really worrying about at the moment.

~~~
int64
if you are looking for a nosql dbms as a service which consumes json and
supports SQL and search, you could try amisaserver

~~~
ddorian43
have you seen the pricing? it's insane

~~~
mutex007
The price is unbelievably fair. Try deploying mysql in the cloud and while you
are at it, you get Redis as well for cache and then you hit the wall you need
search in your application, so you deploy elastic search as a service as well.
Do the math and compare to ours.

Our pricing starts as low as $15 per month

The cheapest instance of amazon cloudsearch is around $79 monthly, You then
have to deploy a transactional DBMS and then most likely S3 for storage as
well.

~~~
ddorian43
It's 700/month (otherwise your product isn't needed because no-sharding?
postgresql can do most of the stuff)

the hosted version is upto 8gb ram, don't you think that's low ?

sqlserver + oracle are also insane

~~~
mutex007
$700 annually. Please read well before you misrepresent us.

By the way Partitioning by Hash and Range as we have stated means "Sharding"

~~~
ddorian43
the 700$month was mistyped

what i meant is that the correct price is 700 and not 350 since the 350
pricing doesn't include sharding/clustering

------
endijs
This is good write-up about what's new with actual numbers.
[http://devops.com/news/mongodb-2-6-significant-release-
mongo...](http://devops.com/news/mongodb-2-6-significant-release-mongo-yet/)
Quote: "MongoDB 2.6 provides more efficient use of network resources; oplog
processing is 75% faster; classes of scan, sort, $in and $all performance are
significantly improved; and bulk operators for writes improve updates by as
much as 5x."

------
dkhenry
Awesome news. I am excited for the aggregation cursor. As much as I love some
of the alternatives that are almost ready I still turn to mongo for a vast
majority of my deployments. Hopefully it will keep getting better and pushing
others to do the same.

------
brokentone
Can someone with more MongoDB experience give me your thoughts on the upgrade
difficulty here? Worth doing soon, or waiting for a point release? Does this
require a data rebuild/update process (coming from 2.4)?

~~~
mason55
IMO unless you desperately need one of the new features I would hold off a few
weeks. With a release this big I'd expect there will be some bugs and wouldn't
be surprised to see 2.6.1 shortly.

~~~
colechristensen
This is always best practice for anything important unless you find your life
is dull and bereft of emergency.

~~~
nasalgoat
In the case of Mongo, it's the opposite - the upgrades are needed badly enough
that it's worth the risk of a major number release.

------
AdrianRossouw
So i've been trying to find an the ideal case for mongodb, because I have to
teach a nosql database to some people I am mentoring.

I'm leaning heavily towards couchdb though.

[http://daemon.co.za/2014/04/when-is-mongodb-the-right-
tool](http://daemon.co.za/2014/04/when-is-mongodb-the-right-tool)

~~~
sync
Be sure to check out RethinkDB as well, which is pretty much mongo with a MUCH
nicer query interface and saner locking.

[http://rethinkdb.com/](http://rethinkdb.com/)
[http://rethinkdb.com/docs/comparison-
tables/](http://rethinkdb.com/docs/comparison-tables/)

~~~
sandstrom
I can also recommend checking out rethinkdb. It feels like MongoDB but without
many of the downsides.

Not saying MongoDB is bad (I've used Mongodb and like it), but much of their
API-design is quirky/bad, locking is an issue and mmap feels weird too.

------
arkham
Some notes on using the shell, and some unforeseen performance changes from
the beta:
[http://comerford.cc/wordpress/2014/03/28/mongodb-2-6-shell-p...](http://comerford.cc/wordpress/2014/03/28/mongodb-2-6-shell-
performance/)

------
endijs
Cursor for aggregate, proper explain for aggregate, index intersection,
$redact and other cool operators, Multi* in Geospatial, faster execution and,
foundation for document-level locking which should be introduced in MongoDB
2.8. I must say I'm happy with this release.

------
hamxiaoz
Playing with Meteor and mongo recently and have found mongo seems a little bit
strange from a transitional SQL point of view, like do I need to embed or
reference? Can anyone recommend a good book or source?

~~~
francesca
[http://docs.mongodb.org/manual/tutorial/model-embedded-
one-t...](http://docs.mongodb.org/manual/tutorial/model-embedded-one-to-many-
relationships-between-documents/)

[http://docs.mongodb.org/manual/core/data-model-
design/](http://docs.mongodb.org/manual/core/data-model-design/)

------
wilsonfiifi
So does this mean document level locking has been implemented or just the
foundation for its future implementation has been laid?

I can't hold my breath much longer! :-)

Edit: docs don't make any mention of it but then again they probably haven't
updated them yet (fingers crossed!)
[http://docs.mongodb.org/manual/faq/concurrency/#what-type-
of...](http://docs.mongodb.org/manual/faq/concurrency/#what-type-of-locking-
does-mongodb-use)

~~~
leif
It means the foundation has been laid. 2.6 included a lot of refactoring and
rewriting of some core subsystems, with the apparent goal of eliminating
technical debt so they can make more impactful changes in 2.8.

Don't asphyxiate, tokumx has document-level locking right now.
[http://github.com/Tokutek/mongo](http://github.com/Tokutek/mongo)

------
mdcallag
I am a big fan of their focus on manageability for sharded databases. I am
less of a fan of their db internals that might require you to use many more
shards than a more performant engine. More details at
[http://smalldatum.blogspot.com](http://smalldatum.blogspot.com)

------
owenversteeg
The blog post was rather vague about 2.6's "better performance". Are there any
concrete numbers?

------
Oculus
The main reason I use MongoDB on Node is the maturity of the Mongoose ORM -
I've used Node-ORM 2, BookshelfJS, and SequelizeJS and none of them felt as
mature as Mongoose.

~~~
bpicolo
Mongoose is definitely a pleasure to work with, regardless of MongoDB faults.
Well-designed.

------
tbarbugli
How is it possible to have aggregation cursors without crunching the complete
data set in advance (aka map/reduce) and still have consistent and correct
results?

------
tedchs
Will MongoDB still segfault under certain circumstances?

~~~
outside1234
Everything will segfault under certain circumstances.

~~~
saurik
The only reasonable assumption is circumstances that do not involve hardware
failure, the binary being compiled incorrectly, the source code being modified
or replaced by someone downstream, the libraries it is using being corrupt or
having been replaced by ABI-incompatible variants... none of these are
reasonable circumstances; one would then further assume that the person
posting has run into reasonable circumstances where MongoDB often crashes,
which is not a stretch given the number of bugs that are filed against it that
talk about this kind of issue.

[https://www.google.com/search?q=site:jira.mongodb.org+mongod...](https://www.google.com/search?q=site:jira.mongodb.org+mongodb+segfault)

~~~
tedchs
Exactly; well said. It's been about a year but basically I had a replica set
where sometimes one replica or the other would segfault and I'd have to
manually delete its data files and re-replicate, after which it was fine.
Happened about every few months. It was clearly based on application behavior
and not an inherent system problem such as those you listed.

------
ericingram
I wonder, what does this mean for TokuMX

~~~
wilsonfiifi
Am glad someone has brought up TokuMX. Tell me, have you used it in production
yet?

I wonder why 10gen hasn't made any official comment on the work the folks at
Tokutek are doing to enhance Mongodb's features.

~~~
mason55
_> I wonder why 10gen hasn't made any official comment on the work the folks
at Tokutek are doing to enhance Mongodb's features._

Why would they comment? What would they say? Toku is basically trying to steal
MongoDB's customers, they even use the same basic pricing model.

~~~
nevi-me
For me the really irritating thing is the observation that when I want to
enjoy flame wars about Mongo, I seem to see a lot of their 'try TokuMX'
everywhere. Last time I checked they are on the 2.2 codebase, unless that
recently changed. Mongo 2.4 was a significant upgrade, and assuming I'm
correct above, I feel like the Tokutek team disregard that. I get that it's
good marketing to suggest an alternative, but going along criticising that
which you've built upon doesn't go well with me.

~~~
leif
Last time you checked was a while ago, it's 2.4 compatible now (except geo and
full-text) and has been since TokuMX 1.3.

We generally don't criticize indiscriminately. MongoDB has a lot of good sides
and we embrace and extend those, and where it has faults we try to work around
or replace them. Our core strength is fast, reliable, compressed storage and
MVCC semantics, so obviously we talk about that a lot, but we also understand
and acknowledge that a large amount of TokuMX's success, to the degree it has
some, is due to the excellent parts of MongoDB.

As an example, I personally am really excited about what MongoDB has done with
aggregations in 2.6 (and what seems to be coming down the pipe soon), and I
can't wait to merge it in to TokuMX. We all get stronger together.

~~~
wilsonfiifi
This is a well put together reply, very politically correct. Good to know
you're on TokuMX dev team.

------
rogerbinns
Mongo haven't updated their feeds for Ubuntu. I wonder how long they will take
to do so?

~~~
rogerbinns
They have now. However 2.6 uses different package names, configuration file
name, log file etc. It is generally mongod instead of the earlier mongodb (eg
before it was /etc/mongodb.conf and is now /etc/mongod.conf).

This means no automatic upgrades to 2.6, and sysadmin action to correct config
file name etc.

------
the1
mongodb is the best database in the whole wide world at the moment. I
encourage everyone to jump in mongodb for agile web scale development with
full big data capability.

~~~
zeroDivisible
Well, I think I must disagree with you in here.

I'm sure that it is a viable choice for some use cases, it's just that I
didn't found a use case for it yet.

Being able to choose from PostgreSQL, Redis, Cassandra, heck, even
ElasticSearch made me always choose one of those over MongoDB, at least for
the problems which I had been trying to solve.

~~~
mutex007
By the way if you are looking for all the above functionality provided by all
the DBMS you mentioned in a single DBMS instance, you can check out
amisaserver.com. Polygot persistence is just another fad.

~~~
wilsonfiifi
Doesn't appear to have a community edition for local/private installation...

------
rainmaking
I have never understood how the definition of "Document Database" is different
from "File System".

~~~
herge
Really? Have you ever tried to search for specific content in structured
documents on a filesystem?

~~~
leccine
I have, and found what I was looking for. What am I doing wrong?

~~~
herge
How much data were you grepping for? How much time did it take? How did you
transmit those results over the network?

Or does your data fit in one csv file?

