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…

Buying an Mahattan Co-op

Today, Andrew and I close on an apartment in Chelsea.

About a year and a half ago, I subscribed to a feed from streeteasy.com, which is a really awesome site. They do custom RSS feeds for any search, so I subscribed to the places in our price range in the neighborhoods we were interested in.

On May 16th, we finally found an apartment we really liked (pictured above). Then the fun began. While I was at a PHP conference in Chicago (TEK·X), I called Charles Schwab and got pre-approved for a mortgage. Then we made an offer. The sellers made a counter offer, we made a counter-counter-offer, and everyone agreed before I got home. So far so good, now we had to get a lawyer to draw up the contract. We had no lawyer, but Andrew’s parents had one, so we asked him to represent us. We initially forgot to ask him how much he charged, but eventually remembered (because we’re real grownups like that).

Once we had a contract, the sellers’ lawyer spelled my name wrong, so they had to redo the contract. Once it actually had my name on it, everyone signed it and we sent the first half of the downpayment to the seller’s attorney.

The next step was the mortgage: we had to get “for real” approved, not just be pre-approved. We inquired with a few other banks and ended up getting a great rate from Wells Fargo. We filled out the first of many stupidly long applications and sent them copies of all of our financial statements for the last couple of months (savings, checking, investments, paystubs, retirement accounts, etc.).

At this point we figured we’d probably be breaking lease on our current place, so we told our current landlord (Citi-Urban Management) that we’d be moving out on August 16th (we were scheduled to close on the 2nd, so this gave us a few extra weeks).

Once we had a commitment letter from Wells Fargo, we could start filling out the co-op application. You see, in NYC you don’t buy an apartment, you buy shares in the corporation that owns the building. This means that the building can make you jump through hoops and balance biscuits on your nose, This coop wanted us to send: 1 personal statement, 3 personal letters of recommendation, 1 business letter of recommendation, a filed-out application form, another copy of all of our financial statements for the last few months, the last two years of tax returns, checks for move-in fees and deposits, checks for credit checks, employment verification contact information, copies of our paystubs, copies of our drivers licenses, a copy of the “house rules” that we had to initial on every page, and a statement that we’d be getting homeowners insurance. The sad part is that there was more, I’ve just forgotten a bunch of the items.

We sent everything in and the board called us in for an interview on Friday, July 30th. We sat in a basement next to the laundry room and they asked us why we wanted to own a place, whether I’d be able to get a job if 10gen went out of business (somehow they weren’t as concerned with Google going out of business), if we could make websites (Danger! Danger, Will Robinson!), and if we were planning on getting a joint checking account. After an hour, they let us go.

On Monday, August 2nd, the real estate agent called to let us know that we were in. Now all we had to do was actually close. Unfortunately, the sellers now wanted to put off closing as long as possible so that they could find a new place and we got a call from our landlord telling us that they had found a person to take our lease who would be moving in on the 13th, so we had to be out by then. Our lawyer bullied and guilted everyone into agreeing to close on the 16th, leaving us homeless for a scant week (we moved out on the 10th because I had to go to Boston and give a talk at LinuxCon on the 11th). Luckily, Andrew’s (effective) godparents own a bed-and-breakfast in the city and let us stay there.

During this week, the person we’d been dealing with at Wells Fargo went on vacation and the temp guy didn’t have any of our information and wasn’t sure if we’d be able to make the closing. Last week, as I freaked out in Boston, Andrew managed to bully and guilt him into doing his damn job.

Finally, today, we got a check for the rest of the downpayment, did a final walkthrough of the apartment, and spent 3 hours signing papers. Tonight, we sleep on a borrowed air mattress on the floor of our new apartment!

I Never Thought I’d Be On a Book

I’ve pretty much disappeared for the last few weeks because I’ve been finishing up MongoDB: The Definitive Guide, now available for pre-sale! It’s a comprehensive reference to MongoDB which should be useful for everyone, from a beginner who has never touched the database before to a core MongoDB developer (or so two have claimed… I’m a bit skeptical).

This book covers everything from getting started with MongoDB to developing your app to sending it into production safely and securely. Mike and I have been helping users with MongoDB for a couple years now and this is a compilation of answers to the most common questions, warnings about the usual traps people fall into, and comprehensive coverage of important or interesting subjects.

Also, for regular readers of my blog: remember that zero-points-of-failure sharding setup post I promised? It’s in the book. In fact, pretty much every great technical topic I’ve thought of in the last 6 months has gone into the book, so go get your copy now!

Once and Future Presentations

On Monday, I gave a presentation on MongoDB to the San Francisco MySQL user group.  It was a lot of fun, you can watch the recording on ustream:

http://www.ustream.tv/flash/live/1/3708550Streaming Video by Ustream.TV

Apparently the audio was buzzy (I haven’t actually listened to it myself yet).

The audience especially enjoyed this slide about MySQL’s current situation:

One of the guys told me that he was scrambling to take a picture of it but I went to the next slide too fast, so here it is in all it’s glory.

Thanks to everyone at the MySQL meetup for being so awesome, I had a great time!

Future Talks

April 30th: I’ll be in California again, giving a talk called “Map/reduce, geospatial indexing, and other cool features” at MongoSF

May 18-21: I’ll be in Chicago at Tek·X. I’ll be doing a regular session, “MongoDB for Mobile Applications“, and a tutorial on switching apps from MySQL to MongoDB (assuming no knowledge of MongoDB).

St. Clementine’s Day

The night before Valentine’s Day, I got Andrew a crate of clementines (they’re already gone).  Yesterday, the Doghouse Diaries ran:

