Meteor 2.16 and Oplog Tailing Optimization
Tags: meteor, javascript
Published: 2024-05-14 22:32:04

We're excited to announce the release of Meteor 2.16, packed with significant improvements designed to optimize your experience and enhance performance.

## Optimized Oplog Tailing Performance

In response to community feedback and extensive discussions about Meteor's oplog implementation and its limitations in scaling, we've introduced new MongoDB package options to optimize oplog tailing performance.

This was thanks to one of our community members,[@twisterking](https://github.com/Twisterking), who opened a [pull request](https://github.com/meteor/meteor/pull/13009) introducing this new improvement.

The implementation provides a solution for including or excluding specific collections from oplog tailing. This simple yet effective change can drastically reduce CPU load during large batch updates.

**Usage:**
To configure this optimization, update your settings.json file as follows:

```json
{
  // ... all other settings,
  "public": {
    // all your public settings
  },
  "packages": {
    "mongo": {
      "oplogExcludeCollections": ["products", "prices"], // Excludes "products" and "prices" collections from oplog tailing.
      // OR:
      "oplogIncludeCollections": ["messages"] // ONLY monitors the "messages" collection for oplog updates (and all "admin.$cmd" oplogs).
    }
  }
}
```

We believe this enhancement will greatly benefit users, reducing unwanted server restarts and ensuring smoother operations.

## Session Storage Option for Accounts

Some developers have suggested that a storage system other than Local Storage (which Meteor users use to store login tokens and other things) should be possible, and the second option should be Session Storage.

Today, this is possible thanks to [@StorytellerCZ](https://github.com/StorytellerCZ), who created this [PR](https://github.com/meteor/meteor/pull/13046) to address the matter.

To use Session Storage instead of the default Local Storage, you can add this to your settings file:

```json
{
  // ... all other settings,
  "public": {
    // ... all your public settings
    "packages": {
      "accounts": {
        "clientStorage": "session"
      }
    }
  }
}
```

From here, your app will start using Session Storage!

## How to test it

To install Meteor in this version:

```sh
npx meteor@latest 
```

You can create a new app in this version with:

```sh
meteor create myapp --release 2.16
```

Or update from 2.15 to this one with:

```sh
meteor update --release 2.16
```

If you're coming from an older version, please check our [Migration Guides](https://guide.meteor.com/2.14-migration).

## Special note about Meteor 3 Launch Week

With 2.16, we're also having our Meteor 3 Launch Week, introducing more of our [Meteor 3](https://dev.to/meteor/embracing-the-future-meteor-3-with-node-v20-and-express-2bd8), as well as [Galaxy 2.0](https://dev.to/meteor/a-fresh-look-exploring-galaxy-20s-new-uiux-4n9c), and we will have! So keep an eye on our [dev.to](https://dev.to/meteor) and on [X](https://twitter.com/meteorjs).

## Conclusion

This 2.16 version offers more to explore. Check out the rest in our [PR](https://github.com/meteor/meteor/pull/13066).

We can leave without mentioning the people who made this release possible:

[@nachocodoner](https://github.com/nachocodoner)
[@StorytellerCZ](https://github.com/StorytellerCZ)
[@jamauro](https://github.com/jamauro)
[@Twisterking](https://github.com/Twisterking)
[@harryadel](https://github.com/harryadel)

Thank you for your hard work and dedication to the Meteor.js community!
We encourage all users to update to Meteor.js 2.16 to take advantage of these new features and improvements.
For more information about Meteor.js, please visit the Meteor.js [website](https://www.meteor.com/).

Happy coding!