BlogsMongoDBMongoDB Performance Improvements

MongoDB Performance Improvements

MongoDB Performance Improvements

2
posts
2024–2025

MongoDB 8.0 delivers significant performance enhancements, including a 36% read and 32% write speedup over 7.0. Key improvements stem from optimizing simple query paths (IDHACK to ExpressPlan), reducing replication latency by acknowledging writes upon journaling rather than in-memory application, and introducing instruction counting via Linux perf_event_open syscall for detecting subtle performance regressions. MongoDB 8.0 also features architectural optimizations that reduce memory usage and query times, making batch processing more efficient. Specific gains include 36% better read throughput, 56% faster bulk writes, 20% faster concurrent writes during data replication, and 200% faster complex aggregations of time series data. Sharding enhancements improve data distribution speed and reduce cost. Support for AI applications is enhanced with quantized vectors, reducing memory usage and improving retrieval speed. Queryable Encryption is expanded to support range queries. The initiative evolved from a focused tiger team to a broad "performance focus."

2025

MongoDB 8.0: Improving Performance, Avoiding Regressions

4/2/2025

Introduced a "performance army" approach to systematically improve MongoDB performance, building on a tiger team's initial work. Key technical contributions include the optimization of simple query paths by bypassing the general query planner for IDHACK, leading to the development of the ExpressPlan code path. Replication latency was reduced by changing the acknowledgment strategy to occur after journaling writes, before in-memory application. A new regression detection mechanism using instruction counting with Linux perf_event_open syscall was implemented to catch minor performance degradations. The broader "army" phase saw optimizations in query yielding, clustered collections for config.transactions, locking mechanisms, authorization checks, memory allocation (TCMalloc), and improvements in common code paths like namespace string handling and generated parsers.

2024

MongoDB 8.0: Raising the Bar

10/2/2024

This post announces MongoDB 8.0 and highlights its performance improvements, including a 36% read and 32% write speedup over 7.0. It details architectural optimizations leading to reduced memory usage and query times, and more efficient batch processing. Specific metrics include 36% better read throughput, 56% faster bulk writes, 20% faster concurrent writes during replication, and 200% faster complex time series aggregations. It also mentions sharding enhancements for faster data distribution and lower cost, and expanded Queryable Encryption for range queries. The post also notes the internal "dogfooding" experience with a 75% drop in query latencies for their build system.