Post by MongoDB

921,758 followers

Scaling B+tree performance on modern, multi-core hardware means dealing with the limits of traditional locking. As contention increases, locks become the bottleneck, forcing operations to serialize and leaving CPUs underutilized. To solve this in MongoDB's WiredTiger storage engine, we engineered a lock-free B+tree architecture using two key techniques: ⚡ Hazard pointers for coordinating lock-free reads with cache management ⚡ Lock-free skip lists to enable concurrent, non-blocking page updates The results (benchmarked on AWS m7g.4xlarge): - Pure reads: +47% throughput (1.7M → 2.5M ops/sec) - High-contention writes: 3.9x throughput (320K → 1.26M ops/sec) - Mixed workloads: +53% insert, +37% read performance Our Senior Staff Engineer Alex Gorrod breaks down the implementation challenges, algorithm choices, and benchmarking methodology. Read the full breakdown on our engineering blog → https://lnkd.in/gsvcUKD6

Post contentPost contentPost content