Product
Lightweight file-based NoSQL database engine for embedded applications.
KDB is a lightweight file-based database designed for applications that need fast, reliable data storage without the complexity of traditional database systems. With a compact codebase and zero external dependencies, KDB is ideal for embedded applications and local data storage.
KDB uses a simple delimiter-separated variable-length record format with automatic indexing for fast key-based lookups. The engine includes built-in auto-repair capabilities and file-level locking for safe concurrent access.
Unlike traditional embedded databases that rely on native libraries, KDB is implemented entirely in managed C#. This provides significant advantages for .NET developers:
KDB is ideal when you need simple key-value storage and want to avoid the complexity of managing native database dependencies.
No server setup, no connection strings, no administration. Just create and use. Single file deployment.
Built-in integrity checking and automatic repair on corruption. Data safety without manual intervention.
Binary search on indexed keys provides O(log n) read performance. Sorted index for sequential access.
Single class file with no external dependencies. Embed directly into your application.
File-level locking allows multiple readers with exclusive write access. Safe for multi-process environments.
Full UTF-8 support for international text. Store any language without encoding issues.
KDB provides a straightforward CRUD interface. Create a database, write records, read by key or index, and delete when needed.
// Create database: 3 columns, 1 primary key (max 10 bytes)
int[] pkSizes = new int[] { 10 };
Kdb.Create("mydb", 3, 1, pkSizes);
// Open and write
var db = new Kdb("mydb");
string[] rec = new string[] { "key1", "value1", "value2" };
db.Write(rec);
// Read by key
string[] result = new string[3];
result[0] = "key1";
if (db.Read(result)) {
// result now contains full record
}
// Iterate all records
int count = db.GetRecordCount();
for (int i = 0; i < count; i++) {
string[] row = db.ReadIndex(i);
}
KDB is designed for specific scenarios where simplicity and reliability matter more than scale: