MongoDB Community Edition 8.0 has been available since October. At Percona, we took the time to examine this release carefully, check performance, and guarantee it works perfectly, stand-alone, and with other tools like Percona Backup for MongoDB and Percona Monitoring and Management. Today, we are excited to announce the General Availability of Percona Server for MongoDB 8.0.4-1

This release brings the latest MongoDB 8.0 features with the added reliability, performance improvements, and open source mindset that Percona is known for. It’s the most performant and secure among all MongoDB releases so far!  In this blog post, we share the most essential changes in MongoDB 8.0 and what you should know about them. 

Why choose Percona Server for MongoDB?

Percona provides a drop-in replacement solution for MongoDB Community Edition based on the same upstream code delivered by MongoDB, Inc. The difference between Percona Server for MongoDB and MongoDB CE is that we provide a gap-closing source-available set of features for users who want to use MongoDB in production. These enterprise features include, but are not limited to: 

  • Security improvements – Encryption at rest with KMIP and Hashicorp Vault integration or LDAP authorization and authentication.
  • Availability solutions — Enterprise-grade backups, including physical backups and point-in-time recovery via Percona Backup for MongoDB
  • Kubernetes Operator –  including support of multi-cluster Kubernetes.
  • PMM – A fully open source monitoring and management tool to help you run your databases (not limited to MongoDB).

What changes should you know about MongoDB 8.0?

MongoDB 8.0 introduced several important features and enhancements that improve performance, scalability, security, and developer productivity. Let’s now examine the most significant changes and new functionalities in MongoDB 8.0.

Sharding enhancements

In version 8.0, MongoDB has enhanced its sharding capabilities, making distributing data across multiple shards more efficient. 

  • Config Shards: You can now store cluster metadata and application data in “config shards.” Metadata was traditionally stored on the config servers. This improvement is precious for small, development, or pre-production environments. Dedicated config servers are still possible and recommended for busy environments.
  • Cluster-wide fsyncLock: fsyncLock can now be run from a mongos router, and the lock is propagated to all the shards. This is useful for backup purposes.
  • Resharding: The resharding algorithm has been completely revamped. Think pt-online-schema-change but for a sharded collection. Early results indicate that a 1TB collection can be resharded in roughly 12 hours. In earlier versions, this was a painful multi-day process. Overall, performance has been enhanced by up to 50 times, with initial costs reduced by as much as 50%.
  • Primary Shard: Moving a (non-sharded) collection to a specific shard is now possible. There is no longer a need to have all non-sharded collections on the primary shard for each database.

Majority write concern 

Until now, w:majority meant that all data and index changes were applied on most servers before returning the acknowledgment to the client.  In MongoDB 8, only the write to the oplog collection is guaranteed to be applied on most servers before returning acknowledgment to the client. This results in faster writing overall but has a significant side effect. If you read from a secondary immediately after receiving an acknowledgment from a { w: “majority” } write operation, the query may now return results that don’t include changes from that write. You can still use causally-consistent sessions to prevent this.

New TCMalloc

MongoDB 8 uses a new version of tcmalloc with per-CPU caches, which reduces memory fragmentation. The tcmallocEnableBackgroundThread is also enabled by default. This allows MongoDB to release memory back to the operating system periodically. This has the interesting consequence that Transparent Huge Pages (THP) are now recommended with MongoDB 8. Earlier versions of MongoDB did not allow this.

Quality of life

  • Concurrent DDL: Several improvements have been made for DBAs. Concurrent DDL is now possible, which means we can simultaneously modify (e.g., add index) multiple collections in the same database. Before MongoDB 8, only one collection per DB could be modified concurrently.
  • Auto-compact: There is also a new background auto-compact mechanism, where a monitor thread periodically iterates through all available collection files and triggers compaction if needed.
  • Query Shapes: Query Shapes (aka query fingerprints) can now be used to force specific indexes to be used or simply reject some harmful query patterns. Some query types can skip regular query planning and execution and use an optimized index access path called “Express.”
  • Queryable Encryption Range Queries: Manual Queryable Encryption supports range queries on encrypted fields using the $lt, $lte, $gt, and $gte operators. This gives even more security and privacy controls for the encryption in use.

Performance improvements

  • Time-series: MongoDB 8.0 further improves its support for time series data, commonly used in IoT, monitoring, and analytics applications. A new algorithm enhances time series speed by processing queries in “blocks” of data rather than individual values. The new approach delivers a 200% speed improvement in processing complex aggregations of time series data.
  • Batch multi-document inserts: Insert operations for multi-document transactions no longer produce individual oplog entries but are now batched as a single entry. This increases multi-document insert performance and improves replication efficiency, reducing lag. In our MongoDB case, it’s 36% better read throughput and 56% faster bulk writes.
  • Fetcher/applier replication threads: A new writer thread reads new entries from the primary and writes them to the local oplog on each secondary. An independent applier thread asynchronously applies changes to the local database, increasing replication throughput by about 20%. If you are familiar with the MySQL replication mechanism, this should sound familiar to you.

LDAP support

With the release of Percona Server for MongoDB 8.0, we’d like to reaffirm our continued support for LDAP integration, which has been available since our 4.2 release. Unlike MongoDB Enterprise Server, which recently announced that version 8.0 will be the last to support LDAP, Percona remains committed to offering LDAP as a reliable authentication option for organizations that rely on it. We understand that many businesses still depend on LDAP for centralized authentication and user management, and we aim to provide them with the flexibility and support they need to integrate with existing infrastructure while seamlessly planning for the future.

Percona Distribution for MongoDB

On May 19, 2020, we introduced the premiere release of Percona Distribution for MongoDB, which contains the Server and Backup products in one package. For almost five years, we have analyzed the adoption of that package and its value to you. After careful consideration, we have decided not to release Percona Distribution for MongoDB 8.0. Instead, we will focus on enhancing the support of other operating systems and CPU architectures. We are still committed to releasing the distribution updates for previous major releases – PDMDB 6.x and PDMDB 7.x for at least the next 6 months. We welcome feedback on this decision. Please share your thoughts on the Percona Community Forum, and we will carefully consider all input.

percona server mongodb 8

All changes in the release can be found on the release notes pages for Percona Server for MongoDB 8.0.4-1.

Do you remember MongoDB 5.0 reached its EOL?

We’re still observing a number of running deployments with Percona Server for MongoDB 5.0.x. We want to remind you that Percona Server for MongoDB follows the upstream EOL dates. This means bug fixes and software builds will no longer be generated for our MongoDB release, effective October 31, 2024. Also, with the Percona Server for MongoDB 5.0 that reached its end of life, the implications are as follows: 

  • Percona Distribution for MongoDB 5.0 will no longer receive updates and bug fixes
  • Percona Backup for MongoDB (PBM) will no longer support 5.0, effective PBM 2.8.0. 

That means that testing with 5.0 has ceased, and while PBM may still successfully perform backups and restores, we cannot guarantee it anymore. That being said, rest assured you will not be left alone. Those who want to sign up for a Percona Support Subscription will continue to receive operational support and services. 

If you’re running MongoDB 5.0, upgrade now! Your next step is MongoDB 6.0, then 7.0, and finally, the best-performing ever – 8.0. Read our guidelines on how to upgrade, and if you’re stuck, contact us.

How do you upgrade to Percona Server for MongoDB 8.0?

To leverage the benefits introduced in version 8.0 and make sure the upgrade is frictionless, ensure you are:

  1. Running Percona Server for MongoDB version 7.0, as upgrades from earlier versions are unsupported.
  2. Upgrade Percona Backup for MongoDB (PBM) to version 2.7.0 or 2.8.0 and Percona Monitoring and Management (PMM) to version 2.44 or newer.
  3. Thoroughly test your applications in a non-production environment to confirm compatibility with the latest version.

For production environments, we recommend upgrading Percona Server for MongoDB using the official Percona repositories via the percona-release repository management tool and your system’s package manager. For further instructions, check the detailed upgrade procedure.

What’s coming next?

As we continue to enhance Percona Server for MongoDB, the upcoming features in the 8.0 release will focus on addressing enterprise needs, security, and ease of use.

One essential addition will be file copy-based initial synchronization for non-sharded clusters, allowing faster and more efficient data replication during setup. We’re also introducing OpenID Connect (OIDC) integration for modern, secure authentication, OCSF Schema for Log Messages to ease your audit log compliance work, and support for Amazon Linux 2023, ensuring compatibility with the latest cloud environments. These features will be delivered to Percona Server for MongoDB 8.0 within upcoming patch releases.

Additionally, dedicated Full-Text Search nodes and Vector Search from the Community Edition should arrive soon. And that’s just the beginning—stay tuned for more innovations designed to optimize performance and flexibility for your MongoDB deployments.

The official MongoDB release notes and documentation provide more detailed information and a complete list of changes. To get help with upgrading your MongoDB to the next version, feel free to contact Percona Experts.

 

Percona Server for MongoDB 8.0.4-1

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments