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"
#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.ZoneTree.BlobFileSystem
Azure Blob FileSystem for ZoneTree |
|
ManagedCode.Database.ZoneTree
Repository for ZoneTree |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.8.6 | 275 | 6/14/2025 |
1.8.5 | 3,870 | 1/18/2025 |
1.8.4 | 743 | 11/14/2024 |
1.8.3 | 335 | 10/16/2024 |
1.8.2 | 404 | 9/7/2024 |
1.8.1 | 167 | 9/7/2024 |
1.8.0 | 174 | 9/1/2024 |
1.7.9 | 190 | 8/30/2024 |
1.7.8 | 147 | 8/30/2024 |
1.7.7 | 204 | 8/24/2024 |
1.7.6 | 210 | 8/17/2024 |
1.7.5 | 172 | 8/17/2024 |
1.7.4 | 174 | 8/11/2024 |
1.7.3 | 151 | 8/10/2024 |
1.7.2 | 178 | 7/19/2024 |
1.7.1 | 416 | 6/14/2024 |
1.7.0 | 4,672 | 12/12/2023 |
1.6.9 | 899 | 9/13/2023 |
1.6.8 | 167 | 9/13/2023 |
1.6.7 | 168 | 9/13/2023 |
1.6.6 | 218 | 8/18/2023 |
1.6.5 | 231 | 6/17/2023 |
1.6.4 | 174 | 6/16/2023 |
1.6.3 | 262 | 5/29/2023 |
1.6.2 | 16,970 | 5/26/2023 |
1.6.1 | 327 | 4/5/2023 |
1.6.0 | 1,952 | 1/14/2023 |
1.5.9 | 351 | 1/14/2023 |
1.5.8 | 1,063 | 11/20/2022 |
1.5.7 | 430 | 11/14/2022 |
1.5.6 | 397 | 11/13/2022 |
1.5.5 | 510 | 10/20/2022 |
1.5.2 | 542 | 9/14/2022 |
1.5.1 | 462 | 9/3/2022 |
1.5.0 | 459 | 9/2/2022 |
1.4.9 | 465 | 8/31/2022 |
1.4.8 | 431 | 8/30/2022 |
1.4.7 | 466 | 8/30/2022 |
1.4.6 | 469 | 8/29/2022 |
1.4.5 | 486 | 8/28/2022 |
1.4.4 | 665 | 8/27/2022 |
1.4.3 | 469 | 8/26/2022 |
1.4.2 | 461 | 8/26/2022 |
1.4.1 | 433 | 8/26/2022 |
1.4.0 | 471 | 8/25/2022 |
1.3.9 | 448 | 8/25/2022 |
1.3.8 | 468 | 8/24/2022 |
1.3.7 | 740 | 8/23/2022 |
1.3.6 | 449 | 8/22/2022 |
1.3.5 | 471 | 8/22/2022 |
1.3.4 | 468 | 8/21/2022 |
1.3.3 | 459 | 8/18/2022 |
1.3.2 | 486 | 8/17/2022 |
1.3.1 | 451 | 8/17/2022 |
1.3.0 | 468 | 8/17/2022 |
1.2.9 | 452 | 8/16/2022 |
1.2.8 | 445 | 8/15/2022 |
1.2.7 | 472 | 8/15/2022 |
1.2.6 | 458 | 8/13/2022 |
1.2.5 | 476 | 8/13/2022 |
1.2.4 | 464 | 8/13/2022 |
1.2.3 | 488 | 8/9/2022 |
1.2.2 | 438 | 8/9/2022 |
1.2.1 | 488 | 8/9/2022 |
1.2.0 | 507 | 8/8/2022 |
1.1.9 | 476 | 8/8/2022 |
1.1.8 | 474 | 8/8/2022 |
1.1.7 | 494 | 8/8/2022 |
1.1.6 | 454 | 8/7/2022 |
1.1.5 | 484 | 8/6/2022 |
1.1.4 | 467 | 8/6/2022 |
1.1.3 | 477 | 8/5/2022 |
1.1.2 | 487 | 8/5/2022 |
1.1.1 | 482 | 7/27/2022 |
1.1.0 | 484 | 7/27/2022 |
1.0.9 | 473 | 7/25/2022 |
1.0.8 | 466 | 7/24/2022 |
1.0.7 | 433 | 7/23/2022 |
1.0.6 | 478 | 7/20/2022 |
1.0.5 | 485 | 7/18/2022 |
1.0.4 | 492 | 7/11/2022 |
1.0.3 | 531 | 7/11/2022 |
1.0.2 | 514 | 7/11/2022 |
1.0.1 | 498 | 7/6/2022 |
1.0.0 | 499 | 7/6/2022 |