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 | 4,909 | 6/14/2025 |
| 1.8.5 | 7,451 | 1/18/2025 |
| 1.8.4 | 895 | 11/14/2024 |
| 1.8.3 | 423 | 10/16/2024 |
| 1.8.2 | 1,546 | 9/7/2024 |
| 1.8.1 | 247 | 9/7/2024 |
| 1.8.0 | 259 | 9/1/2024 |
| 1.7.9 | 267 | 8/30/2024 |
| 1.7.8 | 225 | 8/30/2024 |
| 1.7.7 | 303 | 8/24/2024 |
| 1.7.6 | 277 | 8/17/2024 |
| 1.7.5 | 240 | 8/17/2024 |
| 1.7.4 | 240 | 8/11/2024 |
| 1.7.3 | 232 | 8/10/2024 |
| 1.7.2 | 250 | 7/19/2024 |
| 1.7.1 | 1,555 | 6/14/2024 |
| 1.7.0 | 4,746 | 12/12/2023 |
| 1.6.9 | 1,034 | 9/13/2023 |
| 1.6.8 | 226 | 9/13/2023 |
| 1.6.7 | 232 | 9/13/2023 |
| 1.6.6 | 270 | 8/18/2023 |
| 1.6.5 | 323 | 6/17/2023 |
| 1.6.4 | 248 | 6/16/2023 |
| 1.6.3 | 337 | 5/29/2023 |
| 1.6.2 | 18,624 | 5/26/2023 |
| 1.6.1 | 424 | 4/5/2023 |
| 1.6.0 | 2,257 | 1/14/2023 |
| 1.5.9 | 435 | 1/14/2023 |
| 1.5.8 | 1,170 | 11/20/2022 |
| 1.5.7 | 519 | 11/14/2022 |
| 1.5.6 | 484 | 11/13/2022 |
| 1.5.5 | 591 | 10/20/2022 |
| 1.5.2 | 613 | 9/14/2022 |
| 1.5.1 | 551 | 9/3/2022 |
| 1.5.0 | 549 | 9/2/2022 |
| 1.4.9 | 562 | 8/31/2022 |
| 1.4.8 | 523 | 8/30/2022 |
| 1.4.7 | 539 | 8/30/2022 |
| 1.4.6 | 548 | 8/29/2022 |
| 1.4.5 | 572 | 8/28/2022 |
| 1.4.4 | 729 | 8/27/2022 |
| 1.4.3 | 576 | 8/26/2022 |
| 1.4.2 | 541 | 8/26/2022 |
| 1.4.1 | 516 | 8/26/2022 |
| 1.4.0 | 562 | 8/25/2022 |
| 1.3.9 | 517 | 8/25/2022 |
| 1.3.8 | 565 | 8/24/2022 |
| 1.3.7 | 847 | 8/23/2022 |
| 1.3.6 | 543 | 8/22/2022 |
| 1.3.5 | 570 | 8/22/2022 |
| 1.3.4 | 545 | 8/21/2022 |
| 1.3.3 | 566 | 8/18/2022 |
| 1.3.2 | 585 | 8/17/2022 |
| 1.3.1 | 545 | 8/17/2022 |
| 1.3.0 | 556 | 8/17/2022 |
| 1.2.9 | 544 | 8/16/2022 |
| 1.2.8 | 548 | 8/15/2022 |
| 1.2.7 | 565 | 8/15/2022 |
| 1.2.6 | 557 | 8/13/2022 |
| 1.2.5 | 570 | 8/13/2022 |
| 1.2.4 | 545 | 8/13/2022 |
| 1.2.3 | 572 | 8/9/2022 |
| 1.2.2 | 509 | 8/9/2022 |
| 1.2.1 | 585 | 8/9/2022 |
| 1.2.0 | 611 | 8/8/2022 |
| 1.1.9 | 573 | 8/8/2022 |
| 1.1.8 | 562 | 8/8/2022 |
| 1.1.7 | 598 | 8/8/2022 |
| 1.1.6 | 531 | 8/7/2022 |
| 1.1.5 | 575 | 8/6/2022 |
| 1.1.4 | 559 | 8/6/2022 |
| 1.1.3 | 570 | 8/5/2022 |
| 1.1.2 | 575 | 8/5/2022 |
| 1.1.1 | 570 | 7/27/2022 |
| 1.1.0 | 580 | 7/27/2022 |
| 1.0.9 | 568 | 7/25/2022 |
| 1.0.8 | 567 | 7/24/2022 |
| 1.0.7 | 504 | 7/23/2022 |
| 1.0.6 | 581 | 7/20/2022 |
| 1.0.5 | 585 | 7/18/2022 |
| 1.0.4 | 562 | 7/11/2022 |
| 1.0.3 | 634 | 7/11/2022 |
| 1.0.2 | 609 | 7/11/2022 |
| 1.0.1 | 574 | 7/6/2022 |
| 1.0.0 | 582 | 7/6/2022 |