Liking cljdoc? Tell your friends :D

Disk-Based Trie Data Structures

This documentation series provides a comprehensive, pedagogical introduction to disk-based trie data structures, culminating in the design of the Persistent Adaptive Radix Trie (PART) - a hybrid structure combining the Adaptive Radix Tree (ART) with B-trie-style bucket storage.

Motivation

When dictionaries exceed available RAM, we need data structures that efficiently manage data on secondary storage (SSD/HDD). Traditional in-memory tries waste space and incur excessive I/O when naively persisted to disk. This series explores specialized techniques for building tries that minimize disk I/O while maintaining fast lookup and update operations.

Document Organization

The documents are numbered to indicate the recommended reading order:

DocumentTopicPrerequisites
01-foundationsTrie basics and disk I/O fundamentalsNone
02-b-trieB-trie architecture (Askitis & Zobel 2009)01
03-adaptive-radix-treeAdaptive Radix Tree theory (Leis et al. 2013)01
04-persistent-artDisk persistence with pointer swizzling01, 03
05-buffer-managementPage cache, WAL, and crash recovery01
06-persistent-artrie-designOur hybrid PART designAll previous
07-benchmark-resultsMeasured throughput, recovery, and checkpoint costs06

Reading Paths

Depending on your background and goals, consider these reading paths:

For Newcomers to Disk-Based Data Structures

Read all documents in order: 01 → 02 → 03 → 04 → 05 → 06

For Those Familiar with B-trees but New to Tries

Start with 01 (trie foundations), then 02 (B-trie), then 06 (design summary)

For Implementers

Focus on 04 (persistence techniques), 05 (buffer management), and 06 (final design)

Quick Reference

Jump directly to 06 for a summary of the final design with references back to detailed explanations

Key Concepts Quick Reference

Data Structures

StructureDescriptionBest For
B-trieDisk-based burst trie with bucketsBalanced read/write, space efficiency
ARTAdaptive Radix Tree with Node4/16/48/256Low-latency lookups, SIMD acceleration
PARTPersistent ART + B-trie bucketsOur hybrid combining both strengths

Storage Techniques

TechniquePurpose
Pointer SwizzlingDual memory/disk addressing in single 64-bit pointer
Buffer ManagerPage cache with LRU eviction and pinning
Write-Ahead Log (WAL)Crash recovery through operation logging
Path CompressionReduce tree height by collapsing single-child chains

Complexity Summary

For the Persistent ARTrie design:

OperationTime ComplexityDisk I/Os
Exact lookup$O(m)$2-4 (typical)
Insert$O(m + \log B)$ amortized2-4 + 1 write
Prefix search$O(m + k)$Depends on $k$
Levenshtein ($d = 1, 2$)$O(n\cdot m\cdot d^2)$Varies with pruning

Where: $n$ = query (input) length, $m$ = term length, $B$ = bucket size (~100–500), $k$ = result count

References

Primary sources underlying this documentation:

  1. B-tries for disk-based string management Askitis, N. & Zobel, J. (2009). The VLDB Journal, 18(1), 157-179. DOI: 10.1007/s00778-008-0094-1

  2. The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases Leis, V., Kemper, A., & Neumann, T. (2013). ICDE. DOI: 10.1109/ICDE.2013.6544812 · PDF

  3. Persistent Storage of Adaptive Radix Trees in DuckDB DuckDB Team (2022). Blog Post

  4. SMART: A High-Performance Adaptive Radix Tree for Disaggregated Memory Luo, X. et al. (2023). OSDI. PDF

  5. HOT: A Height Optimized Trie Index for Main-Memory Database Systems Binna, R. et al. (2018). SIGMOD. DOI: 10.1145/3183713.3196896 · PDF

Related Documentation

  • Persistence architecture corpus - the systems-tier implementation of the PART design summarized in 06/07: the lock-free overlay, storage backends, WAL format, durability/recovery, concurrency model, and eviction, each documented end to end.
  • SCDAWG Theory - Symmetric Compact Directed Acyclic Word Graph
  • Levenshtein Automata - Fuzzy string matching algorithms

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close