mongodb

Upgrading MongoDB version for your instances

By May 10, 2018 August 21st, 2019 No Comments

Reap the benefits of upgraded MongoDB instances

Upgrading from an older version of MongoDB can be painful. We get it. Your app is working, you don’t have the time or resources to upgrade even though you know you need to. It stays at the bottom of your backlog because new features and enhancement to your application are always more critical to the business. You keep putting it off, knowing that you are getting farther and farther behind.

We talk to many IT and DevOps leaders that find themselves in this situation. They use MongoDB 2.4 or 2.6 and they’ve fallen really far behind. And they feel stuck.

MongoDB Inc. releases updates about once a year. In February, MongoDB deprecated version 3.0. MongoDB has also announced that they are deprecating version 3.2 in September. Each release brings new features, major bug fixes, and performance enhancements. When evaluating an upgrade to a newer version, you may have some features you’d like to add and there may be some nagging bugs you’d like to squash. We have upgraded thousands of instances over the years and we’ve learned a lot.

Here are some reasons it can be painful to upgrade your MongoDB instances:

Downtime

Both minor and major version upgrades can usually be completed without any downtime, if your driver is set up to be resilient during a step down and mongos restart. Timelines for upgrades depend on many factors, such as which version you’re currently running, your applications’ needs, and which features will offer the most benefit for your app. Most customers can expect a 30-minute maintenance window with a 15 second period of downtime. Contact support for an estimate based on your set up.

Rewriting Code & Deprecated Features

It’s not uncommon to have to change your code in order to upgrade. Each new major version may or may not deprecate query operators and tools. If you’re using a lot of features, there’s a good chance some of your queries will need to changed. Features may also be shelved but in most cases there is a replacement feature or a workaround that can be implemented.

Updating Drivers

Since you are using an older version of MongoDB, your driver might already be out of date. New drivers offer new features and can improve your application and user experience. You might have to update your driver in advance. Sometimes, this can be painful because a driver upgrade involves dependencies so other components/frameworks might need an upgrade as well.

For all the reasons listed above, we always recommend testing a new major version before upgrading.

Upgrade considerations

Here are some things we look at when figuring out how long an upgrade to an instance will take:

  • Code language
  • Driver version
  • Code compatibility, like deprecated operators
  • MongoDB version constraints (dataset compatibility checks)

Why upgrading is important

There are several reasons to keep upgrading MongoDB. Deprecated versions won’t get backported when comes to bugs. Each version involves hundreds of bugs. For example, there have been more than 150 bug fixes related to the database engine and more than 280 other enhancements and improvements for version 3.4 alone. If you’re still not convinced, check out the new features/improvements section for select improvements.

New features/improvements

MongoDB version 3.0

  • Introduction of MMAPv1 – MMAP storage engine was refactored to support collection-level locking vs. database-level locking in 2.6. This change increases concurrency and throughput.
  • Introduction of WiredTiger – Even if we don’t recommend WiredTiger in 3.0 version, it is the first version that supported the new storage engine. WiredTiger offers document-level locking and compression of data and indexes.

MongoDB version 3.2

MongoDB version 3.4

Update: We now fully support MongoDB 3.6 on our platform. Read more about what’s new and next steps.

Future MongoDB releases

We expect 4.0 to be released somewhere between Q3 and Q4. Exciting new features are coming such as ACID transactions in replica sets. However, it’s likely that 4.0 will remove the MMAPv1 storage engine. More on 4.0 on a future blog. Check out upcoming release details.

What happens next

Set up a call with the ObjectRocket support team so we can begin a plan that fits your needs. We can help you get ahead of potential problems and avoid unplanned maintenance. We’ll help you figure out if you’ll need to plan development updates, update driver settings, and/or set up maintenance windows.