SharpCoreDB 2.0.0

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

SharpCoreDB v2.0.0.0 β€” Performance-First Database Engine

High-Performance Embedded AND Networked Database for .NET 10

SharpCoreDB is a modern, encrypted, file-based database engine with SQL support, built for production applications. Now available as both embedded database and network server.

NuGet NuGet downloads .NET 10 License: MIT SonarCloud Quality Gate

What's New in 2.0.0.0

πŸš€ Performance-first engine

  • v2.0 closes the v1.x benchmark gap: point reads beat SQLite on the default engine, batch INSERTs are at parity, and the WP10–WP13 storage-engine work narrowed single-row UPDATE/DELETE to ~1–2x SQLite.
  • Zero-allocation struct-row SQL reads via ExecuteQueryStruct.
  • Batch UPDATE / READ / INSERT fast paths: position-aware batch UPDATE, zero-deserialize in-place field patches, direct hash-index point lookups and memoized SQL normalization (B7–B9).

πŸ”’ Envelope encryption + full at-rest encryption

  • Password-based key model: DatabaseOptions.EncryptionPassword creates a random per-file data-encryption-key (DEK) wrapped by a PBKDF2-HMAC-SHA256-derived key (per-file salt, OWASP-2024 iteration default). Raw EncryptionKey mode remains fully supported.
  • Full at-rest metadata encryption (beyond issue #341's block data): the block registry, free-space map and WAL are encrypted too (EncryptionMode = 2), so block/table names, offsets, lengths and allocation patterns are not visible in plaintext on disk.
  • Key & password rotation: IDatabase.ChangeEncryptionPasswordAsync(...) re-wraps the DEK (O(1), no data rewrite); IDatabase.RotateEncryptionKeyAsync(...) fully re-keys the database via a crash-safe temp-file swap.
  • Wrong key/password now fails loudly at open (GCM authentication failure).

πŸ“¦ Block-level compression (Issue #344)

  • Transparent per-block Brotli / GZip / Zstd compression for single-file (.scdb) storage β€” applied before encryption on write, removed after decryption on read.
  • Configurable presets: DatabaseOptions.BlockCompressionLevel / MetadataCompressionLevel (Fastest, Optimal, SmallestSize); CompressionThreshold controls the minimum block size.
  • Compressed and uncompressed blocks can coexist in one file; defaults to None (backward compatible).
  • New options: DatabaseOptions.BlockCompression, CompressionThreshold, BlockCompressionLevel.

βš™οΈ Configurable metadata sizing (Issue #345)

  • The FSM, Block Registry and Table Directory are no longer hard-coded to 4 pages: FsmSizePages, BlockRegistrySizePages and TableDirectorySizePages support databases beyond 512 MB.
  • Minimum file extension is now byte-based (~10 MB) regardless of PageSize.

πŸš€ Key Features

βœ… Embedded Database - Single-file storage, no server required
βœ… Network Server Mode - gRPC/HTTP/WebSocket protocols (NEW!)
βœ… Encrypted - AES-256-GCM encryption built-in
βœ… SQL Support - Full SQL syntax, prepared statements
βœ… High Performance - 6.5x faster than SQLite for bulk operations
βœ… Modern C# 14 - Latest language features, NativeAOT ready
βœ… Cross-Platform - Windows, Linux, macOS, ARM64 native
βœ… Production Ready - 1,468+ tests, zero known critical bugs
βœ… Multi-Language - .NET, Python, JavaScript/TypeScript clients

πŸ“Š Performance

  • Bulk Insert (1M rows): 2.8 seconds
  • Analytics (COUNT 1M): 682x faster than SQLite
  • Vector Search: 50-100x faster than SQLite
  • Metadata Compression: <1ms overhead
  • gRPC Query Latency: 0.8-1.2ms (p50)
  • Concurrent Connections: 1000+ (server mode)

πŸ”— Package Ecosystem

This package installs the core database engine. Extensions available:

Functional Programming (NEW in v1.9.6):

  • SharpCoreDB.Functional - Functional faΓ§ade with Option<T>, Fin<T>, and Seq<T>-style APIs
  • SharpCoreDB.Functional.Dapper - Functional Dapper adapter module
  • SharpCoreDB.Functional.EntityFrameworkCore - Functional EF Core adapter module

Server Mode (NEW!):

  • SharpCoreDB.Server - Network database server with gRPC/HTTP/WebSocket
  • SharpCoreDB.Client - .NET client library (ADO.NET-style)

Analytics & Search:

  • SharpCoreDB.Analytics - 100+ aggregate & window functions (150-680x faster)
  • SharpCoreDB.VectorSearch - SIMD-accelerated semantic search (50-100x faster)
  • SharpCoreDB.Graph - Lightweight graph traversal (30-50% faster)

Distributed Features:

  • SharpCoreDB.Distributed - Multi-master replication, sharding, transactions
  • SharpCoreDB.Provider.Sync - Dotmim.Sync integration (bidirectional sync)

Optional Integrations:

  • SharpCoreDB.EntityFrameworkCore - EF Core provider
  • SharpCoreDB.Extensions - Helper methods and utilities
  • SharpCoreDB.Serilog.Sinks - Database logging sink

🌐 Multi-Language Support

Python Client (PyPI):

pip install pysharpcoredb

JavaScript/TypeScript (npm):

npm install @sharpcoredb/client

πŸ“š Documentation

Full docs: https://github.com/MPCoreDeveloper/SharpCoreDB/blob/master/docs/INDEX.md

Server Quick Start: https://github.com/MPCoreDeveloper/SharpCoreDB/blob/master/docs/server/QUICKSTART.md

Canonical package docs:

πŸ’» Quick Example

using SharpCoreDB;

// Create database
var factory = new DatabaseFactory();
var db = factory.Create("myapp.scdb", "master-password");

// Execute SQL
db.ExecuteSQL("CREATE TABLE users (id INT PRIMARY KEY, name TEXT)");
db.ExecuteSQL("INSERT INTO users VALUES (1, 'Alice')");

// Query data
var results = db.ExecuteQuery("SELECT * FROM users WHERE id = 1");
foreach (var row in results)
{
    Console.WriteLine($"{row["id"]}: {row["name"]}");
}

db.Flush(); // Persist to disk

πŸ† Production Features

  • ACID Compliance - Full transaction support with WAL
  • Backup & Recovery - Point-in-time recovery, checkpoint management
  • Concurrency - Thread-safe operations, connection pooling
  • Multi-Tenant - Row-level security, schema isolation
  • Enterprise Sync - Bidirectional sync with PostgreSQL, SQL Server, MySQL
  • Monitoring - Health checks, metrics, performance stats

πŸ”’ Security

  • AES-256-GCM encryption for sensitive data
  • Password-based key derivation (PBKDF2)
  • No plaintext passwords or keys in memory
  • Audit logging support

πŸ“ˆ Performance Optimizations

  • Tiered JIT with PGO (1.2-2x improvement)
  • SIMD vectorization where applicable
  • Memory-mapped I/O for fast reads
  • Batched writes for high throughput
  • Query plan caching

πŸ› οΈ Use Cases

  • Time Tracking Apps - Embedded, encrypted, offline-first
  • Invoicing Systems - Multi-tenant, backup-friendly
  • AI/RAG Agents - Vector search, knowledge base
  • IoT/Edge Devices - ARM64 native, minimal footprint
  • Mobile Apps - Sync with cloud database
  • Desktop Applications - Single-file deployment

πŸ“¦ Installation

dotnet add package SharpCoreDB --version 2.0.0.0

Optional companion packages:

dotnet add package SharpCoreDB.Functional --version 2.0.0.0
dotnet add package SharpCoreDB.Functional.Dapper --version 2.0.0.0
dotnet add package SharpCoreDB.Functional.EntityFrameworkCore --version 2.0.0.0
dotnet add package SharpCoreDB.Graph.Advanced --version 2.0.0.0

πŸ”„ Upgrading from v1.9

Backward compatible for existing databases β€” with one important note:

  • Directory-storage databases open unchanged (the table file format is byte-for-byte identical).
  • Single-file (.scdb) databases are migrated automatically to the v2 dynamic-metadata format on first open; the original file is preserved as <file>.backup. The migration is one-way β€” after opening with v2.0.0.0 the file can no longer be read by v1.9 (use the .backup for a v1.9 copy).
  • The public API is additive (EncryptionPassword, BlockCompressionLevel, MetadataCompressionLevel, BlockCompressionMode.Zstd, …) β€” existing application code compiles and runs unchanged.

πŸ› Bug Reporting

Found an issue? Report it on GitHub: https://github.com/MPCoreDeveloper/SharpCoreDB/issues

πŸ“„ License

MIT License - See LICENSE file in the repository

πŸ™ Contributing

We welcome contributions! Check the repository for contribution guidelines.


Latest Version: 2.0.0.0 (September 2026)
Target: .NET 10 / C# 14
Tests: 1,700+ (100% passing)
Status: βœ… Stable β€” performance-first v2.0.0 release
Versioning: SharpCoreDB now uses 4-part versions (n.n.n.n).

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

Showing the top 5 NuGet packages that depend on SharpCoreDB:

Package Downloads
SharpCoreDB.VectorSearch

Vector search extension for SharpCoreDB β€” SIMD-accelerated similarity search with HNSW indexing. Pure managed C# 14, zero external dependencies, NativeAOT compatible.

SharpCoreDB.Extensions

Extensions for SharpCoreDB including Dapper integration and ASP.NET Core health checks. Built for .NET 10 with C# 14. Supports Windows, Linux, macOS, Android, iOS, and IoT/embedded devices with platform-specific optimizations.

SharpCoreDB.Data.Provider

Data provider layer for SharpCoreDB on .NET 10.

SharpCoreDB.EntityFrameworkCore

Entity Framework Core provider for SharpCoreDB encrypted database engine. Built for .NET 10 with C# 14. Supports Windows, Linux, macOS, Android, iOS, and IoT/embedded devices with platform-specific optimizations. Compatible with SharpCoreDB 1.7.1.

SharpCoreDB.Serilog.Sinks

A Serilog sink for SharpCoreDB - a lightweight, encrypted, file-based database. Features efficient batch logging with AES-256-GCM encryption, AppendOnly storage engine for maximum write speed, and full async support. Compatible with SharpCoreDB 1.7.1+.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 0 9/1/2026
2.0.0-preview.3 64 8/30/2026
2.0.0-preview.2 47 8/30/2026
2.0.0-preview.1 58 8/29/2026
1.9.9 90 8/30/2026
1.9.8 125 8/29/2026
1.9.7 113 8/29/2026
1.9.6 154 8/28/2026
1.9.5 183 8/27/2026
1.9.4 323 8/22/2026
1.9.3 405 7/28/2026
1.9.2 398 6/7/2026
1.9.1 320 5/21/2026
1.9.0 322 5/20/2026
1.8.0 371 4/29/2026
1.7.2 318 4/28/2026
1.7.1 302 4/26/2026
1.7.0 242 4/19/2026
1.6.0 1,978 3/23/2026
1.5.0 328 3/14/2026
Loading failed

v2.0.0 (performance-first): removes debug file logging from all hot paths (SELECT, parameterized ExecuteSQL, batch transactions, INSERT) that caused per-operation disk I/O and throttled point reads/updates/deletes. See docs/performance/V2_PERFORMANCE_PLAN.md for the v2.x performance roadmap: prepared/compiled query execution, allocation reduction, storage/index tuning, and C# 15 / .NET 11 readiness.