AcornDB 0.5.0
dotnet add package AcornDB --version 0.5.0
NuGet\Install-Package AcornDB -Version 0.5.0
<PackageReference Include="AcornDB" Version="0.5.0" />
<PackageVersion Include="AcornDB" Version="0.5.0" />
<PackageReference Include="AcornDB" />
paket add AcornDB --version 0.5.0
#r "nuget: AcornDB, 0.5.0"
#:package AcornDB@0.5.0
#addin nuget:?package=AcornDB&version=0.5.0
#tool nuget:?package=AcornDB&version=0.5.0
๐ฐ AcornDB

A distributed, embeddable, reactive object database for .NET. Local-first persistence with mesh sync, LRU cache eviction, TTL enforcement, pluggable storage backends, and zero configuration.
๐ฟ๏ธ Built for developers who'd rather ship products than manage infrastructure.
dotnet add package AcornDB
dotnet add package AcornDB.Persistence.Cloud # Optional: S3, Azure Blob
dotnet add package AcornDB.Persistence.RDBMS # Optional: SQLite, SQL Server, PostgreSQL, MySQL
๐ Why AcornDB?
Most apps don't need Cosmos DB, Kafka, or a $400/month cloud bill to store 5MB of JSON.
You need:
- โ Fast, local-first persistence
- โ Simple per-tenant or per-user storage
- โ Offline support + sync that actually works
- โ Zero configuration, zero ceremony
Perfect for:
- Desktop & mobile apps
- IoT & edge devices
- CLI tools & utilities
- Serverless & edge workloads
- Single-user SaaS apps
๐ฒ Core Concepts
| Term | Description |
|---|---|
| Tree<T> | A collection of documents (like a table) |
| Nut<T> | A document with metadata (timestamp, version, TTL) |
| Trunk | Storage backend abstraction (file, memory, Git, cloud, SQL) |
| Branch | Connection to a remote Tree via HTTP |
| Tangle | Live sync session between two Trees |
| Grove | Container managing multiple Trees with unified sync |
| Acorn | Factory registry for discovering and creating trunks |
โก Quick Start
30-Second Example
using AcornDB;
public class User
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Name { get; set; }
}
// Create a tree (defaults to file storage, zero config!)
var tree = new Tree<User>();
// Or use the fluent builder pattern via Acorn
tree = new Acorn<User>().WithCompression().Sprout();
// Stash (auto-detects ID from property)
tree.Stash(new User { Name = "Alice" });
// Crack (retrieve)
var alice = tree.Crack("alice-id");
// Query with LINQ
var adults = tree.Nuts.Where(u => u.Age >= 18).ToList();
Use Git for Storage
Every Stash() creates a Git commit. Use Git tools to inspect your database:
using AcornDB;
using AcornDB.Storage;
var tree = new Acorn<User>()
.WithGitTrunk(repoPath: "./my_db", autoPush: true)
.Sprout();
tree.Stash(new User { Id = "alice", Name = "Alice" });
// โ
Git commit created: "Stash: alice at 2025-10-07 10:30:45"
// Time-travel through history
var history = tree.GetHistory("alice"); // All previous versions
cd my_db
git log --oneline
# f4e8a91 Stash: alice at 2025-10-07 10:30:45
# c2d1b3a Stash: bob at 2025-10-07 10:25:12
Read More: GitHub Trunk Guide โ
Dynamic Storage with Nursery
Discover and grow storage backends at runtime:
// Browse available storage types
Console.WriteLine(Nursery.GetCatalog());
// Grow trunk from config (no hardcoded dependencies!)
var tree = new Acorn<User>()
.WithTrunk("git", new()
{
{ "repoPath", "./my_repo" },
{ "authorName", "Alice" }
})
.Sprout();
// Change storage backend via environment variable
var storageType = Environment.GetEnvironmentVariable("STORAGE") ?? "file";
var tree = new Acorn<User>().WithTrunk(storageType).Sprout();
Real-Time Sync
// In-process sync (no HTTP server needed!)
var tree1 = new Acorn<User>().Sprout();
var tree2 = new Acorn<User>().InMemory().Sprout();
tree1.Entangle(tree2); // Direct tree-to-tree sync
tree1.Stash(new User { Name = "Bob" });
// โ
Automatically synced to tree2!
// HTTP sync with TreeBark server
var branch = new Branch("http://localhost:5000");
grove.Oversee<User>(branch); // Auto-syncs on every change
Read More: Data Sync Guide โ
๐ฏ Features
โ Implemented (v0.4)
| Feature | Description |
|---|---|
| ๐ฐ Core API | Stash(), Crack(), Toss() - squirrel-style CRUD |
| ๐ฏ Auto-ID Detection | Automatic ID extraction from Id or Key properties |
| ๐ Reactive Events | Subscribe() for real-time change notifications |
| ๐ชข In-Process Sync | Direct tree-to-tree sync without HTTP |
| ๐ HTTP Sync | TreeBark server for distributed sync |
| ๐ก๏ธ Versioned Nuts | Timestamps, TTL, conflict detection built-in |
| โ๏ธ Conflict Resolution | Pluggable IConflictJudge<T> (timestamp, version, custom) |
| ๐ง LRU Cache | Automatic eviction with configurable limits |
| โฐ TTL Enforcement | Auto-cleanup of expired items |
| ๐ฒ Grove Management | Multi-tree orchestration and sync |
| ๐ AcornVisualizer | Web UI for browsing groves and nuts |
| ๐ฟ๏ธ Git Storage | GitHubTrunk - every stash is a Git commit! |
| ๐ฑ Nursery System | Dynamic trunk discovery and factory pattern |
| โ๏ธ Cloud Storage | S3, Azure Blob (via AcornDB.Persistence.Cloud) |
| ๐พ RDBMS Storage | SQLite, SQL Server, PostgreSQL, MySQL (via AcornDB.Persistence.RDBMS) |
| ๐ Encryption | AES encryption with password or custom provider |
| ๐๏ธ Compression | Gzip/Brotli compression for storage optimization |
| ๐ LINQ Support | GetAll() returns IEnumerable<T> for LINQ queries |
| ๐ Full History | GetHistory(id) for version history (Git & DocumentStore trunks) |
๐ Roadmap (Upcoming)
| Feature | Target | Description |
|---|---|---|
| ๐ BarkCodes Auth | v0.5 | Token-based authentication for sync |
| ๐ญ Critters RBAC | v0.5 | Role-based access control |
| ๐ Mesh Sync | v0.5 | Peer-to-peer multi-tree sync networks |
| ๐ฆ CLI Tool | v0.5 | acorn new, acorn inspect, acorn migrate |
| ๐ Auto-Recovery | v0.6 | Offline-first sync queue with retry |
| ๐ Prometheus Export | v0.6 | OpenTelemetry metrics integration |
| ๐จ Dark Mode UI | v0.6 | Canopy dashboard enhancements |
๐๏ธ Storage Backends (Trunks)
AcornDB uses Trunks to abstract storage. Swap backends without changing your code.
Built-in Trunks
| Trunk | Package | Durable | History | Async | Use Case |
|---|---|---|---|---|---|
FileTrunk |
Core | โ | โ | โ | Simple file storage (default) |
MemoryTrunk |
Core | โ | โ | โ | Fast in-memory (testing) |
DocumentStoreTrunk |
Core | โ | โ | โ | Versioning & time-travel |
GitHubTrunk |
Core | โ | โ | โ | Git-as-database with commit history |
AzureTrunk |
Cloud | โ | โ | โ | Azure Blob Storage |
S3Trunk |
Cloud | โ | โ | โ | AWS S3, MinIO, DigitalOcean Spaces |
SqliteTrunk |
RDBMS | โ | โ | โ | SQLite database |
SqlServerTrunk |
RDBMS | โ | โ | โ | Microsoft SQL Server |
PostgreSqlTrunk |
RDBMS | โ | โ | โ | PostgreSQL |
MySqlTrunk |
RDBMS | โ | โ | โ | MySQL/MariaDB |
Read More: Storage Guide โ Cloud Storage Guide โ Nursery Guide โ
Using Fluent API
using AcornDB;
// File storage (default)
var tree = new Acorn<User>().Sprout();
// Git storage
var gitTree = new Acorn<User>()
.WithGitTrunk("./my_repo", authorName: "Alice")
.Sprout();
// With encryption + compression
var secureTree = new Acorn<User>()
.WithEncryption("my-password")
.WithCompression()
.Sprout();
// LRU cache with limit
var cachedTree = new Acorn<User>()
.WithLRUCache(maxSize: 1000)
.Sprout();
// Via Nursery (dynamic)
var dynamicTree = new Acorn<User>()
.WithTrunk("git", new() { { "repoPath", "./data" } })
.Sprout();
Cloud & RDBMS Extensions
using AcornDB.Persistence.Cloud;
using AcornDB.Persistence.RDBMS;
// S3 storage
var s3Tree = new Acorn<User>()
.WithS3Trunk(accessKey, secretKey, bucketName, region: "us-east-1")
.Sprout();
// Azure Blob
var azureTree = new Acorn<User>()
.WithAzureBlobTrunk(connectionString, containerName)
.Sprout();
// SQLite
var sqliteTree = new Acorn<User>()
.WithSqliteTrunk("Data Source=mydb.db")
.Sprout();
// PostgreSQL
var pgTree = new Acorn<User>()
.WithPostgreSQLTrunk("Host=localhost;Database=acorn")
.Sprout();
๐ Documentation
- Getting Started Guide - Your first AcornDB app
- Core Concepts - Understanding Trees, Nuts, and Trunks
- Storage Guide - Available trunk types and usage
- Data Sync Guide - In-process, HTTP, and mesh sync
- Conflict Resolution - Handling sync conflicts
- Events & Reactivity - Real-time change notifications
- GitHub Trunk Demo - Git-as-database guide
- Nursery Guide - Dynamic trunk discovery
- Cloud Storage Guide - S3, Azure Blob setup
- Dashboard & Visualizer - Web UI for grove management
- Cluster & Mesh - Distributed sync patterns
๐งช Examples
// Example 1: Local-first desktop app
var tree = new Acorn<Document>()
.WithStoragePath("./user_data")
.WithLRUCache(5000)
.Sprout();
tree.Subscribe(doc => Console.WriteLine($"Changed: {doc.Title}"));
// Example 2: IoT edge device with cloud backup
var edgeTree = new Acorn<SensorReading>()
.WithStoragePath("./local_cache")
.Sprout();
var cloudBranch = new Branch("https://api.example.com/sync");
grove.Oversee<SensorReading>(cloudBranch); // Auto-syncs to cloud
// Example 3: Multi-tenant SaaS with per-tenant storage
string GetTenantPath(string tenantId) => $"./data/{tenantId}";
var tenantTree = new Acorn<Order>()
.WithStoragePath(GetTenantPath(currentTenantId))
.Sprout();
// Example 4: Git-based audit log
var auditLog = new Acorn<AuditEntry>()
.WithGitTrunk("./audit_log", authorName: "System")
.Sprout();
auditLog.Stash(new AuditEntry { Action = "Login", User = "alice" });
// Git commit created with full history!
More Examples: Demo Project โ Live Sync Demo โ
๐จ Canopy - Web UI
Explore your Grove with an interactive dashboard:
cd Canopy
dotnet run
# Open http://localhost:5100
Features:
- ๐ Real-time statistics
- ๐ณ Tree explorer with metadata
- ๐ Interactive graph visualization
- ๐ Nut inspector with history
- โ๏ธ Trunk capabilities viewer
Read More: Dashboard Guide โ
๐งฑ Project Structure
| Project | Purpose |
|---|---|
AcornDB |
Core library (Tree, Nut, Trunk, Sync) |
AcornDB.Persistence.Cloud |
S3, Azure Blob, cloud storage providers |
AcornDB.Persistence.RDBMS |
SQLite, SQL Server, PostgreSQL, MySQL |
AcornDB.Sync |
TreeBark - HTTP sync server |
AcornDB.Canopy |
Web UI dashboard |
AcornDB.Demo |
Example applications |
AcornDB.Test |
Test suite (100+ tests) |
AcornDB.Benchmarks |
Performance benchmarks |
๐ฐ The Acorn Philosophy
๐ฟ๏ธ Serious software. Zero seriousness.
We built AcornDB because we were tired of:
- Paying $$$ to store JSON
- Managing Kubernetes for simple persistence
- Writing
DataClientServiceManagerFactoryFactory - YAML-induced existential dread
We believe:
- Developers deserve tools that make them smile
- Syncing JSON shouldn't require a PhD
- Local-first is the future
- API names should be memorable (
Stash,Crack,Shake>Insert,Select,Synchronize)
If you've ever rage-quit YAML or cried syncing offline-first apps โ welcome home. ๐ณ
๐ค Contributing
We welcome contributions! Check out:
๐ฟ๏ธ Stay Nutty
Built with acorns and sarcasm by developers who've had enough.
โญ Star the repo if AcornDB saved you from another cloud bill ๐ด Fork it if you want to get squirrelly ๐ฌ Share your weirdest squirrel pun in the discussions
๐งพ License
AcornDB is source-available software provided by Anadak LLC.
- Free for personal, educational, and non-commercial use under the
PolyForm Noncommercial License 1.0.0 - Commercial use requires a separate license from Anadak LLC. The cost of which will be inversely proportionate to the degree of good you're doing. Contact licensing@anadak.ai for details.
ยฉ 2025 Anadak LLC. All rights reserved.
| Product | Versions 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 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. |
-
net8.0
- Azure.Storage.Blobs (>= 12.19.1)
- LibGit2Sharp (>= 0.31.0)
- Newtonsoft.Json (>= 13.0.4)
- System.Reactive (>= 6.1.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on AcornDB:
| Package | Downloads |
|---|---|
|
AcornDB.Persistence.Cloud
🌰 Cloud storage providers for AcornDB - AWS S3, Azure Blob Storage, DynamoDB, Azure Table Storage. All with full IRoot pipeline support for compression, encryption, and policy enforcement. |
|
|
AcornDB.Persistence.RDBMS
🌰 RDBMS storage providers for AcornDB - SQLite, SQL Server, PostgreSQL, MySQL trunk implementations with full IRoot pipeline support for compression, encryption, and policy enforcement. |
|
|
AcornDB.Persistence.DataLake
🌰 Data Lake persistence for AcornDB - Apache Parquet and TieredTrunk with full IRoot pipeline support. Enables compression, encryption, policy enforcement on columnar storage with hot/cold tiering capabilities. |
|
|
AcornDB.Canopy
🌲 AcornDB.Canopy - SignalR hub and real-time visualization extensions for AcornDB. Adds Hardwood HTTP server, live sync orchestration, and real-time grove monitoring capabilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
v0.5.0: