ZoneTree 1.0.0
Prefix ReservedSee the version list below for details.
dotnet add package ZoneTree --version 1.0.0
NuGet\Install-Package ZoneTree -Version 1.0.0
<PackageReference Include="ZoneTree" Version="1.0.0" />
<PackageVersion Include="ZoneTree" Version="1.0.0" />
<PackageReference Include="ZoneTree" />
paket add ZoneTree --version 1.0.0
#r "nuget: ZoneTree, 1.0.0"
#:package ZoneTree@1.0.0
#addin nuget:?package=ZoneTree&version=1.0.0
#tool nuget:?package=ZoneTree&version=1.0.0
ZoneTree
ZoneTree is a persistent, high-performance key-value database for .NET. It can operate in memory or on disk. (Optimized for SSDs)
ZoneTree is a fast and high-performance LSM Tree for .NET.
LSM Tree (Log-structured merge-tree) is the most popular data structure and it is being used by many popular databases internally.
Why ZoneTree?
- It is pure C#. Easy to maintain, easy to develop new features.
- It is faster than using C/C++ based key-value stores like RocksDB. Because ZoneTree does not need to transfer bytes to the native external libraries (Zero Marshaling).
- .NET EcoSystem does not have any feature-complete and thread-safe LSM Tree that operates both in memory and on disk.
How fast is it?
2 Million int key and int value inserts in 7 seconds. (Config: 1M mutable segment size, 2M readonly segments merge-threshold)
20 Million int key and int value inserts in 73 seconds. (Config: 1M mutable segment size, 2M readonly segments merge-threshold)
20 Million int key and int value reads in 16 seconds. (Config: 1M mutable segment size, 2M readonly segments merge-threshold)
Doing database benchmark is tough. A proper and fair performance analysis requires a lot of work.
For now, we are confident that ZoneTree is fast enough to be used in production.
How to use ZoneTree?
The following sample demonstrates creating a database.
var dataPath = "data/mydatabase";
var walPath = "data/mydatabase/wal";
using var zoneTree = new ZoneTreeFactory<int, string>()
.SetComparer(new IntegerComparerAscending())
.SetDataDirectory(dataPath)
.SetWriteAheadLogDirectory(walPath)
.SetKeySerializer(new Int32Serializer())
.SetValueSerializer(new Utf8StringSerializer())
.OpenOrCreate();
// upsert a key-value pair.
zoneTree.Upsert(39, "Hello Zone Tree!");
// atomically update a record in database. (thread-safe)
zoneTree.TryAddOrUpdateAtomic(39, "a", (x) => x + "b");
How to maintain LSM Tree?
Big LSM Trees require maintenance tasks. ZoneTree provides the IZoneTreeMaintenance interface to give you full power on maintenance tasks. It also comes with a default maintainer to let you focus on your business logic without wasting time with LSM details. You can start using the default maintainer like in the following sample code. Note: For small data you don't need a maintainer.
var dataPath = "data/mydatabase";
var walPath = "data/mydatabase/wal";
// 1. Create your ZoneTree
using var zoneTree = new ZoneTreeFactory<int, string>()
.SetComparer(new IntegerComparerAscending())
.SetDataDirectory(dataPath)
.SetWriteAheadLogDirectory(walPath)
.SetKeySerializer(new Int32Serializer())
.SetValueSerializer(new Utf8StringSerializer())
.OpenOrCreate();
using var maintainer = new BasicZoneTreeMaintainer<int, string>(zoneTree);
// 2. Read/Write data
zoneTree.Upsert(39, "Hello ZoneTree!");
// 3. Complete maintainer running tasks.
maintainer.CompleteRunningTasks().AsTask().Wait();
I need more information. Where can I find it?
I am going to write more detailed documentation as soon as possible.
I want to contribute. What should I do?
I appreciate any contribution to the project. These are the things I do think we need at the moment:
- Write tests / benchmarks.
- Write documentation.
- Convert documentation to a website using static site generators.
- Feature requests & bug fixes.
- Performance improvements.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on ZoneTree:
| Package | Downloads |
|---|---|
|
DifferentialComputeDotNet.Core
Package Description |
|
|
ZoneTree.FullTextSearch
ZoneTree.FullTextSearch is an open-source library that extends ZoneTree to provide efficient full-text search capabilities. It offers a fast, embedded search engine suitable for applications that require high performance and do not rely on external databases. |
|
|
ManagedCode.Database.ZoneTree
Repository for ZoneTree |
|
|
ManagedCode.ZoneTree.BlobFileSystem
Azure Blob FileSystem for ZoneTree |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.8.6 | 6,790 | 6/14/2025 |
| 1.8.5 | 11,063 | 1/18/2025 |
| 1.8.4 | 978 | 11/14/2024 |
| 1.8.3 | 476 | 10/16/2024 |
| 1.8.2 | 2,096 | 9/7/2024 |
| 1.8.1 | 282 | 9/7/2024 |
| 1.8.0 | 299 | 9/1/2024 |
| 1.7.9 | 306 | 8/30/2024 |
| 1.7.8 | 263 | 8/30/2024 |
| 1.7.7 | 359 | 8/24/2024 |
| 1.7.6 | 318 | 8/17/2024 |
| 1.7.5 | 281 | 8/17/2024 |
| 1.7.4 | 275 | 8/11/2024 |
| 1.7.3 | 273 | 8/10/2024 |
| 1.7.2 | 293 | 7/19/2024 |
| 1.7.1 | 2,224 | 6/14/2024 |
| 1.7.0 | 4,784 | 12/12/2023 |
| 1.6.9 | 1,131 | 9/13/2023 |
| 1.6.8 | 242 | 9/13/2023 |
| 1.0.0 | 627 | 7/6/2022 |