LottaDB 4.0.0

dotnet add package LottaDB --version 4.0.0
                    
NuGet\Install-Package LottaDB -Version 4.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="LottaDB" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LottaDB" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LottaDB" />
                    
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 LottaDB --version 4.0.0
                    
#r "nuget: LottaDB, 4.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 LottaDB@4.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=LottaDB&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LottaDB&version=4.0.0
                    
Install as a Cake Tool

Build and Test NuGet

Logo

LottaDB

LottaDB is a .NET library that makes it easy to store any POCO in Azure Table Storage with full Lucene search, all with the goodness of LINQ. No schema required -- just define a class and go.

  • A lotta power, a little work. Store any C# class with zero attributes. All properties are automatically queryable and searchable.
  • A lotta bang for a little buck. Table Storage is the cheapest durable storage in Azure. LottaDB adds Lucene so you get rich queries without the rich pricing.
  • A lotta LINQ. GetManyAsync<T>() and Search<T>(), .Where(), .OrderBy() etc.
  • A lotta fidelity. Full JSON roundtrip. Lists, dictionaries, nested objects -- everything survives.
  • A lotta views. On<T> triggers build materialized views with plain C#.
  • A lotta tenants. One catalog per tenant with multiple databases. Natural isolation, simple cleanup.
  • A lotta nothing to operate. Table Storage is serverless. Lucene runs in-process.
  • A lotta schema safety. Schema changes are detected automatically -- Lucene index is rebuilt on startup.
  • A lotta concurrency. ChangeAsync<T>() provides atomic read-modify-write with optimistic concurrency and automatic retry.

Sweet spot

LottaDB is ideal for per-user or per-tenant workloads -- think user profiles, settings, activity feeds, personal knowledge bases, mailboxes, or per-project data. Thousands of objects per tenant, thousands of tenants per deployment.

Installation

dotnet add package LottaDB

Quick Start -- Just Store a lotta objects

Just define a class. No attributes, no base classes, no interfaces:

public class Actor
{
    public string Username { get; set; } = "";
    public string DisplayName { get; set; } = "";
    public string AvatarUrl { get; set; } = "";
}

Create a catalog, register the type, and start storing:

var catalog = new LottaCatalog("myapp", "<your Azure Storage connection string>");
var db = await catalog.GetDatabaseAsync("default");

// Save -- a unique key (ULID) is auto-generated
var actor = new Actor { Username = "alice", DisplayName = "Alice" };
await db.SaveAsync(actor);
var key = actor.GetKey();  // e.g. "01JKX3Q7..."

// Point read by key
var loaded = await db.GetAsync<Actor>(key);

// Search -- all properties are automatically queryable
var found = db.Search<Actor>()
    .Where(a => a.DisplayName == "Alice")
    .ToList();

That's it. No key attribute needed -- a ULID is assigned automatically. Every property on your class is automatically:

  • Stored as full-fidelity JSON in table storage
  • Indexed in Lucene for fast search
  • Queryable via LINQ expressions and full-text search

Fine-Tuning with Attributes

When you need more control, attributes let you specify keys, indexing behavior, and exclusions:

public class Note
{
    [Key]                                    // explicit key property
    public string NoteId { get; set; } = "";

    [Queryable(QueryableMode.NotAnalyzed)]   // exact match only
    public string AuthorId { get; set; } = "";

    [Queryable]                              // full-text search
    public string Content { get; set; } = "";

    [NotQueryable]                           // exclude from indexing (e.g., large payloads)
    public string RawHtml { get; set; } = "";

    public DateTimeOffset Published { get; set; }
    public List<string> Tags { get; set; } = new();
}
Attribute Effect
[Key] Designates the unique key property. Without it, a ULID is auto-generated.
[Queryable] Controls how a property is indexed. Strings get full-text search by default.
[NotQueryable] Excludes a property from automatic indexing (useful for large strings).
[DefaultSearch] (class-level) Sets the default property for free-text queries.

Concurrency

ChangeAsync<T>() provides safe read-modify-write with automatic retry on conflict:

await db.ChangeAsync<Actor>("alice", actor =>
{
    actor.DisplayName = "Alice Updated";
});

Multiple concurrent writers on the same key are handled correctly -- ETag-based optimistic concurrency ensures no updates are lost.

Storage Providers

LottaDB works with Azure Table Storage out of the box. For local development and testing, install a provider package:

Package Install Usage Description
LottaDB dotnet add package LottaDB catalog.UseAzure(connectionString) The default provider. Uses Azure Table Storage API for durability.
LottaDB.Memory dotnet add package LottaDB.Memory catalog.UseMemory() In-memory provider for unit testing. No durability, but lightning fast and supports all features.
LottaDB.SQLite dotnet add package LottaDB.SQLite catalog.UseSQLite(path) Local storage with SQLite. Durable and supports all features, but no serverless scaling.
// Local development with SQLite
var catalog = new LottaCatalog("myapp", catalog => catalog.UseSQLite(@"C:\data"));

// Unit tests with in-memory storage
var catalog = new LottaCatalog("myapp", catalog => catalog.UseMemory());

Documentation

Full documentation is available in the wiki:

Product Compatible and additional computed target framework versions.
.NET 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 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on LottaDB:

Package Downloads
LottaDB.Tiki

Tiki.Net integration for LottaDB — auto-extract rich metadata from blobs on upload.

LottaDB.Memory

In-memory storage provider for LottaDB. Adds UseMemory() extension method for fast unit testing with no disk I/O.

LottaDB.SQLite

SQLite storage provider for LottaDB. Adds UseSQLite() extension method for local development with a single portable .db file.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 63 5/27/2026
3.1.0 115 5/16/2026
3.0.0 95 5/13/2026
2.0.1 89 5/5/2026
2.0.0 113 5/5/2026
1.1.0 102 4/24/2026
1.0.2 103 4/16/2026
1.0.1 96 4/16/2026
1.0.0 99 4/16/2026