This post discusses practical challenges in implementing thread-safe concurrent B+Tree using crab latching, a fine-grained concurrency protocol that uses readers/writer latches on nodes. The author explains how top-down latch ordering prevents deadlocks when multiple threads access the tree concurrently, and demonstrates a deadlock scenario that occurs without proper ordering.
ChaosTree is a high-performance Java library providing cache-aware implementations of NavigableMap and NavigableSet using AVL, Red-Black, B, and B+ Trees. It offers significantly faster sequential insertion (168x faster than JDK), reduced memory allocation, and zero garbage collection pauses compared to standard Java collections, with comprehensive testing via Guava Testlib, property-based fuzzing, and differential testing.
This article explains how inverted indexes power full-text search in databases like Postgres. Unlike b-trees that work on entire column values, inverted indexes map individual words to document locations, enabling efficient searches for terms anywhere in text fields. The index consists of a term dictionary and postings lists that store compressed document identifiers.