How MongoDB’s Journaling Works

I was working on a section on the gooey innards of journaling for The Definitive Guide, but then I realized it’s an implementation detail that most people won’t care about. However, I had all of these nice diagrams just laying around. Good idea, Patrick! So, how does journaling work? Your disk has your data filesContinue reading “How MongoDB’s Journaling Works”

How to Make Your First MongoDB Commit

10gen is hiring a lot of people straight out of college, so I thought this guide would be useful. Basically, the idea is: you have found and fixed a bug (so you’ve cloned the mongo repository, created a branch named SERVER-1234, and committed your change on it). You’ve had your fix code-reviewed (this page isContinue reading “How to Make Your First MongoDB Commit”

Replica Set Internals Part V: Initial Sync

I’ve been doing replica set “bootcamps” for new hires. It’s mainly focused on applying this to debug replica set issues and being able to talk fluently about what’s happening, but it occurred to me that you (blog readers) might be interested in it, too. There are 8 subjects I cover in my bootcamp: Elections CreatingContinue reading “Replica Set Internals Part V: Initial Sync”

Good Night, Westley: Time-To-Live Collections

In The Princess Bride, every night the Dread Pirate Roberts tells Westley: “Good night, Westley. Good work. Sleep well. I’ll most likely kill you in the morning.” Let’s say the Dread Pirate Roberts wants to optimize this process, so he stores prisoners in a database. When he captures Westley, he can put: > db.prisoners.insert({ …Continue reading “Good Night, Westley: Time-To-Live Collections”

Replica Set Internals Bootcamp Part III: Reconfiguring

I’ve been doing replica set “bootcamps” for new hires. It’s mainly focused on applying this to debug replica set issues and being able to talk fluently about what’s happening, but it occurred to me that you (blog readers) might be interested in it, too. There are 8 subjects I cover in my bootcamp: Elections CreatingContinue reading “Replica Set Internals Bootcamp Part III: Reconfiguring”

––thursday #5: diagnosing high readahead

Having readahead set too high can slow your database to a crawl. This post discusses why that is and how you can diagnose it. The #1 sign that readahead is too high is that MongoDB isn’t using as much RAM as it should be. If you’re running Mongo Monitoring Service (MMS), take a look atContinue reading “––thursday #5: diagnosing high readahead”

Night of the Living Dead Ops

MongoDB users often ask about the “killed” field in db.currentOp() output. For example, if you’ve run db.killOp(), you might see something like: > db.currentOp() { “inprog” : [ { “opid” : 3062962, “active” : true, “lockType” : “write”, “waitingForLock” : false, “secs_running” : 32267, “op” : “update”, “ns” : “httpdb.servers”, “query” : { “_id” :Continue reading “Night of the Living Dead Ops”

Replica Set Internals Bootcamp: Part II – Creating a Set

I’ve been doing replica set “bootcamps” for new hires. It’s mainly focused on applying this to debug replica set issues and being able to talk fluently about what’s happening, but it occurred to me that you (blog readers) might be interested in it, too. There are 8 subjects I cover in my bootcamp: Elections CreatingContinue reading “Replica Set Internals Bootcamp: Part II – Creating a Set”