Simulating Network Paritions with mongobridge

Note: mongobridge does not come with the MongoDB binaries, but you can build it by getting the source code and running scons mongobridge. Let’s say we have a replica set with members (M1, M2, and M3) and we want to see what happens when M1 and M3 cannot reach each other (or any other sortContinue reading “Simulating Network Paritions with mongobridge”

Trying Out Replica Set Priorities

As promised in an earlier post, replica set priorities for MongoDB are now committed and will be available in 1.9.0, which should be coming out soon. Priorities allow you to give weights to the servers, saying, “I want server X to be primary whenever possible.” Priorities can range from 0.0-100.0. To use priorities, download theContinue reading “Trying Out Replica Set Priorities”

Implementing Replica Set Priorities

Replica set priorities will, very shortly, be allowed to vary between 0.0 and 100.0. The member with the highest priority that can reach a majority of the set will be elected master. (The change is done and works, but is being held up by 1.8.0… look for it after that release.) Implementing priorities was kindContinue reading “Implementing Replica Set Priorities”

“Scaling MongoDB” Update

In the last couple weeks, we’ve been getting a lot of questions like: (no one asked this specific question, this is just similar to the questions we’ve been getting) I ran shardcollection, but it didn’t return immediately and I didn’t know what was going on, so I killed the shell and tried deleting a shardContinue reading ““Scaling MongoDB” Update”

A Short eBook on Scaling MongoDB

I just finished a little ebook for O’Reilly: Scaling MongoDB. I’m excited about it, it was really fun to write and I think it’ll be both fun and instructive to read. It covers: What a cluster is How it works (at a high level) How to set it up correctly The differences in programming forContinue reading “A Short eBook on Scaling MongoDB”

Why Command Helpers Suck

This is a rant from my role as a driver developer and person who gives support on the mailing list/IRC. Command helpers are terrible. They confuse users, result in a steeper learning curve, and make MongoDB’s interface seem arbitrary. The basics: what are command helpers? Command helpers are wrappers for database commands. Database commands areContinue reading “Why Command Helpers Suck”

How to Use Replica Set Rollbacks

If you’re using replica sets, you can get into a situation where you have conflicting data. MongoDB will roll back conflicting data, but it never throws it out. Let’s take an example, say you have three servers: A (arbiter), B, and C. You initialize A, B, and C: $ mongo B:27017/foo > rs.initiate() > rs.add(“C:27017”)Continue reading “How to Use Replica Set Rollbacks”