Expand description
RedDB Storage Engine
A page-based storage engine inspired by SQLite/Turso architecture. Implements 4KB aligned pages for efficient disk I/O with SIEVE caching.
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Database API │
├─────────────────────────────────────────────────────────────┤
│ B-Tree Engine │
├─────────────────────────────────────────────────────────────┤
│ Page Cache (SIEVE) │ Pager (I/O) │ Free List │
├─────────────────────────────────────────────────────────────┤
│ Page Structure │
├─────────────────────────────────────────────────────────────┤
│ File System / WAL │
└─────────────────────────────────────────────────────────────┘§References
- Turso
core/storage/pager.rs- Page I/O management - Turso
core/storage/page_cache.rs- SIEVE eviction algorithm - Turso
core/storage/btree.rs- B-tree page layout
Modules§
- algorithms
- Graph Algorithms for RedDB
- binary_
quantize - Binary Quantization for Vector Embeddings
- btree
- B+ Tree Implementation for Page-Based Storage
- bulk_
writer - Page-Based Bulk Writer — like PostgreSQL COPY FROM
- clustering
- Standalone vector clustering: K-Means and DBSCAN.
- crc32
- CRC32 checksum implementation (IEEE 802.3 polynomial)
- database
- RedDB Database Engine
- distance
- Distance Functions for Vector Operations
- encrypted_
pager - Encrypted Pager (deprecated wrapper).
- freelist
- Free Page List Management
- graph_
store - High-Performance Disk-Backed Graph Storage Engine
- graph_
table_ index - Bidirectional Graph-Table Index
- hnsw
- HNSW (Hierarchical Navigable Small World) Index
- hot_
update - HOT (Heap-Only Tuple) update decision — pure policy helper.
- hybrid
- Hybrid Search for RedDB
- int8_
quantize - int8 Quantization for Vector Embeddings
- ivf
- IVF (Inverted File Index) for Vector Search
- page
- Page structure for RedDB storage engine
- page_
cache - SIEVE Page Cache Implementation
- pager
- Pager - Page I/O Manager
- pathfinding
- Path Finding Algorithms for RedDB
- pq
- Product Quantization (PQ) for Vector Compression
- projection
- Graph Projections for RedDB
- simd_
distance - SIMD-Optimized Distance Functions
- store_
strategy - Triple Store Strategies
- tiered_
search - Tiered Vector Search Pipeline
- unified_
index - Unified Cross-Storage Index
- vector_
metadata - Vector Metadata Storage
- vector_
store - Vector Store
Structs§
- AStar
- A* Algorithm for heuristic-guided shortest paths
- AllPaths
Result - Result of all shortest paths query
- AllShortest
Paths - Find all shortest paths (same minimum length) between two nodes
- BFS
- Breadth-First Search for unweighted shortest paths
- BM25
Config - BM25 parameters
- BTree
- B+ Tree implementation
- BTree
Cursor - B+ Tree cursor for iteration
- Bellman
Ford - Bellman-Ford Algorithm for graphs with negative weights
- Bellman
Ford Result - Result of Bellman-Ford algorithm
- Betweenness
Centrality - Betweenness centrality computation using Brandes’ algorithm
- Betweenness
Result - Result of betweenness centrality computation
- Binary
Index - Index of binary vectors for fast batch search
- Binary
Search Result - Result from binary search with rescoring capability
- Binary
Vector - Binary quantized vector stored as packed u64 words
- Bitset
- Bitset for efficient filtering
- Closeness
Centrality - Closeness centrality measures how close a node is to all other nodes
- Closeness
Result - Result of closeness centrality computation
- Clustering
Coefficient - Local and global clustering coefficient
- Clustering
Result - Result of clustering coefficient computation
- Communities
Result - Result of community detection
- Community
- A community of nodes
- Component
- A connected component in the graph
- Components
Result - Result of connected components computation
- Connected
Components - Connected components finder
- Cross
Ref - Cross-reference between two storage elements
- Cycle
- A cycle in the graph
- Cycle
Detector - DFS-based cycle detection
- Cycles
Result - Result of cycle detection
- DFS
- Depth-First Search for deep graph exploration
- Database
- RedDB Database Engine
- Database
Config - Database configuration
- Degree
Centrality - Degree centrality measures node importance by connection count
- Degree
Centrality Result - Result of degree centrality computation
- Dijkstra
- Dijkstra’s Algorithm for weighted shortest paths
- Distance
- A distance value that can be compared and used in heaps
- Distance
Result - Result of a distance computation with an ID
- Edge
Filter - Edge filter specification
- Eigenvector
Centrality - Eigenvector centrality: importance based on neighbor importance
- Eigenvector
Result - Result of eigenvector centrality computation
- Encrypted
Pager Deprecated - Thin wrapper around
Pagerthat maps the legacyEncryptedPager::{read_page, write_page}calls onto the newPager::{read_page_decrypted, write_page_encrypted}surface. - Encrypted
Pager Config - Exact
Match Reranker - Simple re-ranker that boosts exact matches
- Free
List - In-memory freelist tracking
- Graph
Projection - A projected view of a graph
- Graph
Store - High-performance graph storage engine
- Graph
Table Index - Bidirectional index for graph-table linkage
- Graph
Table Index Stats - Statistics for GraphTableIndex
- HITS
- HITS algorithm: Identifies hubs and authorities
- HITS
Result - Result of HITS computation
- Hnsw
Config - HNSW index configuration parameters
- Hnsw
Index - HNSW Index for approximate nearest neighbor search
- Hnsw
Stats - Statistics about an HNSW index
- Hybrid
Query Builder - Builder for hybrid queries
- Hybrid
Result - Result from hybrid search
- Hybrid
Search - Hybrid search combining dense and sparse retrieval
- Int8
Index - Index of int8 vectors for batch operations
- Int8
Vector - int8 quantized vector with scale factor
- IvfConfig
- IVF configuration
- IvfIndex
- IVF Index for approximate nearest neighbor search
- IvfStats
- IVF index statistics
- KShortest
Paths - K-Shortest Paths using Yen’s Algorithm
- LabelId
- Densely-numbered identifier for a label string within a
LabelRegistry. - Label
Propagation - Label Propagation Algorithm for community detection
- Label
Registry - Bidirectional
label ↔ LabelIdcatalog with concurrent access. - Louvain
- Louvain algorithm for community detection
- Louvain
Result - Result of Louvain community detection
- Memory
Constraint - Memory constraint configuration for resource-limited systems
- Memory
Limit Error - Error returned when memory limit is reached
- Metadata
Entry - A metadata entry containing key-value pairs organized by type
- Metadata
Store - Metadata storage with inverted indexes for filtering
- Node
Filter - Node filter specification
- PQConfig
- PQ configuration
- PQIndex
- PQ-based index for compressed vector search
- Page
- A 4KB page with header and content
- Page
Cache - Sharded page cache.
- Page
Header - Page header structure (32 bytes)
- Page
Rank - PageRank algorithm for identifying critical nodes
- Page
Rank Result - Result of PageRank computation
- Pager
- Page I/O Manager
- Pager
Config - Pager configuration
- Path
- A path through the graph
- Personalized
Page Rank - Personalized PageRank - teleport only to specified seed nodes
- Physical
File Header - Minimal physical state published into page 0 for paged databases.
- Product
Quantizer - Product Quantizer
- Projected
Node - A projected node with minimal data for algorithms
- Projection
Builder - Builder for creating graph projections with fluent API
- Projection
Stats - Statistics about the projection
- Property
Projection - Specifies which properties to include in the projection
- Reranker
Pipeline - Re-ranking pipeline
- RowKey
- Composite key for row lookups: (table_id, row_id)
- SCCResult
- Result of SCC computation
- Search
Result - Result of a vector search
- Segment
Config - Configuration for vector segments
- Shortest
Path Result - Result of a shortest path query
- Sparse
Index - Sparse inverted index for keyword search
- Sparse
Result - Result from sparse search
- Stored
Edge - A graph edge stored on disk
- Stored
Node - A graph node stored on disk
- Strongly
Connected Components - Strongly connected components using Tarjan’s algorithm
- Table
Ref - Reference to a table row (for linking graph nodes to tabular data)
- Table
RowKey - Unique identifier for a row in a table
- Tiered
Index - Tiered vector index with binary, int8, and optional fp32 representations
- Tiered
Index Builder - Builder for creating tiered indexes with custom configuration
- Tiered
Memory Stats - Memory usage statistics for tiered index
- Tiered
Search Config - Configuration for tiered search
- Tiered
Search Result - Result from tiered search
- Triangle
Counting - Count triangles in the graph
- Triangle
Result - Result of triangle counting
- Unified
Index - Unified index for cross-storage lookups
- Unified
Index Stats - Statistics about the unified index
- Vector
Collection - Vector collection containing multiple segments
- Vector
Key - Unique identifier for a vector in a collection
- Vector
Segment - A vector segment containing vectors, metadata, and optional index
- Vector
Store - Multi-collection vector store
- WCCResult
- Result of weakly connected components
- Weakly
Connected Components - Weakly connected components - treats directed graph as undirected
Enums§
- Aggregation
Strategy - Strategy for aggregating parallel edges
- BTree
Error - B+ Tree error types
- Database
Error - Database error types
- Distance
Metric - Distance metric types supported by vector operations
- Encrypted
Pager Error - Errors emitted by the deprecated wrapper. Surface kept stable for
existing callers; new code should use
PagerErrordirectly. - Fusion
Method - Method for combining dense and sparse scores
- Metadata
Filter - Metadata filter operators
- Metadata
Value - A metadata value that can be one of several types
- Page
Type - Page type enumeration
- Segment
State - Segment state in its lifecycle
- Storage
Ref - A reference to any storage element
- Vector
Store Error - Vector store errors
Constants§
- HEADER_
SIZE - Header size in bytes
- PAGE_
SIZE - Page size in bytes (4KB, standard for most file systems)
Traits§
- Reranker
- Re-ranker for adjusting hybrid search results
Functions§
- cosine_
distance - Compute cosine distance between two vectors
- crc32
- Compute CRC32 checksum of data.
- dbsf_
fusion - Distribution-Based Score Fusion
- distance
- Compute distance between two vectors using the specified metric
- dot_
product - Compute dot product (inner product) between two vectors
- dot_
product_ i8_ f32_ simd - Compute dot product of i8 vector with f32 query (asymmetric)
- dot_
product_ i8_ simd - Compute dot product of two i8 vectors using SIMD
- hamming_
distance_ simd - Compute Hamming distance between two packed binary vectors using SIMD
- inner_
product_ distance - Compute inner product distance (negated for min-heap compatibility)
- l2
- Compute L2 (Euclidean) distance between two vectors
- l2_norm
- Compute the L2 norm (magnitude) of a vector
- l2_
squared - Compute L2 (Euclidean) squared distance between two vectors
- linear_
fusion - Linear combination of scores
- normalize
- Normalize a vector to unit length (in-place)
- normalized
- Create a normalized copy of a vector
- reciprocal_
rank_ fusion - Reciprocal Rank Fusion