Merchpin: Powered by MongoDB


The online retail, advertising, and content space is rapidly moving towards a self-service model. Brands can now quickly setup a website, blog, Facebook page, and e-commerce storefront using tools and services that were traditionally only available to an IT department. But these tools are highly specialized - and as a result, brand sites remain fragmented. So, while regular content updates may drive traffic to the company website and blogs, products remain siloed in a separate e-commerce storefront. The difficulty in combining content and commerce is a missed opportunity for marketers. We spoke with Matthew Knight to discuss how his company, Merchpin, is innovating in this space.

What is Merchpin?

Merchpin is a self-service merchandizing platform for brands and marketers. Our service makes it easy to target and promote products from your online catalog to other websites, blogs, or Facebook pages. Marketers can define rules to display products that complement existing content, creating new buying opportunities outside their existing e-commerce storefront.

Can you describe your technology stack?

Our backend uses MongoDB, varnish, nginx and PHP5. Our frontend is mostly javascript/JSON.

How does MongoDB fit in?

All application data is stored in MongoDB. In addition to all account information (user data, connected services, etc), Mongo also handles all product information, import schedules, and rule definitions.

How did you choose to use MongoDB?

Our service relies heavily on matching complex sets of rules to subsets of products, so we needed a data layer that could query highly-structured data, and fast.

Mongo is very flexible and allowed us to easily make changes to how we modeled our rules throughout development. Once we had our Rule model dialed in, we could easily store our Rule definitions as whole objects directly in Mongo - if we had used a relational database, we'd have to store the data across 7+ tables (or more, depending on the type of Rule). This makes our service very efficient at analyzing rules, so we can quickly serve up relevant products to the end-user.

What are some tips and tricks you’ve come up with along the way for using MongoDB?

Know your model! If you start with a well-defined model, it will save you time later on. This makes it easier to keep track of the indexes you're using, and exposes new ones you may need (or haven't thought of). This is one of the fun parts of working with Mongo: you can stay focused on your app's logic, and save the finished model down to Mongo when you're done - instead of spending time coding up how the data gets sliced up for a (relational) database.

What advice do you have for startups just getting started with MongoDB?

As user adoption for your app increases, monitor Mongo closely to expose problematic queries, and index accordingly. Get friendly with the mongo shell. Explain() can tell you a lot. When possible, try benchmarking an app solution vs. Mongo solution - we have found some operations are simply faster/simpler to do in your app, rather than add extra overhead/indexes/etc to Mongo.

Anything else you’d like to add?

An admin tool can be a handy addition to your workflow: we like MongoHub for Mac and MongoVue for Windows. Also, if you don't have a Mongo DBA on your team (we don't, but we're hiring!) - or if you just don't know how to get started with Mongo in general - try using PAAS solutions like MongoLab or MongoHQ. Their entry-level plans are free so it's really easy to get started.

Tagged with: ecommerce, merchants, poweredbymongodb, mongohq, mongolab, MongoDB, Mongo, NoSQL, Polyglot persistence, 10gen