🌰

AcornDB

A lightweight, reactive, embeddable database for .NET

Nutty by design. Practically production-ready.

// Install via NuGet
dotnet add package AcornDB

// Start using it
var tree = new Tree<User>();
tree.Stash(new User { 
    Name = "Squirrely Stan" 
});

Why AcornDB?

Most apps don't need Cosmos DB, Kafka, or a $400/month cloud bill to store 5MB of JSON.

🏠

Local-First Storage

For edge, desktop, mobile and embedded apps. Fast, zero-config persistence that works offline.

☁️

Cloud-Extendable

Free sync when you're ready. S3, Azure Blob, PostgreSQL, MySQL, or HTTP mesh networks.

Reactive & Evented

Like a squirrel on caffeine. Updates propagate in milliseconds with built-in subscriptions.

🎯

Zero Configuration

No YAML. No connection strings. Just new Tree<T>() and you're done.

🔀

Mesh Sync

In-process tree-to-tree sync or distributed HTTP mesh. No server required for basic sync.

🐿️

Self-Advocating

These acorns advocate for themselves. Memorable APIs: Stash, Crack, Toss, Shake, Squabble.

How It Works

🌳

Tree

Trees stash your nuts, where branches grow across nodes. A collection of documents with built-in caching, TTL, and versioning.

🌲

Grove

Groves sync trees when you'd otherwise be gathering acorns manually. Container managing multiple Trees with unified sync.

📡

Canopy

Canopy signals acorn changes like a well-honed hindbrain. Web dashboard for real-time visualization and management.

Features

Serious software. Zero seriousness.

🌰

Core API

Stash(), Crack(), Toss() - squirrel-style CRUD

🎯

Auto-ID Detection

Automatic 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 (timestamp, version, custom)

🧠

LRU Cache

Automatic eviction with configurable limits

TTL Enforcement

Auto-cleanup of expired items

🐿️

Git Storage

GitHubTrunk - every stash is a Git commit!

🌱

Nursery System

Dynamic trunk discovery and factory pattern

☁️

Cloud Storage

S3, Azure Blob via extension packages

💾

RDBMS Storage

SQLite, SQL Server, PostgreSQL, MySQL

🔐

Encryption

AES with password or custom provider

🗜️

Compression

Gzip/Brotli storage optimization

📈

LINQ Support

GetAll() returns IEnumerable for queries

Pluggable Storage

Swap backends without changing your code. From file to cloud in one line.

📁

File / Memory

Simple & fast local storage

🐙

Git

Every stash is a commit

☁️

S3 / Azure

Cloud object storage

🗄️

SQL

SQLite, PostgreSQL, MySQL

// Local file storage (default)
var tree = new Acorn<User>().Sprout();

// Git storage - every stash is a commit
var gitTree = new Acorn<User>()
    .WithGitTrunk("./my_repo", authorName: "Alice")
    .Sprout();

// Cloud storage with encryption + compression
var s3Tree = new Acorn<User>()
    .WithS3Trunk(accessKey, secretKey, bucketName)
    .WithEncryption("my-password")
    .WithCompression()
    .Sprout();

// Dynamic discovery via Nursery
var dynamicTree = new Acorn<User>()
    .WithTrunk("postgresql", new() {
        { "connectionString", "Host=localhost;Database=acorn" }
    })
    .Sprout();

Real-World Examples

🖥️ Local-First Desktop App

var tree = new Acorn<Document>()
    .WithStoragePath("./user_data")
    .WithLRUCache(5000)
    .Sprout();

tree.Subscribe(doc => 
    Console.WriteLine($"Changed: {doc.Title}")
);

🌐 IoT Edge 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);

🏢 Multi-Tenant SaaS

string GetTenantPath(string tenantId) => 
    $"./data/{tenantId}";

var tenantTree = new Acorn<Order>()
    .WithStoragePath(GetTenantPath(currentTenantId))
    .Sprout();

📝 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!

Perfect For

Built for developers who'd rather ship products than manage infrastructure

🖥️

Desktop & Mobile Apps

🌐

IoT & Edge Devices

⚙️

CLI Tools & Utilities

Serverless & Edge

👤

Single-User SaaS

📱

Offline-First Apps

Our Philosophy

We built AcornDB because we were tired of paying $$$ to store JSON, managing Kubernetes for simple persistence, and writing DataClientServiceManagerFactoryFactory.

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

If you've ever rage-quit YAML or cried syncing offline-first apps — welcome home. 🌳

Get Started

From zero to production in 3 lines of code

// 1. Install via NuGet
dotnet add package AcornDB

// 2. Create a tree
var tree = new Tree<User>();

// 3. Start stashing
tree.Stash(new User { 
    Id = "alice", 
    Name = "Alice Acorn" 
});

// That's it! ✨