ZoneTree documentation
Add ordered, persistent storage to your .NET application. Open your first tree, design keys around your queries, and choose how your data reaches disk.
- One tree, one keyspace
- Your comparer defines key order. Iterators seek and scan that order in either direction.
- Runs inside your process
- Read and write through C# APIs. Persistent data lives in a directory you choose.
- Your application's data model
- Build secondary indexes, queues, or event stores by choosing keys and coordinating writes.
Your first tree
C# / .NETdotnet add package ZoneTree using ZoneTree;
using var tree = new ZoneTreeFactory<int, string>()
.SetDataDirectory("data/my-tree")
.OpenOrCreate();
using var maintainer = tree.CreateMaintainer();
tree.Upsert(42, "Hello ZoneTree");
if (tree.TryGet(42, out var value))
Console.WriteLine(value); Keep the maintainer alive with the tree to schedule background merges and clean inactive caches. Background maintenance
From a working example to a reliable system.
New to the engine? Follow these three guides in order.
Use a tree
Install the package, open a data directory, write a record, and scan a range. Learn when to create and dispose the tree, maintainer, and iterators.
Run the first-tree exampleFollow the data
See how mutable memory, read-only segments, compaction, and disk parts work together. Use that model to understand writes, reads, and maintenance.
LSM-tree architectureLogging, recovery, and backups
Compare WAL modes, inspect recovery diagnostics, and create and restore backup generations.
Durability guidesWhat are you working on?
Jump to the API, design decision, or operational task in front of you.
Read, write & coordinate
Choose the right operation, from a single key to a multi-key transaction.
Design keys & queries
Make the key layout serve your lookups, ordered scans, and indexes.
Keep data recoverable
Define the durability boundary and how you will recover persistent data.
Storage costs
Work out what drives disk reads, rewrite work, and memory use.
Maintenance
Background merges, bottom-segment compaction, and inactive-cache cleanup.
Partitioning & replication
Connect local trees to partition ownership, replication, and replica seeding.