CatDb 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CatDb --version 2.0.0
                    
NuGet\Install-Package CatDb -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CatDb" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CatDb" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CatDb" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CatDb --version 2.0.0
                    
#r "nuget: CatDb, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CatDb@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CatDb&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CatDb&version=2.0.0
                    
Install as a Cake Tool

CatDb

<img src="https://raw.githubusercontent.com/OmidID/CatDb/master/images/nuget.png" align="left" width="128">

CatDb is a high-performance ordered key-value database for .NET, built around the Waterfall Tree (WTree): https://ieeexplore.ieee.org/document/6857846.

CatDb started from STSdb4, but this project has evolved substantially and now differs significantly in architecture, behavior, and public API.

Deployment Model

CatDb is server-first. Run it as a dedicated service via CatDb.Server (ASP.NET Core with HTTP/TCP APIs), or embed it as a library directly in your .NET process. Both use the same high-performance engine.

Installation

Package Description Version
CatDb Database engine library Nuget

Why CatDb

  • Server or embedded: run as a service or link directly into your process.
  • Ordered key storage with efficient forward/backward/range scans.
  • Write-optimized WTree internals for heavy mixed workloads.
  • Secondary index support in the public API.
  • Fluent query builders for key and index queries.
  • Supports non-primitive keys/fields (including composite/object types with comparers).

Quick Start

using CatDb.Database;

using var engine = CatDb.Database.CatDb.FromFile("app.catdb");
var users = engine.OpenXTable<long, User>("users");

users[1] = new User("ada@example.com", "Ada", "London");
users[2] = new User("grace@example.com", "Grace", "New York");

engine.Commit();

if (users.TryGet(1, out var user))
	Console.WriteLine($"{user.Email} / {user.City}");

public sealed record User(string Email, string Name, string City);

Fluent Queries

using CatDb.Extensions;

// Primary key query
var page = users.Query().AtLeast(1).Take(100).ToList();

// Descending query
var last10 = users.Query().Backward().Take(10).ToList();

Secondary Indexes

using CatDb.Database.Indexing;
using CatDb.Extensions;

users.CreateIndex("Email", x => x.Email, IndexType.Unique);
users.CreateIndex("City", x => x.City, IndexType.NonUnique);

var byEmail = users.Query(x => x.Email).Equals("ada@example.com").FirstOrDefault();
var london = users.Query(x => x.City).Equals("London").Take(20).ToList();
var londonCount = users.Query(x => x.City).Equals("London").Count();

Build and Validation

dotnet build --no-incremental
dotnet test --no-build
dotnet run --project examples/CatDb.GettingStarted

Optional stress run:

cd examples/CatDb.StressTest
dotnet run -c Release -- --duration 120

Documentation

Waterfall Tree Reference

Background paper on Waterfall Tree concepts: https://ieeexplore.ieee.org/document/6857846/references

License

MIT License — Copyright (c) 2024-2026 CatDb. See LICENSE for full text.

Free to use in personal, commercial, and proprietary projects.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 43 7/7/2026
2.0.1 98 7/5/2026
2.0.0 98 7/5/2026
2.0.0-beta.1 44 7/4/2026
1.0.0 506 5/28/2022