ZeroStorage.Core
1.1.0
dotnet add package ZeroStorage.Core --version 1.1.0
NuGet\Install-Package ZeroStorage.Core -Version 1.1.0
<PackageReference Include="ZeroStorage.Core" Version="1.1.0" />
<PackageVersion Include="ZeroStorage.Core" Version="1.1.0" />
<PackageReference Include="ZeroStorage.Core" />
paket add ZeroStorage.Core --version 1.1.0
#r "nuget: ZeroStorage.Core, 1.1.0"
#:package ZeroStorage.Core@1.1.0
#addin nuget:?package=ZeroStorage.Core&version=1.1.0
#tool nuget:?package=ZeroStorage.Core&version=1.1.0
ZeroStorage
ZeroStorage is an embedded, high-throughput time-series database (TSDB) and write-ahead log (WAL) storage engine for .NET with zero external dependencies. Implemented from scratch in pure C#, it features Facebook Gorilla lossy/lossless Delta-of-Delta timestamp compression, XOR float mantissa encoding, wide-row MultiMetricBlock columnar persistence, memory-mapped files (MMF), CRC32 integrity verification, and background tiered compaction.
๐ Key Capabilities
- Wide-Row Time-Series Compression (
MultiMetricBlock): Simultaneously encodes multiple metrics sharing timestamp vectors with Gorilla compression. - Facebook Gorilla Time-Series Compression:
- Timestamp Compression: Variable-length Delta-of-Delta encoding (down to 1 bit per sample for regular time intervals).
- Value Compression: XOR floating-point mantissa encoding with leading/trailing zero tracking (reducing typical float metrics to $< 1.5$ bytes/sample).
- Memory-Mapped Persistence (
MemoryMappedTimeSeriesLog): Direct kernel-level zero-copy disk mapping viaMemoryMappedFile, bypassing user-space buffering for sub-millisecond writes. - Write-Ahead Log (WAL): Append-only durability log with IEEE 802.3 CRC32 integrity checksums per record and automatic crash recovery.
- Tiered Compaction: Background compactor merging fragmented uncompressed or hot blocks into consolidated, dense cold storage blocks.
- Zero External Dependencies: Pure C# standard runtime library.
๐ฆ Installation
Install via the .NET CLI:
dotnet add package ZeroStorage.Core
๐ Quick Start
1. Gorilla Timestamp & Float Compression
using ZeroStorage.Core.BitIO;
using ZeroStorage.Core.Gorilla;
using var stream = new MemoryStream();
var writer = new BitWriter(stream);
var encoder = new GorillaEncoder(writer);
long baseTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
// Encode stream of 1000 points
for (int i = 0; i < 1000; i++)
{
long ts = baseTimestamp + (i * 10); // 10ms intervals
double val = 25.0 + Math.Sin(i * 0.1) * 0.5;
encoder.Encode(ts, val);
}
encoder.Finish();
Console.WriteLine($"Compressed 1,000 points into: {stream.Length} bytes ({stream.Length / 1000.0:F2} bytes/point)!");
2. Memory-Mapped Time-Series Log
using ZeroStorage.Core.Persistence;
using var tsdb = new MemoryMappedTimeSeriesLog("telemetry.tsdb", maxSizeBytes: 64 * 1024 * 1024);
// Append metric point
tsdb.Append(metricId: 42, timestamp: DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), value: 98.6);
๐ Benchmark & Performance
Tested on Intel Core i7-13700K with NVMe SSD (Release x64):
| Metric | Uncompressed Raw | Gorilla Compressed (ZeroStorage) | Compression Ratio |
|---|---|---|---|
| Storage per Metric Point | $16 \text{ bytes}$ ($8\text{B ts} + 8\text{B val}$) | $1.37 \text{ bytes}$ | $11.6 \times$ smaller |
| Write Throughput | $2.5\text{M points/sec}$ | $12.8\text{M points/sec}$ | In-memory bit packing |
| Query Decompress Speed | $10\text{M points/sec}$ | $45.0\text{M points/sec}$ | Direct bit-stream decode |
๐ Release History
| Version | Release Date | Key Milestones & Highlights |
|---|---|---|
v1.1.0 |
2026-09-16 | Wide-Row Metric Compression:<br/>โข Introduced MultiMetricBlock simultaneous encoding of multi-variate telemetry streams.<br/>โข Zero-copy memory mapped files with CRC32 block checksums.<br/>โข 18 unit tests passing (100% success rate). |
v1.0.0 |
2026-09-09 | Initial Sovereign Release:<br/>โข Pure C# Facebook Gorilla Delta-of-Delta timestamp & XOR float compression.<br/>โข Memory-mapped write-ahead logging (WAL) & tiered compaction. |
๐ License
MIT License ยฉ 2026 Phong Vรต. Part of the ZeroPlatform project.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- ZeroData.Core (>= 1.1.0)
- ZeroPrimitives.Core (>= 1.1.0)
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- ZeroData.Core (>= 1.1.0)
- ZeroPrimitives.Core (>= 1.1.0)
-
net8.0
- ZeroData.Core (>= 1.1.0)
- ZeroPrimitives.Core (>= 1.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ZeroStorage.Core:
| Package | Downloads |
|---|---|
|
ZeroPipeline.Nodes
Industrial Concrete Pipeline Nodes: Machine Vision, Metrology, Barcode/QR Decoders, AI Inference, Modbus PLC, and Gorilla TimeSeries Logging for ZeroPlatform. |
|
|
ZeroIoT
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.