Blogs
MongoDB logo

MongoDB

Engineering blog · mongodb.com/company/blog/channel/engineering-blog

12posts0this week0watchers

Feature trails

8
Feature trailActive

Model-Based Verification of Storage Engine

Introduced model-based verification to formally check the conformance of the WiredTiger storage engine implementation against an abstract specification of its semantics. This approach leverages a TLA+ specification of the storage engine interface and uses a modified TLC model checker to generate tens of thousands of API call test cases, ensuring the implementation matches the contract relied upon by the distributed transactions protocol. The process achieved high test coverage for a small model. This post details the application of trace-checking to the MongoDB server's Raft-like replication protocol, using JavaScript integration tests and a randomized 'rollback fuzzer' to generate execution traces. These traces are translated into TLA+ and checked against the RaftMongo.tla specification to verify conformance.

5 posts · 2025–2026

Timeline

20252026
Feature trailActive

Token-Count-Based Batching for Embedding Inference

Introduced token-count-based batching to optimize embedding model inference for short requests. This approach leverages padding removal in inference engines like vLLM and SGLang to process sequences based on total token count rather than fixed batch sizes or time windows. A Redis-backed queue system with Lua scripting was implemented to atomically batch requests by token count, achieving up to a 50% reduction in GPU inference latency and a 3x reduction in GPU usage. MongoDB is integrating Voyage AI's embedding and reranking models into Atlas to deliver a truly native experience, simplifying developer workflows and enhancing accuracy, performance, and cost efficiency. This includes exploring multi-modal retrieval, instruction-tuned retrieval, domain-specific models, and easier model updates.

1 post · 2025

Timeline

20252026
Feature trailCooling

Resilience, Intelligence, and Simplicity in MongoDB Engineering

Introduced a new, safe, logless reconfiguration protocol for MongoDB replica sets, developed rapidly using TLA+ and model checking. This protocol minimizes changes to the existing gossip-based mechanism, enhances correctness guarantees by ensuring quorum overlap between configurations, and decouples reconfigurations from the main oplog, offering performance benefits. The process demonstrated the acceleration of design and delivery timelines through formal modeling.

1 post · 2025

Timeline

20252026
Feature trailCooling

Vector Representation Optimization

Introduced Matroyshka Representation Learning (MRL) to reduce the storage and compute costs of vector search systems. MRL allows for the use of lower-dimensional vector representations that approximate the similarity of full-fidelity representations, enabling a trade-off between cost and accuracy. This post demonstrates that using 512-dimensional vectors can achieve comparable retrieval accuracy to higher-dimensional vectors while significantly reducing storage and compute costs, achieving ~99% relative performance at a quarter of the storage and compute cost.

2 posts · 2025

Timeline

20252026
Feature trailCooling

MongoDB Performance Improvements

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 qu

2 posts · 2024–2025

Timeline

20242026
Feature trailCooling

Internal Release Candidate Dogfooding

MongoDB has adopted a rigorous internal dogfooding process for release candidates (RCs) across its production systems. This involves a cross-functional team of engineers and SREs upgrading critical internal clusters, such as the Evergreen CI system's databases, to RCs. This process proactively identifies and fixes bugs, including rare server crashes related to malformed TTL index specifications and performance regressions in the query executor, before customer release. The initiative has led to improved automated testing coverage and increased confidence in release stability.

1 post · 2025

Timeline

20252026
Feature trailCooling

Boolean Expression Simplification for Query Optimization

Introduced a Boolean expression simplification engine to improve MongoDB query performance. This engine leverages a modified Quine–McCluskey algorithm and Petrick's method, operating on an efficient bitset representation of Boolean expressions. The simplification process reduces computational overhead and enables the query optimizer to generate more efficient execution plans, leading to significant throughput improvements and reduced execution times for complex queries. The implementation also addresses MQL's unique logical semantics, including negation and handling of missing values, ensuring correctness and performance gains.

1 post · 2025

Timeline

20252026
Feature trailCooling

Silent Data Corruption Detection and Repair

Introduced software-level techniques for proactively detecting and repairing instances of silent data corruption in MongoDB Atlas. This includes monitoring for checksum failures, identifying corrupt documents using MongoDB indexes and replication, and repairing corruption by leveraging redundant replicas. The system utilizes a data plane and control plane architecture, with a MongoDB Agent in the data plane tailing logs for specific corruption-indicating patterns and reporting high-level metadata to the control plane for analysis and alerting.

1 post · 2024

Timeline

20242026