Extremely positive attitude. My website is beebo.org.
I’ve been reading and thinking a bit about MongoDB’s consistency model a bit over the last few weeks. I think what follows is an accurate model of how it behaves, and what the implications are, but I would be grateful for any corrections:
mongod
is running, you may as well imagine that all your
data is stored in memory, and that the files it creates on disk don’t
actually exist. This is because the files themselves are memory
mapped, and MongoDB makes no guarantees about whether they’re in a
consistent state. (They’re theoretically consistent immediately after
an fsync, and this can be forced in several ways, but I don’t think
there’s any easy way to snapshot the database files immediately after
the fsync.) [Update: Kristina pointed out that it is possible to fsync and then prevent the memory mapped file from being modified via the fsync and lock command. Once the lock (which blocks all write operations, though not reads) is in place, you can safely copy/snapshot the database file.]getLastError()
command. getLastError()
blocks until the write is either committed
to the in-memory data structure, fsynced to disk, or committed to n
replicas, depending on the arguments passed. (Note that many clients
abstract away the write plus getLastError()
call, so that the
arguments to getLastError()
become arguments to the write.
getLastError()
with no options.getLastError()
with fsync = true
.w = n
. (Note that there is currently no way to
block until the write has been
fsynced
on the replicas.)
MongoUK—a small MongoDB conference in London—happened last Friday, and it was wonderful. I haven’t been to that many conferences, but it probably the best tech conference I’ve been to, at least in terms of my enjoyment of the talks themselves. (DPC is over three days, in Amsterdam…)
The conference was run by 10gen (the company behind MongoDB) themselves, though it felt about as much like an independent conference as it was possible to be under the circumstances. (I’m pretty the conference was subsidised—10gen are just getting started, and so at this point they want to get as many people as possible happily using MongoDB as possible, and they have the VC money to do it.)
A few points that struck me about MongoDB:
Overall, my feelings toward MongoDB didn’t change that much. It’s a new product, to be used with a modicum of caution, and it shouldn’t be the automatic first choice. (Though perhaps there is no automatic first choice when it comes to NoSQL document-oriented databases.) It is used in production (many of the attendees I spoke to were using it in production), though I think many of the very large and complicated deployments are done with a small amount of hand-holding from 10gen. I was reassured by the quality of the MongoDB people, and their commitment to their product and its users. 10gen and MongoDB are extremely developer-friendly in all respects—the product itself, the documentation, their people, their “marketing” (there was no hard sell), etc.