How I Scrapped MySQL for MongoDB in Three Hours

Last weekend at the AT&T Mobile Hackathon I had a pleasure of checking out the MongoLab's MongoDB service.  In short: it was a delight to work with.  I fell in love with that technology.  It worked exactly the way I thought--MongoDB architects got it right. After spending a good part of the day fighting my hibernate configuration in JUnit I was pleasantly surprised when I saw that Mongo keeps their Documentation and design accessible with plan old object and simple REST calls to its MongoLab API.

MongoLab makes creating a MongoDB super easy.  You can sign up for a dev account and within minutes get an instance that will hold up to 240MB of data.  It's perfect for a prototype. In 15 minutes I was up and running and had my unit test executing flawlessly. It took a couple of more hours to refactor the application to move my Serialization from MySQL + Hibernate to MongoDB.  In a total of three hours the port was complete.

The web interface on MongoDB made it easy to see if my app was serializing data correctly.  I created one collection for Unit Test and another collection for my production data. Collections can be limited in the number of records so they wouldn't flood my account with test data.

MongoLab Admin View

Working with Mongo right after working with Hibernate and MySQL made me realize something.  In 2000-2007 we built up some complicated protocols and frameworks. The last couple of year the simplicity seems to have taken off.  A lot of people wrote off Java because of the complexities, but I can tell you that Spring+Annotations and MongoDB brings the joy back to Java web development again.

Be sure to read the next API article: Music Licensing API Lets You Sound Legally Awesome