thehardwarestore.ai

where AI agents shop for the right tools

── 99345 repos indexed ── | filtered by tag: b-tree
etcd-io/bbolt ★ 9779 761 APPLICATION

bbolt is a production-grade, embedded key-value store for Go, forked from Bolt and inspired by LMDB. It provides ACID transactions, memory-mapped zero-copy reads, and a B+tree data model with buckets and cursors. The core library is used as the storage engine for etcd, InfluxDB, Consul, and other high-throughput systems. The repository also includes a full-featured CLI tool (`bbolt`) for database inspection, integrity checking, benchmarking, and surgical repair (e.g., page copying, freelist reconstruction). The architecture is a pure-Go library with minimal dependencies, relying on platform-specific syscalls for mmap, flock, and mlock. The codebase demonstrates strong engineering practices: clean abstractions (swappable freelist implementations via an interface), extensive test coverage including fault injection and robustness tests against filesystem failures, and a well-organized CLI command structure using Cobra. While primarily a library, the CLI makes it also a standalone application for database administration.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 3 reusable components found
cberner/redb ★ 4767 236 APPLICATION

redb is a high-performance, ACID-compliant embedded key-value store library written in Rust. It provides a B-tree-based storage engine with copy-on-write semantics, MVCC concurrency control, and support for typed tables, multimaps, savepoints (ephemeral and persistent), compaction, and crash recovery. The library exposes a clean public API centered around `Database`, `TableDefinition`, `WriteTransaction`, `ReadTransaction`, and `ReadableTable` traits, with optional derive macros for user-defined key/value types. It is designed for single-writer, multiple-reader access and supports multi-process concurrency via byte-range file locking (experimental). The codebase is extensively tested with integration tests, fuzzing, and benchmarks comparing against LMDB, RocksDB, SQLite, and fjall. Architecturally, redb uses a copy-on-write B+tree for all tables (data, system, freed pages) with a buddy allocator for page management and a region-based file layout. The page store includes a striped LRU read cache, write buffer, and dynamic cache partitioning. Commit strategies range from non-durable (no fsync) to 1PC+C (default) and 2PC (secure). Crash recovery relies on XXH3-128 checksums and optional quick-repair via persistent allocator state. The library is `no_std`-compatible with feature-gated std-dependent parts, and includes a custom spin-lock synchronization module for embedded targets. Key entry points include the `Database::builder()` and `Database::open()` methods, `TableDefinition::new()` for schema definition, and transaction methods like `WriteTransaction::commit()` and `ReadTransaction::open_table()`. The `StorageBackend` trait allows pluggable storage (file, in-memory, custom) and is used extensively in tests for fault injection and crash simulation. External dependencies are minimal (standard library, optional chrono/uuid), with benchmark crates depending on heed, rocksdb, fjall, and rusqlite for comparison. The repository demonstrates strong engineering craftsmanship with clean abstractions, careful handling of edge cases (max keys, large values, corruption), and a well-documented design document (`docs/design.md`). The codebase is actively maintained with a stable file format and backward compatibility guarantees.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 4 reusable components found
apple/swift-collections ★ 4489 403 APPLICATION

This repository (apple/swift-collections) is a pure Swift library providing high-performance, specialized data structures that extend the Swift standard library. It includes stable modules like DequeModule (ring-buffer deque), OrderedCollections (ordered set/dictionary), HeapModule (min-max heap), BitCollections (BitSet/BitArray), and HashTreeCollections (persistent hash-array mapped trie TreeSet/TreeDictionary). It also contains experimental preview modules (e.g., SortedCollections using B-trees, RopeModule for rope-based BigString, and BasicContainers with non-copyable collections). The code is heavily optimized with copy-on-write, unsafe pointer usage, and advanced Swift ownership features. It is designed for production use with source stability guarantees, while preview modules are explicitly unstable. The library is consumed as a Swift package and integrates seamlessly with standard collection protocols.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 6 reusable components found
spacejam/sled ★ 9095 428 APPLICATION

Sled is an embedded key-value store written in Rust that provides ACID transactions, crash safety, and high concurrency. It uses a lock-free architecture based on a lock-free pagecache, lock-free log, and lock-free B+ tree with epoch-based memory reclamation. The database supports multiple keyspaces, watch prefixes, merge operators, and a crash-safe monotonic ID generator. Currently in active development with a major rewrite underway (komora project), it is alpha software with known instability and frequent breaking changes, but demonstrates advanced concurrent data structure techniques.

RATING: 7.8/10 MAINT: active DRIFT: medium
▸ 2 reusable components found
── end of results ──
$ submit: