Last night I attended a Meetup at MongoDB Inc.’s new Palo Alto office to hear MongoDB’s CTO, Eliot Horowitz, speak about the product roadmap. With a new production release right around the corner and MongoDB World in the not-so-distant future, the buzz and excitement around all things MongoDB is high. For those who were not able to attend, we’re going to recap all the major points Eliot made.
In our previous post on MongoDB storage structure and dbStats metrics, we covered how MongoDB stores data and the differences between the dataSize, storageSize and fileSize metrics. We can now apply this knowledge to evaluate strategies for re-using MongoDB disk space.
When documents or collections are deleted, empty record blocks within data files arise. MongoDB attempts to reuse this space when possible, but it will never return this space to the file system. This behavior explains why fileSize never decreases despite deletes on a database.
If your app frequently deletes or if your fileSize is significantly larger than the size of your data plus indexes, you can use one of the methods below reclaim free space. Continue Reading →
At MongoLab we manage thousands of MongoDB clusters and regularly help customers optimize system performance. Some of the best tools available for gaining insight into our MongoDB deployments are the monitoring features of MongoDB Management Service (MMS). MMS allows us to quickly determine the health of a MongoDB system and identify the root cause of performance issues. This post covers our general approach to using MMS and MongoDB log files and provides techniques to help you optimize your own MongoDB deployment, whether you’re in the cloud or on your own hardware.
First, we will define the key metrics that we use to guide any performance investigation. Then we will go through the various combinations of metric values, discuss what they mean, and explore how to address the problems they indicate.
(Updated: 2014-01-08 Two-factor authentication is now GA)
Here at MongoLab, security is one of our foremost concerns. Part of our stewardship of our users’ data, in addition to keeping it accessible and intact, is doing our best to secure it against unauthorized access. Today, as part of that effort, we are excited to announce our adoption of two-factor authentication (“2FA”) for MongoLab’s web-based management portal.
If you keep tabs on the glamorous InfoSec scene you probably already know what 2FA is and exactly why you should care. If that’s you, feel free to skip on down to the punchline in the last paragraph. Otherwise, bear with me and I’ll try to explain why an extra screen in your MongoLab login sequence might be a Very Good Thing indeed.
As your application grows in functionality and/or usage, managing resources becomes increasingly important. Failure to properly utilize connection pooling is one major “gotcha” that we’ve seen greatly impact MongoDB performance and trip up developers of all levels.
Creating new authenticated connections to the database is expensive. So, instead of creating and destroying connections for each request to the database, you want to re-use existing connections as much as possible. This is where connection pooling comes in.
A Connection Pool is a cache of database connections maintained by your driver so that connections can be re-used when new connections to the database are required. When properly used, connection pools allow you to minimize the frequency and number of new connections to your database.
Hey Node hackers!
Given last year’s tremendous turnout and success, MongoLab is very happy to sponsor Node Knockout (Nov 8-10) once again. If you’re wondering what the buzz is about, Node Knockout is a 48-hour hackathon featuring Node.js. It’s an online virtual competition with contestants worldwide. The competition kicks off at 12:00 AM / 00:00 UTC on November 9, 2013 and ends at 12:00 AM / 00:00 UTC on November 11, 2013. There are still a few spots open on some teams, so reach out to our friends organizing the event if you’re interested!
MongoLab will be offering both service and prize sponsorships for participating teams. This means that during the competition your team can sign up for a free 500MB Joyent-hosted MongoDB. We’ve partnered with Joyent and Nodejitsu to bring you the lowest latency possible between your knockout app and MongoDB.
You’re feeling accomplished and excited; the new features for your application are finished, committed, and deployed. You fire it up, expecting your shiny new app on your screen. Unexpectedly, the app errors out or hangs indefinitely.
What’s going on?!
You may have just had your first direct encounter with the subtleties of your MongoDB driver’s connection options.
At a high level, whenever you create or use a MongoClient object to talk to your database, the driver establishes a connection to your MongoDB server. How long your application waits for the initial connection to be established and how long it waits for responses to subsequent requests is determined by the values of your connection and socket timeouts.
Transitioning your application from development to production is a monumental step. Over the years, we at MongoLab have acquired a lot of valuable experience helping our customers successfully manage their production-grade MongoDB deployments.
What follows is a checklist of action items that we’ve found imperative for successfully taking your application to production. For the experienced, we hope you can use this guide as a refresher on best practices. For the newer folks, this is a must-read on how to ready your database for the big move.