Open-Source Wikis

/

MongoDB

/

Fun facts

mongodb/mongo

Fun facts

A handful of curiosities collected from poking at the source.

Oldest surviving code

The repository's first commit is e73188b5512 from 2007-10-19, with the message "first commit". Two days later came "made compile in linux" and "use constant" — the project was bootstrapped as a Mac-native experiment and only later made portable. Files in src/mongo/bson/ and src/mongo/util/ carry direct lineage from that early period, though every line has been refactored many times.

The size of transaction_router_test.cpp

The single largest source file in the repository is src/mongo/s/transaction_router_test.cpp at roughly 13,000 lines and 350 KB. It exhaustively exercises the cluster transaction protocol — every interleaving of commit, abort, retry, network error, primary failover, and snapshot timestamp negotiation. Reading it is one of the better ways to understand sharded transactions, but it is not for the faint of heart.

The longest BUILD file

src/mongo/db/BUILD.bazel is 120 KB of Bazel — by far the longest build file in the project. It reflects the breadth of src/mongo/db/, which contains 40+ subdirectories spanning replication, sharding, query, storage, transactions, the op observer, time-series, the global catalog, and more.

A comment about commands

src/mongo/db/commands.cpp is a 1,800-line file that hosts the registry, dispatch glue, and validation for every wire-protocol command. The file is so old that traces of the pre-OP_MSG world still appear in its API shape: it carries explicit hooks for "shoehorn" generic argument extraction, retryable writes, profiling, audit, error labels, and CSI metadata propagation, all wired up at the dispatch boundary.

The poetry lock

The Python dependency tree — pinned in poetry.lock — is ~459,000 bytes. The build, lint, and test infrastructure under buildscripts/ is large enough that pinning every transitive dependency creates a half-megabyte file.

The build module lock

The Bazel module lock file MODULE.bazel.lock clocks in at ~125,000 bytes and pins every external Bazel dependency seen during resolution. The Bazel migration (2023–2024) is the largest mechanical change to the repository in its history.

TLA+ alongside C++

The project keeps formal specifications under src/mongo/tla_plus/ — TLA+ models of the replication and transaction protocols. The presence of TLA+ alongside the C++ source is unusual for an open-source database.

The naming of mongos

mongos ("MongoDB shard") is pronounced "mongo-s", not "mongoose". This is a frequent source of confusion among newcomers and a recurring topic in the test logs.

The TLA in mongo

The first three letters of "MongoDB" come from "humongous" — the database was named for its target scale rather than for any zoological mascot. The leaf logo in docs/leaf.svg came later.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Fun facts – MongoDB wiki | Factory