# spacejam/sled

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/spacejam-sled).**

8,928 stars · 417 forks · Rust · apache-2.0

## Links

- GitHub: https://github.com/spacejam/sled
- awesome-repositories: https://awesome-repositories.com/repository/spacejam-sled.md

## Topics

`b-plus-tree` `b-tree` `concurrent` `crash-testing` `database` `embedded-kv` `formal-methods` `fuzzing` `high-performance` `incredibly-spicy` `kv` `lock-free` `log-structured` `orm` `persistence` `rust` `sled` `tree`

## Description

Sled is an embedded key-value store and ACID-compliant database designed for high-performance data persistence. It functions as a log-structured storage engine that organizes data using B+ trees to support efficient range queries and prefix scans.

The engine implements a zero-copy data store model, utilizing epoch-based reclamation to provide direct references to cached values without memory allocations. It distinguishes itself through a combination of write-ahead logging, page cache optimizations to reduce write amplification on flash storage, and serializable transactions for atomic multi-key updates.

The library covers a broad range of capabilities, including crash recovery through checkpointing, disk storage defragmentation, and binary stream replication. It also provides reactive data observation via key-prefix event subscriptions and supports custom merge logic for atomic value transformations.

## Tags

### Data & Databases

- [Key-Value](https://awesome-repositories.com/f/data-databases/storage-engines/key-value.md) — Functions as a high-performance embedded key-value store supporting atomic updates and conditional modifications. ([source](https://docs.rs/sled/latest/sled/struct.Db.html))
- [ACID Transactional Cores](https://awesome-repositories.com/f/data-databases/acid-transactional-cores.md) — Provides an ACID-compliant core for atomic and isolated multi-key transaction processing.
- [Database Atomic Batches](https://awesome-repositories.com/f/data-databases/bulk-data-operations/atomic-batch-operations/database-atomic-batches.md) — Groups multiple database mutations into a single atomic operation to ensure consistency. ([source](https://docs.rs/sled))
- [Write Persistence Guarantees](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-persistence-management/write-persistence-guarantees.md) — Guarantees data persistence by flushing dirty IO buffers to disk synchronously or asynchronously. ([source](https://docs.rs/sled/latest/sled/struct.Db.html))
- [Zero-Copy Memory Mappings](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage-architectures/zero-copy-memory-mappings.md) — Provides direct references to cached values using epoch-based reclamation to eliminate memory allocations during reads. ([source](https://github.com/spacejam/sled/wiki/sled-architectural-outlook))
- [High-Performance Persistence Layers](https://awesome-repositories.com/f/data-databases/high-performance-persistence-layers.md) — Writes structured binary data to stable storage with specific optimizations for flash memory and crash recovery.
- [Key-Value Stores](https://awesome-repositories.com/f/data-databases/key-value-stores.md) — Provides a high-performance, disk-backed embedded key-value store for byte arrays.
- [B-Tree](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree.md) — Implements a B+ Tree indexing structure to enable efficient range-based scans and fast key lookups.
- [Log-Structured Merge-Trees](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree/log-structured-merge-trees.md) — Utilizes a log-structured merge-tree architecture to optimize write throughput and read performance.
- [Cursor-based Iterators](https://awesome-repositories.com/f/data-databases/storage-engines/cursor-based-iterators.md) — Implements cursor-based iterators for memory-efficient record-by-record processing of the database. ([source](https://docs.rs/sled/latest/sled/struct.Tree.html))
- [Strict Serializability](https://awesome-repositories.com/f/data-databases/strict-serializability.md) — Ensures serializable transaction isolation for atomic multi-key updates across different data trees.
- [Strict Serializability](https://awesome-repositories.com/f/data-databases/strict-serializability/strict-serializability.md) — Ensures absolute consistency through serializable transactions across multiple data trees. ([source](https://github.com/spacejam/sled/wiki/sled-architectural-outlook))
- [Log State Recovery](https://awesome-repositories.com/f/data-databases/undo-logs/transaction-recovery-logs/log-state-recovery.md) — Reconstructs database state by applying log segments to snapshots for reliable crash recovery. ([source](https://github.com/spacejam/sled/wiki/sled-architectural-outlook))
- [Write-Ahead Logging](https://awesome-repositories.com/f/data-databases/write-ahead-logging.md) — Uses write-ahead logging to record every mutation to a persistent log for guaranteed crash recovery.
- [Log-Structured Storage Engines](https://awesome-repositories.com/f/data-databases/write-ahead-logging/log-structured-storage-engines.md) — Implements a log-structured storage engine using write-ahead logging and page caches for high write throughput.
- [Zero-Copy Data Access](https://awesome-repositories.com/f/data-databases/zero-copy-data-access.md) — Provides zero-copy data access by returning direct references to cached values using epoch-based reclamation.
- [Storage Key Observation](https://awesome-repositories.com/f/data-databases/client-side-storage/storage-key-observation.md) — Monitors specific key prefixes to trigger reactive events when records are updated.
- [Conditional Updates](https://awesome-repositories.com/f/data-databases/conditional-updates.md) — Allows modifying or deleting a value only if the current value matches a specific expected state. ([source](https://docs.rs/sled/latest/sled/struct.Tree.html))
- [Keyspace Isolation](https://awesome-repositories.com/f/data-databases/data-collections-datasets/collection-lifecycle-management/keyspace-isolation.md) — Supports creating and removing disk-backed trees to isolate different keyspaces within a single database. ([source](https://docs.rs/sled/latest/sled/struct.Db.html))
- [Epoch-Based Reclamation](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage-architectures/zero-copy-memory-mappings/epoch-based-reclamation.md) — Uses epoch-based reclamation to provide zero-copy reads without immediate memory allocations.
- [Data Replication](https://awesome-repositories.com/f/data-databases/data-replication.md) — Implements binary stream replication to synchronize data and tree updates across distributed nodes. ([source](https://github.com/spacejam/sled/wiki/sled-architectural-outlook))
- [Atomic Key-Value Operations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-engines/nosql/key-value-stores/atomic-key-value-operations.md) — Supports atomic key-value operations that execute read-modify-write cycles as single, indivisible units. ([source](https://docs.rs/sled/latest/sled/struct.Tree.html))
- [Disk Defragmentation](https://awesome-repositories.com/f/data-databases/disk-defragmentation.md) — Reclaims disk space and reduces fragmentation by moving live pages from underutilized segments. ([source](https://github.com/spacejam/sled/wiki/sled-architectural-outlook))
- [Change Notifications](https://awesome-repositories.com/f/data-databases/key-value-pair-managers/prefix-based-scanning/change-notifications.md) — Provides reactive data observation via key-prefix event subscriptions to trigger actions when records are updated. ([source](https://docs.rs/sled))
- [Key Deletion](https://awesome-repositories.com/f/data-databases/key-value-stores/key-deletion.md) — Provides capabilities for removing values from the database by their unique keys. ([source](https://docs.rs/sled/latest/sled/struct.Tree.html))
- [Custom Value Merging](https://awesome-repositories.com/f/data-databases/storage-engines/key-value/custom-value-merging.md) — Provides a custom merge operator to execute read-modify-write logic directly during the write process.
- [Record Compression](https://awesome-repositories.com/f/data-databases/storage-engines/key-value/record-compression.md) — Reduces the storage footprint of the database by applying high-efficiency compression to stored records. ([source](https://cdn.jsdelivr.net/gh/spacejam/sled@main/README.md))
- [Storage Space Optimization](https://awesome-repositories.com/f/data-databases/storage-space-optimization.md) — Implements disk defragmentation and page cache optimizations to reduce write amplification on flash storage.

### Operating Systems & Systems Programming

- [Database Page Caching](https://awesome-repositories.com/f/operating-systems-systems-programming/paged-memory-management/database-page-caching.md) — Implements database page caching to store data fragments in memory and reduce write amplification on flash storage.

### Part of an Awesome List

- [Databases](https://awesome-repositories.com/f/awesome-lists/data/databases.md) — Embedded database with lock-free concurrency.
