We recently chatted with VP of Engineering, Jorge Escobar, about his experience using MongoDB for fast growing SaaS startup OrderGroove.
Tell us a little about OrderGroove.
What technologies are you using and how does MongoDB fit into your stack:
OrderGroove is a write-heavy application written in Python and Django. We started with a MySQL master and two slaves to allow for the rapid iterations we experienced initially as we developed and refined the platform. After we experienced a surge in new client signings (especially with clients that had significant traffic) we determined that the setup would prove to be insufficient if the growth trends continued at the pace we were experiencing. At that moment my team and I discussed the options that we could use to distribute writes horizontally. We were ready to write something from scratch that would involve application-level MySQL sharding.
However, I had played with MongoDB a few years back and we decided to give the technology a second look. MongoDB proved to be the perfect fit. It allowed us to grow (or shrink) elastically as our merchant needs fluctuate, especially around seasonal events, without having us to develop and maintain custom data store layers.
It sounds like you have a lot of data! Can you tell us about your experiences using sharding?
More than just the amount of data, our challenge was how to write fast enough. Sharding was the perfect solution for that challenge. Setting up sharding took some analysis, as you want to have a horizontally spread sharding index. Thanks to a consultation with Sarah Branfman and one of the 10gen engineers, we quickly knew we were in the right track. Our sharding index is a combination of merchant, session id and a timestamp. Four months after we launched the first batch of clients on MongoDB, we faced an incredible growth in traffic with new merchants that had much higher levels of traffic than we had seen before. It was just a matter of adding new replica sets and modifying the sharding configuration, and our writes were once again under control. Now we are constantly monitoring our cluster using 10gen’s MMS so that we’re prepared ahead of time for traffic growth patterns.
What advice would you give to other ecommerce startups using MongoDB?
MongoDB is the right solution for OrderGroove’s needs. If you have write heavy applications, MongoDB is a no-brainer. One thing to take into consideration is that data is eventually consistent, so we use MongoDB mostly for our front end tracking, but still use MySQL for the transactional data processes and most probably will continue doing so. It's important to pick the right data store model for your needs (or a combination of them). I wrote about this on my jungleG blog (http://jungleg.com/2011/11/20/sql-or-nosql-how-about-both/)
Another strong recommendation I would give to any company that’s going to use MongoDB is to take the time to install the MMS agents. It doesn’t take more than 15 minutes and it allows you to keep an eye on everything that’s happening with your MongoDB nodes and also helps the 10Gen team to debug any issues you might be facing by just sharing the data with them using your client id. We’ve been able to identify potential issues before they became real ones just by monitoring MMS.
Any exciting plans for the future that you would like to share?
We are looking closely at the new aggregation framework in MongoDB as we still generate analytics using MySQL using regular computation. With the aggregation framework, we could potentially handle more data and accelerate delivery even further for clients.