AcornDB 0.5.0

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

๐ŸŒฐ AcornDB

AcornDB logo

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

Read More: Core Concepts โ†’


โšก 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();

Read More: Nursery Guide โ†’

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

View Full Roadmap โ†’


๐Ÿ—„๏ธ 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


๐Ÿงช 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:

  • Roadmap for planned features
  • Issues for bugs and enhancements
  • Wiki for documentation

๐Ÿฟ๏ธ 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
0.5.0 589 11/14/2025
0.4.0 261 10/7/2025
0.3.0 230 10/7/2025
0.1.0 261 10/6/2025

v0.5.0: