🗄️
eDB
Embedded Database
Lightweight embedded database engine with key-value, document, and time-series storage — all with ACID guarantees and flash wear-leveling.
Platform FoundationCActive Development
Key Features
Key-Value Store — B+ tree, O(log n) lookups
Document Store — BSON with nested field queries
Time-Series Engine — Append-only with downsampling
ACID Transactions — WAL with crash recovery
Flash Wear Leveling — Intelligent block allocation
Tiny Footprint — 32 KB ROM, 4 KB min RAM
AES-256 Encryption at Rest
Architecture
Application Interface (KV, Document, Time-Series APIs) ├── Query Engine (Parser, Planner, Executor) ├── Storage Engine (B+ Tree, LSM Tree, WAL) ├── Flash Translation Layer (Wear Leveling, Compaction) └── Hardware (NOR/NAND Flash, eMMC, SD)
Code Example
c
#include <edb/edb.h>
edb_t *db;
edb_config_t config = {
.path = "/flash/health_data",
.max_size = 1024 * 1024,
.encryption = EDB_ENCRYPT_AES256,
.wear_leveling = true
};
edb_open(&db, &config);
edb_kv_put(db, "user.name", "Patient_001", 11);
edb_ts_t *ts;
edb_ts_create(db, &ts, "heartrate",
EDB_TS_FLOAT32, EDB_TS_DOWNSAMPLE_AVG);
float hr = 72.5f;
edb_ts_append(ts, eos_kernel_get_tick(), &hr);API Highlights
| Function | Description |
|---|---|
edb_open() / edb_close() | Open/close database |
edb_kv_put() / edb_kv_get() | Key-value store/retrieve |
edb_ts_append() | Append time-series data point |
edb_doc_insert() | Insert JSON document |
edb_txn_begin() | Begin transaction |