SharpCoreDB.Server.Protocol
2.0.0.1
dotnet add package SharpCoreDB.Server.Protocol --version 2.0.0.1
NuGet\Install-Package SharpCoreDB.Server.Protocol -Version 2.0.0.1
<PackageReference Include="SharpCoreDB.Server.Protocol" Version="2.0.0.1" />
<PackageVersion Include="SharpCoreDB.Server.Protocol" Version="2.0.0.1" />
<PackageReference Include="SharpCoreDB.Server.Protocol" />
paket add SharpCoreDB.Server.Protocol --version 2.0.0.1
#r "nuget: SharpCoreDB.Server.Protocol, 2.0.0.1"
#:package SharpCoreDB.Server.Protocol@2.0.0.1
#addin nuget:?package=SharpCoreDB.Server.Protocol&version=2.0.0.1
#tool nuget:?package=SharpCoreDB.Server.Protocol&version=2.0.0.1
SharpCoreDB v2.0.0.1 β 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.
What's New in 2.0.0.1
π 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.EncryptionPasswordcreates a random per-file data-encryption-key (DEK) wrapped by a PBKDF2-HMAC-SHA256-derived key (per-file salt, OWASP-2024 iteration default). RawEncryptionKeymode 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);CompressionThresholdcontrols 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,BlockRegistrySizePagesandTableDirectorySizePagessupport 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>, andSeq<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.1
Optional companion packages:
dotnet add package SharpCoreDB.Functional --version 2.0.0.1
dotnet add package SharpCoreDB.Functional.Dapper --version 2.0.0.1
dotnet add package SharpCoreDB.Functional.EntityFrameworkCore --version 2.0.0.1
dotnet add package SharpCoreDB.Graph.Advanced --version 2.0.0.1
π 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.1 the file can no longer be read by v1.9 (use the.backupfor 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.1 (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 | Versions 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. |
-
net10.0
- Google.Protobuf (>= 3.36.0)
- Grpc.Core.Api (>= 2.83.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SharpCoreDB.Server.Protocol:
| Package | Downloads |
|---|---|
|
SharpCoreDB.Server.Core
Core server infrastructure for SharpCoreDB network server |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0.1 | 0 | 9/1/2026 |
| 2.0.0 | 43 | 9/1/2026 |
| 2.0.0-preview.3 | 39 | 8/30/2026 |
| 1.9.9 | 77 | 8/30/2026 |
| 1.9.8 | 77 | 8/29/2026 |
| 1.9.7 | 78 | 8/29/2026 |
| 1.9.6 | 81 | 8/28/2026 |
| 1.9.5 | 105 | 8/27/2026 |
| 1.9.4 | 97 | 8/22/2026 |
| 1.9.3 | 119 | 7/28/2026 |
| 1.9.2 | 122 | 6/7/2026 |
| 1.9.1 | 119 | 5/21/2026 |
| 1.9.0 | 119 | 5/20/2026 |
| 1.8.0 | 133 | 4/29/2026 |
| 1.7.2 | 128 | 4/28/2026 |
| 1.7.1 | 128 | 4/26/2026 |
| 1.6.0 | 127 | 3/23/2026 |
| 1.5.0 | 134 | 3/14/2026 |
v1.9.6: Fixes the critical WHERE IN (...) regression (#339) that silently returned ALL rows: IN / NOT IN are now evaluated correctly for literal and parameterized lists across single-file and directory mode, and single-file parameterized queries normalize @-prefixed parameter names. Includes all v1.9.5 fixes (token-aware parameter binding resolving @t/@tid collisions, server parameter pass-through, standards-compliant ULID encoding, legacy UI removal, English-only documentation, updated dependencies).