WriteOptions Class

Definition

Namespace: RocksDbSharp

public class WriteOptions

WriteOptions controls durability and WAL behaviour for a single Put, Merge, Remove, or Write call.

Remarks

The setters are fluent and return the same WriteOptions. Passing null (or omitting the parameter) uses a fresh default WriteOptions. For knobs not exposed on this class — ignore_missing_column_families, no_slowdown, low_pri — drop down to the native layer and call the matching rocksdb_writeoptions_* setter on the Handle. See Read & Write Options.

Methods

Name Description
SetSync(bool) Blocks until the WAL is fsynced.
DisableWal(int) Skips the WAL entirely for the write.

SetSync

public WriteOptions SetSync(bool value)

When true, the write blocks until the WAL is fsynced. Far slower, much safer on crash. The cost is per fsync, not per key, so batch many keys into one WriteBatch and sync that instead of syncing each Put.

DisableWal

public WriteOptions DisableWal(int disable)

When 1, skips the WAL entirely for this write. Faster but not crash-safe — WAL-skipped writes are only durable once the next MemTable flush hits disk. Use only for ephemeral or recomputable data.

Applies to

RocksDbSharp — see Read & Write Options for durability guidance and examples.

© 2026 Curiosity. All rights reserved.