Skip to content

Recipes

Common patterns and practical examples for using nori-sstable.


Overview

This section provides practical, copy-paste-ready examples for common SSTable use cases.

Recipes

Basic Usage

Building and reading your first SSTable with complete error handling.

Hot Workloads

Optimizing for high-throughput, cache-friendly workloads.


Quick Examples

Minimal Example

let mut builder = SSTableBuilder::new(config).await?;
builder.add(&Entry::put("key", "value")).await?;
builder.finish().await?;

With Compression

let config = SSTableConfig {
    compression: Compression::Lz4,
    ..Default::default()
};

With Custom Cache

let reader = SSTableReader::open_with_config(
    path,
    Arc::new(NoopMeter),
    256  // 256MB cache
).await?;