Entity-Native Storage Engine for the BEAM
One entity. One actor. One writer.
No conflicts. Ever.
CAPABILITIES
Append-only log of facts. Complete audit trail. Time travel to any point in history.
One process. One mailbox. One writer. No locks, no conflicts, no surprises.
WAL mode, durable before ack, readable backups. Your data, your files.
export() and delete() are single operations. Compliance by design.
Multi-node with consistent hashing. Zero-downtime migration. Scale horizontally.
Async read models via rqlite. Eventually consistent queries. Decoupled reads.
QUICK START
import kuma
import kuma/entity.{Entity}
import kuma/event.{Event}
// Define your entity type
pub type Account {
Account(id: String, balance: Int, name: String)
}
// Define your events
pub type AccountEvent {
Deposited(amount: Int)
Withdrawn(amount: Int)
Renamed(name: String)
}
pub fn main() {
// Start Kuma with 16 shards
let assert Ok(ctx) = kuma.start(kuma.Config(
path: "/data/accounts",
shards: 16,
))
// Create an entity β spawns a dedicated actor
let assert Ok(account) = kuma.spawn(ctx, "acc_001", Account(
id: "acc_001",
balance: 0,
name: "Savings",
))
// Append events β durable before ack
kuma.append(account, Deposited(amount: 1000))
kuma.append(account, Deposited(amount: 500))
kuma.append(account, Withdrawn(amount: 200))
// Read state β from actor memory, <1ms
let assert Ok(state) = kuma.read(account)
// state.balance == 1300 β
// GDPR: export all data for a user
let assert Ok(data) = kuma.export(account)
// GDPR: right to be forgotten
kuma.delete(account)
}
INTERNALS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β KUMA β Entity-Native Storage Engine β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β β β Client Request β β β β β βΌ β β βββββββββββββββ hash(entity_id) ββββββββββββββββ β β β Router βββββββββββββββββββββΆβ Shard N β β β β β β (1 of 16+) β β β βββββββββββββββ ββββββββ¬ββββββββ β β β β β βΌ β β ββββββββββββββββ β β β Entity Actor β β β β (1:1 per ID) β β β ββββββββ¬ββββββββ β β β β β ββββββββββββββΌβββββββββββββ β β βΌ βΌ βΌ β β ββββββββββββ ββββββββββββ ββββββββββββ β β β State β β Events β β Publish β β β β (memory) β β (SQLite) β β (async) β β β ββββββββββββ ββββββββββββ βββββββ¬βββββ β β β β β βΌ β β ββββββββββββ β β βProjectionsβ β β β (rqlite) β β β ββββββββββββ β β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
USE CASES
Per-Entity CRUD
Each entity is an isolated actor with its own lifecycle and state.
Event Sourcing
Append-only event log with full replay and time travel capabilities.
Audit Trails
Every mutation is recorded. Nothing is ever lost or overwritten.
GDPR Compliance
Export and delete are first-class operations, not afterthoughts.
High-Write Throughput
50K+ writes/sec per entity. Actor isolation means no contention.
Multi-Tenant Systems
Natural isolation at the entity level. Perfect for SaaS backends.