Skip to main content

Module sled_backend

Module sled_backend 

Source
Expand description

Sled embedded database storage backend

This module provides a production-ready implementation of the Storage and KeyValueStorage traits using the Sled embedded database. Sled is a high-performance, log-structured merge tree (LSM) based embedded database that provides ACID guarantees through compare-and-swap operations.

§Features

  • Embedded database with no external dependencies
  • ACID transactions with compare-and-swap
  • Prefix scanning and range queries
  • Automatic compaction and cleanup
  • Crash-safe with write-ahead logging
  • Compression support
  • Thread-safe operations
  • Zero-copy reads where possible

§Architecture

The backend uses separate Sled trees for each table, with a metadata tree for statistics and versioning. All operations are wrapped to provide async interfaces while Sled itself operates synchronously.

Structs§

SledStorage
Sled storage backend implementation