How to Choose a Shard Key: The Card Game

Choosing the right shard key for a MongoDB cluster is critical: a bad choice will make you and your application miserable. Shard Carks is a cooperative strategy game to help you choose a shard key. You can try out a few pre-baked strategies I set up online (I recommend reading this post first, though). Also,Continue reading “How to Choose a Shard Key: The Card Game”

Bending the Oplog to Your Will

Part 3 of the replication internals series: three handy tricks. DIY triggers Using the oplog for crash recovery Creating non-replicated collections This is the third post in a three-part series on replication. See also parts 1 (replication internals) and 2 (getting to know your oplog). DIY triggers MongoDB has a type of query that behavesContinue reading “Bending the Oplog to Your Will”

Getting to Know Your Oplog

This is the second in a series of three posts on replication internals. We’ve already covered what’s stored in the oplog, today we’ll take a closer look at what the oplog is and how that affects your application. Our application could do billions of writes and the oplog has to record them all, but weContinue reading “Getting to Know Your Oplog”

Scaling, scaling everywhere

Interested in learning more about scaling MongoDB? Pick up September’s issue of PHP|Architect magazine, the database issue! I wrote an article on scaling your MongoDB database: how to choose good indexes, help handle load using replication, and set up sharding correctly (it’s not PHP-specific). If you prefer multimedia, I also did an O’Reilly webcast onContinue reading “Scaling, scaling everywhere”

Writing MongoDB: The Definitive Guide

MongoDB: The Definitive Guide is now available in bookstores everywhere! (Or at least on Amazon.) Please pick up a copy! Some interesting things I learned about the process of publishing: There are professional indexers who write the index. This amazes me, because we had to proofread our index and I’ve never been so bored inContinue reading “Writing MongoDB: The Definitive Guide”

Choose your own adventure: MongoDB crash recovery edition

Suppose your application is happily talking to MongoDB and your laptop battery runs out. Or your server bursts into flame. Or velociraptors attack your data center. What now? To bring your server back up, read through the text until you get to a bold question. Click on the answer that best matches your situation toContinue reading “Choose your own adventure: MongoDB crash recovery edition”

Oh, the Mistakes I’ve Seen

I’ll be giving an O’Reilly webcast, Scaling with MongoDB, on Friday (9/17). Please sign up if you’re interested in learning some more advanced optimization than what this post gets into. This webcast is, in part, to pimp MongoDB: The Definitive Guide, which will be coming out next week! These are a few basic tips onContinue reading “Oh, the Mistakes I’ve Seen”

A Quick Intro to mongosniff

Writing an application on top of a framework on top of a driver on top of the database is a bit like playing telephone: you say “insert foo” and the database says “purple monkey dishwasher.” mongosniff lets you see exactly what the database is hearing and saying. It comes with the binary distribution, so ifContinue reading “A Quick Intro to mongosniff”

History of MongoDB

At LinuxCon, a guy took a look at me and said, “So, MongoDB was developed by college students, huh?” No, it was not. I couldn’t distribute my way out of a paper bag, which is why I’m not designing the database. A lot of people have been curious about where MongoDB came from, so hereContinue reading “History of MongoDB”