Skip to main content

Module engine

Module engine 

Source
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

Re-exports§

pub use btree::BTree;
pub use btree::BTreeCursor;
pub use btree::BTreeError;
pub use crc32::crc32;
pub use database::Database;
pub use database::DatabaseConfig;
pub use database::DatabaseError;
pub use encrypted_pager::EncryptedPager;Deprecated
pub use encrypted_pager::EncryptedPagerConfig;
pub use encrypted_pager::EncryptedPagerError;
pub use freelist::FreeList;
pub use graph_store::GraphStore;
pub use graph_store::LabelId;
pub use graph_store::LabelRegistry;
pub use graph_store::StoredEdge;
pub use graph_store::StoredNode;
pub use graph_store::TableRef;
pub use graph_table_index::GraphTableIndex;
pub use graph_table_index::GraphTableIndexStats;
pub use graph_table_index::RowKey;
pub use page::Page;
pub use page::PageHeader;
pub use page::PageType;
pub use page::HEADER_SIZE;
pub use page::PAGE_SIZE;
pub use page_cache::PageCache;
pub use pager::Pager;
pub use pager::PagerConfig;
pub use pager::PhysicalFileHeader;
pub use algorithms::BetweennessCentrality;
pub use algorithms::BetweennessResult;
pub use algorithms::ClosenessCentrality;
pub use algorithms::ClosenessResult;
pub use algorithms::ClusteringCoefficient;
pub use algorithms::ClusteringResult;
pub use algorithms::CommunitiesResult;
pub use algorithms::Community;
pub use algorithms::Component;
pub use algorithms::ComponentsResult;
pub use algorithms::ConnectedComponents;
pub use algorithms::Cycle;
pub use algorithms::CycleDetector;
pub use algorithms::CyclesResult;
pub use algorithms::DegreeCentrality;
pub use algorithms::DegreeCentralityResult;
pub use algorithms::EigenvectorCentrality;
pub use algorithms::EigenvectorResult;
pub use algorithms::HITSResult;
pub use algorithms::LabelPropagation;
pub use algorithms::Louvain;
pub use algorithms::LouvainResult;
pub use algorithms::PageRank;
pub use algorithms::PageRankResult;
pub use algorithms::PersonalizedPageRank;
pub use algorithms::SCCResult;
pub use algorithms::StronglyConnectedComponents;
pub use algorithms::TriangleCounting;
pub use algorithms::TriangleResult;
pub use algorithms::WCCResult;
pub use algorithms::WeaklyConnectedComponents;
pub use algorithms::HITS;
pub use pathfinding::AStar;
pub use pathfinding::AllPathsResult;
pub use pathfinding::AllShortestPaths;
pub use pathfinding::BellmanFord;
pub use pathfinding::BellmanFordResult;
pub use pathfinding::Dijkstra;
pub use pathfinding::KShortestPaths;
pub use pathfinding::Path;
pub use pathfinding::ShortestPathResult;
pub use pathfinding::BFS;
pub use pathfinding::DFS;
pub use distance::cosine_distance;
pub use distance::distance;
pub use distance::dot_product;
pub use distance::inner_product_distance;
pub use distance::l2;
pub use distance::l2_norm;
pub use distance::l2_squared;
pub use distance::normalize;
pub use distance::normalized;
pub use distance::Distance;
pub use distance::DistanceMetric;
pub use distance::DistanceResult;
pub use hnsw::Bitset;
pub use hnsw::HnswConfig;
pub use hnsw::HnswIndex;
pub use hnsw::HnswStats;
pub use hnsw::NodeId;
pub use vector_metadata::MetadataEntry;
pub use vector_metadata::MetadataFilter;
pub use vector_metadata::MetadataStore;
pub use vector_metadata::MetadataValue;
pub use vector_store::SearchResult;
pub use vector_store::SegmentConfig;
pub use vector_store::SegmentId;
pub use vector_store::SegmentState;
pub use vector_store::VectorCollection;
pub use vector_store::VectorId;
pub use vector_store::VectorSegment;
pub use vector_store::VectorStore;
pub use vector_store::VectorStoreError;
pub use unified_index::CrossRef;
pub use unified_index::RowKey as TableRowKey;
pub use unified_index::StorageRef;
pub use unified_index::UnifiedIndex;
pub use unified_index::UnifiedIndexStats;
pub use unified_index::VectorKey;
pub use projection::AggregationStrategy;
pub use projection::EdgeFilter;
pub use projection::GraphProjection;
pub use projection::NodeFilter;
pub use projection::ProjectedNode;
pub use projection::ProjectionBuilder;
pub use projection::ProjectionStats;
pub use projection::PropertyProjection;
pub use hybrid::dbsf_fusion;
pub use hybrid::linear_fusion;
pub use hybrid::reciprocal_rank_fusion;
pub use hybrid::BM25Config;
pub use hybrid::ExactMatchReranker;
pub use hybrid::FusionMethod;
pub use hybrid::HybridQueryBuilder;
pub use hybrid::HybridResult;
pub use hybrid::HybridSearch;
pub use hybrid::Reranker;
pub use hybrid::RerankerPipeline;
pub use hybrid::SparseIndex;
pub use hybrid::SparseResult;
pub use ivf::IvfConfig;
pub use ivf::IvfIndex;
pub use ivf::IvfStats;
pub use pq::PQCode;
pub use pq::PQConfig;
pub use pq::PQIndex;
pub use pq::ProductQuantizer;
pub use binary_quantize::hamming_distance_simd;
pub use binary_quantize::BinaryIndex;
pub use binary_quantize::BinarySearchResult;
pub use binary_quantize::BinaryVector;
pub use int8_quantize::dot_product_i8_f32_simd;
pub use int8_quantize::dot_product_i8_simd;
pub use int8_quantize::Int8Index;
pub use int8_quantize::Int8Vector;
pub use tiered_search::MemoryConstraint;
pub use tiered_search::MemoryLimitError;
pub use tiered_search::TieredIndex;
pub use tiered_search::TieredIndexBuilder;
pub use tiered_search::TieredMemoryStats;
pub use tiered_search::TieredSearchConfig;
pub use tiered_search::TieredSearchResult;

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