Automating partitioning, sharding and failover with MongoDB
blog.boxedice.com
blog.boxedice.com
I have great hopes for Mongo 1.6: the automatic partioning and failover make it a very useful addition to startups' toolkits who need this kind of data storage. It's like having your very own Amazon SimpleDB that's cheaper to build and you control it 100%.
BTW, David gave a good talk about how Boxed Ice uses Mongo recently in London: http://skillsmatter.com/event/cloud-grid/mongouk
But then MongoDB does not seem to support online/hot backups without setting the whole system to read only. Incremental backups are not supported at all, AFAICS. If a server crashes, you're up to some really lengthy fsck action before your server is back up.
I don't understand how people actually make this work. If you have a huge databases, a complete backup is going to take too long to make setting your system to read-only feasible. And if a server crashes, even if you have a hot standby replica, if you have to do several hours of fsck before you can restore regular operations, that doesn't sound good either.
It's nice to see movement in the database market, and MongoDB looks really good from a front-end side (JS, indexes, queries, ...); but I think it really is lacking some crucial features.
1) Use mongodump which queries for every object in the database. It will produce a compacted file, but does not do a point-in-time snapshot.
2) Take a backup from a slave. You can either set it to read-only mode, or just shut it down and copy the files.
3) Run MongoDB on top of LVM. LVM supports almost instant snapshotting because it uses copy on write. Once the snapshot has been made (usually less than a few seconds) you can resume the server for read-write operations.
Note that all three options can be combined. You could make an LVM snapshot of a read slave then use mongodump's --dbpath option to produce compacted backup files.
Please see http://www.mongodb.org/display/DOCS/Backups for more details.
You can also pull a read slave out and do whatever you need to with it, then reconnect and have it catch up.
MongoDB is really designed to be run on at least 2 servers.
mongodump -> http://www.mongodb.org/display/DOCS/Import+Export+Tools#Impo...