Writing MongoDB: The Definitive Guide

Me, with the finished product

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 in my life. These people must have the exact opposite personality I do. And, in our case, they spelled “Ruby gems” as “Ruby germs.”
Blog posts are a better length
In 500 words, I can edit and polish something until it’s a shimmering jewel of a, uh, blog post. It’s really hard to make a hundred thousand words even have a reasonable flow, never mind be “perfect.”
Illustrations will be assimilated.
When we submitted the manuscript, I had (the night before) whipped up the illustrations in Photoshop that looked like this:

Every document is a beautiful snowflake (because they're all unique)

At the final stage of the editing process, these all got replaced by O’Reilly illustrations, which looked a lot more professional.

Well la-dee-da.

I’m pretty impressed by how well they matched what I was going for, but wish I hadn’t spent so long making those damn snowflakes.

An advance is an advance on sales.

In retrospect, I should have realized this, but I never really thought about it before. If O’Reilly advanced us $100,000 (they didn’t), that just means we wouldn’t get any royalty checks until people bought enough books to give us $100k in royalties. So, essentially, authors write books for free. This kind of amazes me.

All and all, it was really fun and I’d do it again in a heartbeat. In the future, I wouldn’t stick to the schedule quite as rigorously. At the beginning, O’Reilly gave us the following timeline:

  • 3 months = 2 chapters
  • 6 months = first half
  • 9 months = whole book

I write best when I splorch down everything that comes to me as fast as possible and then edit it fifty times. So next time I’d do:

  • 3 months = book of crap
  • 6 months = semi-literate book
  • 9 months = great American (technical) novel.

Andrew suggested we do the National Novel Writing Month, so now I’m trying to think of another thing to write about. I’ll probably do a MongoDB book, but not sure what yet…

  • Congrats. I was not one of the luck 4 winners of your book tonight. I’ll order it tomorrow. I was hoping they would be for sale in Boston so I could get Mike to autograph it. Alas, I will have to stalk the two of you with a sharpie later.

  • Haha happy to sign it anytime – sure I’ll be seeing you sometime soon.

  • Taro Nishino

    I was informed from Amazon that the delivery of the book would be deferred.
    At that time, to be honest, I worried a bit that you and the co-author might get stuck with something I couldn’t imagine.
    In any case, congrats.
    I’m looking forward to seeing a copy as soon as possible.

  • Anonymous

    Thanks! Sorry you didn’t win one, you deserve it.

  • Anonymous

    Thanks! I think it was delayed by a week (it was supposed to come out the 15th) but I’m not sure why, I think we got everything in on time or early.

  • I wrote for Pragmatic, and we didn’t see a dime until we got the royalties. Puts all the burden on me to get the damn thing out. Not complaining, mind you.

  • Anonymous

    Yeah, it probably varies by the publisher. In some ways no advance is nice because you’ll start getting royalties right away, but I think I prefer to get a little up front.

  • Just ordered my copy of #mongodb the definitive guide, and got more proof I need to formalize my “#MongoDB as an #MSAccess Killer” rant in a blog post.

  • Anonymous

    Yay! From the twitpic, looks like it’ll be tough for us to sign (being an ebook and all).

    I’d read that rant 🙂

  • The pic and the order both say paperback.

  • Anonymous

    Oh, I saw the big Nook in the picture and assumed it was the Nook store. Carry on.

  • Amit Lamba

    Hi Kristina,

    Not sure where else to put this since I don’t know how to get a hold of you by e-mail. I have a question on an example in Chapter 6 – Aggregation Page 85. The first example on that page where you are counting tags grouped by day is stumping me. The result set includes the “day” tag, but I don’t see “day” being used as a key in the example. I only see “tag” as a key. How does the result set have “day” when I don’t see it referenced in the example?



  • Anonymous

    It’s an error, thanks for letting me know! It should be:

    > db.posts.group({
    ... key : {"day":true}, 
    ... initial:{"tags" : {}}, 
    ... $reduce : function(doc,prev) { 
    ...     for (i in doc.tags) { 
    ...         if (prev.tags[doc.tags[i]]) { 
    ...             prev.tags[doc.tags[i]]++; 
    ...         } else { 
    ...             prev.tags[doc.tags[i]] = 1; 
    ...         }
    ...     }
    ... }})


  • Pingback: ehcache.net()

  • Pingback: Haber Kaynağınız()

  • layin

    Hello All just wanted to know that did anyone face any issue of :error command line: unknown option priority
    when starting the mongo database using : nohup mongod –config mongodb.conf –replSet rs0 &
    and we have priority set to 1 in the primary config file and to 0 in secondary.

  • kristina1

    You cannot set priority in the config file. See http://docs.mongodb.org/manual/tutorial/deploy-replica-set/ and http://docs.mongodb.org/manual/tutorial/adjust-replica-set-member-priority/ for instructions on setting up a replica set and changing its priority.

kristina chodorow's blog