-
Notifications
You must be signed in to change notification settings - Fork 0
Home
LottaDB is a .NET library that makes it easy to store any object in Azure Table Storage with full Lucene search, all with the goodness of LINQ.
- 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 power, without a lotta work. Store any POCO/JSON objects with no configuration. AutoQueryable indexes every simple-type property automatically, identifying key by convention.
-
A lotta LINQ.
GetManyAsync<T>()andSearch<T>(), .Where(), .OrderBy() etc. - A lotta fidelity. Full object roundtrip. Lists, dictionaries, nested objects -- everything survives.
-
A lotta views.
On<T>triggers build materialized views with plain C#. No event buses, no eventual consistency -- just inline code. - A lotta tenants. One catalog per tenant with multiple databases. Natural isolation, simple cleanup -- delete the catalog and everything goes with it.
- A lotta nothing to operate. Table Storage is serverless. Lucene runs in-process. No clusters, no connection pools, no ops team required.
- A lotta schema safety. Schema changes are detected automatically -- when your type registrations change, the Lucene index is rebuilt on startup.
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. Each tenant gets its own isolated catalog for pennies/month. It's not designed for billion-row analytics or high-throughput write-heavy pipelines.
dotnet add package LottaDB
LottaDB ships as a core package plus separate provider packages. Install only what you need:
| Package | Method | Description |
|---|---|---|
LottaDB |
UseAzure(connectionString) |
Azure Table + Blob Storage (production). Built into the core package. |
LottaDB.Memory |
UseMemory() |
In-memory storage. Fast, no dependencies. Ideal for unit tests. |
LottaDB.FileSystem |
UseFileSystem(rootPath) |
File-based storage on disk. Good for local dev and debugging. |
LottaDB.SQLite |
UseSQLite(rootPath) |
SQLite-backed storage. Single-file persistence for local dev. |
Any C# class works out of the box -- no attributes required. AutoQueryable (on by default) indexes all simple-type properties automatically. A ULID key is generated if no [Key] property exists.
public class Actor
{
public string Id { get; set; } = "";
public string DisplayName { get; set; } = "";
}
// Create a catalog with a connection string (Azure production)
var catalog = new LottaCatalog("myapp", connectionString);
// Create a database "Actors"
var db = await catalog.GetDatabaseAsync("Actors");
// save an Actor into it.
await db.SaveAsync(new Actor { Id = "alice", DisplayName = "Alice Buttercup" });
// get an object back out
var actor = await db.GetAsync<Actor>("alice");
// search for an object
var found = db.Search<Actor>().Where(a => a.DisplayName == "Alice Buttercup").ToList();
await db.DeleteAsync("alice");- Quick Start -- Zero to search in 5 minutes
- Architecture -- Catalogs, databases, multi-tenancy
- Storing POCOs -- POCOs, attributes, fluent config, polymorphism
- Storing JSON -- Schema-free JSON, JsonSchema
- Object Metadata -- ETags, keys, cached JSON
- CRUD Operations -- Save, Get, Delete, Change, bulk ops
- Search and LINQ -- Full-text search, LINQ queries, joins
- Vector Search -- Embeddings, .Similar() queries
- Concurrency -- Optimistic concurrency, ChangeAsync, parallel safety
- Triggers and Views -- On handlers, materialized views
- Blob Storage -- Upload, download, metadata extraction
- Schema Migration -- Automatic index rebuilds
- Testing -- Storage providers, test patterns
- Configuration -- Catalog options, providers, Lucene settings