I came down with a cold on Friday and neither of us wanted to do anything for Valentine’s Day so we ended up playing Legend of Zelda most of it. When we got hungry, we started looking through the cabinets and I saw some dried apricots that reminded me of some chocolates Andrew got me for Christmas.

“For future reference,” I said, “I loved those chocolate-covered apricots.  They were so good.”

“You want to make some now?” he asked.

Now, I was sick and tired and that sounded a lot like work.  But it was so freakin easy.  And awesome.  And delicious.   And come on, how much more romantic can you get?  Here’s how to do it yourself:

  1. Take a lump of semisweet baker’s chocolate about twice the size of a Hershey’s bar
  2. Stick it in a bowl in the microwave for 30 seconds
  3. Mush it up and dump in a bunch of dried fruit/nuts/whatever
  4. Spoon each chocolate-covered item onto a sheet of parchment
  5. Stick the parchment in the fridge

An hour later, we had my favorite chocolates.

Then we watched Star Wars.

My life is awesome.  Thank you for being so wonderful, Andrew.

Washington DC

I’m giving a talk at DC PHP in… oh… 40 minutes.  I started the day in New York City, and hopefully will make it back there tonight.  Long day.

This morning, when I got to Penn Station, I tried to use the ticket machine’s barcode scanner.  It usually scans my confirmation page and prints out the tickets.  Nothing.  I put down all my stuff and tried a bunch of variations, but the barcode scanner continued to ignore me.  Fine.  I took out my credit card and retrieved my tickets that way.  I picked up my coat and… it was all wet.  Ew.  I wiped my coat off on my jeans, figuring jeans would dry out faster.  As I was walking over to the trains, I had an unpleasant thought.  Maybe that wasn’t water… I sniffed my coat.  Ugh.  Nope, not water.  Now, not only does my coat smell like hobo piss, I brilliantly wiped it on my jeans so now I smell like hobo piss.  Hopefully I’m talking in a big, well-ventilated room.

So far, Washington gets an A+.  The train station was great (although possibly Penn Station is such a cesspool that my expectations have been lowered, but it was really nice) and the information booth gave me good directions to the Metro (which I promptly ignored, but that was hardly their fault).  The Metro was really nice (padded seats!), fast, well-marked, and made sense.

I was walking along K Street and saw the Washington Monument, which I took a picture of like a total tourist.  Then I realized that there was a white house under it, possibly the white house?  I was actually kind of excited to see it in real life, so I moved in to get a better picture.  Once I was closer, I realized it was just a white house, not the White House.  I took a picture of it anyway.  It was probably something.

Edit: my talk went great and the people were super nice.  Here are the pictures I took of DC.

Public Speaking

MongodbI talked at LILUG (Long Island Linux User Group) about MongoDB on Tuesday, which was really fun.

Not that it started out all that well. One of LILUG’s officer’s picked me up at the station. We had… an imperfect fusion of souls. He told me, on the way to the pub, that he was sick of GNU, sick of Linux, and sick of being an officer in LILUG. When we got to the pub, he made a joke about Chinese people having slanty eyes. Ugh.

Anyway, we got there, and met a couple guys standing at the bar. The older one (~60) asked if he could buy me a drink, to which I awkwardly acquiesced. I’m never sure what the protocol is, if there’s anything implied by accepting a drink. The other guys wandered off towards a table, but the old guy made no move.

“Um, are you… um… a member of LILUG?” I asked.

“No,” he said, staring at me. Whoops.

“Um, I have to go,” I said, and went over to the table where the LILUG guys had gone.

“Yeah, he’s just some random guy who was at the bar,” one of the members said, laughing. Har de har.

I ordered nachos, which turned out to be a freakin mountain that could have served six people. They were seriously piled almost a foot high on the plate. They were delicious, and a bunch of really nice LILUG members showed up.

Once we were done eating, we went over to Stony Brook, which is where I was actually giving my talk. I’ve had a cold for the last week and I was a bit nervous about my voice giving out, but it held up and people really seemed to enjoy it.

I like it when people ask lots of questions an participate, and I had a brainwave before I left the office on how to encourage it. When I started my presentation, I told people to feel free to ask questions. “And the first person who asks a question,” I said, rooting around in my bag, “gets this fabulous Mongo mug!” I told them, unearthing it and holding it up. A college student’s hand shot up. “What was Mongo named after?” he asked. And we were off to the races!

Afterwards, everyone went out for one more drink. “To the downfall of SQL!” someone called, and everyone cheered and toasted to it.

P.S. Just to be clear, I didn’t actually advocate the downfall of SQL, in fact, I specifically mentioned relational databases are needed in some cases. It was cute, though 🙂

P.P.S. Slides are on slideshare.

Five Worst Places for Mosquito Bites

If there is a mosquito within 50 feet of me, it will find me and bite me.  I am one of those people that attracts them like a magnet.  A delicious, blood-filled magnet.  Anyway, these are the places you should avoid getting bitten:

1. Face – Could be forhead, nose, cheek, eyelid… they all look like zits and itch like hell.  I always get these when there’s a mosquito in my bedroom, since the rest of me is under the covers all night.

2. Top joint of finger – these itch a lot, and then they just hurt because there’s not really enough skin slack there to support something swelling up.

3. Nipple – very difficult to itch.  Looks strange, too.

4. Big toe – there’s juuuust enough room between your foot and the shoe to rub this all day, but have you ever tried itching your foot through a shoe?

5. Rows of bug bites – okay, this last one isn’t really a place, but I’ve gotten these really irritating bites where the mosquito bit me, took two steps, bit me, took two steps, bit me, and so on.  It’s like the poison ivy of bug bites.

In conclusion, I hate mosquitoes.