ENTITY.PROTOCOL // 0xBEAM

KUMA

Entity-Native Storage Engine for the BEAM v0.1

One entity. One actor. One writer. No conflicts. Ever.

PERF.METRICS // 0xDATA
Writes/sec 0
SQLite Shards 0
Lock Conflicts 0
Read Latency
<1 ms
CORE.MODULES // 0xFEAT

Event Sourced

Every state change is an immutable event. Full audit trail. Time-travel debugging. Replay from any point.

Actor Per Entity

Each entity gets its own OTP process. Single writer guarantees zero conflicts. Pure message passing.

SQLite Shards

Entities shard across multiple SQLite databases by consistent hashing. Parallel writes. No bottleneck.

GDPR Native

Entity-scoped storage makes right-to-erasure trivial. Delete one entity, all events gone. Crypto-shredding built in.

Clustering

Built on BEAM distribution. Entities auto-migrate between nodes. Self-healing. Scale by adding nodes.

Projections

Subscribe to event streams. Build read-optimized views. Eventual consistency by design. Rebuild anytime.

CODE.SAMPLE // 0xGLEAM
app.gleam
import kuma
import kuma/entity

pub fn main() {
  // Boot the storage engine
  let store = kuma.start(
    "./data",
    shards: 16,
  )

  // Spawn an entity actor
  let user = entity.spawn(
    store,
    id: "user_0x9A4F",
  )

  // Append events (single writer)
  entity.append(user, UserCreated(
    name: "Dwighson",
    role: "architect",
  ))

  // Read current state (<1ms)
  let state = entity.read(user)
  // => User("Dwighson", "architect")
}
architecture

  ┌─────────────────────────────────────┐
  │          KUMA CLUSTER               │
  │                                     │
  │  ┌──────────┐    ┌──────────┐       │
  │  │ Entity   │    │ Entity   │       │
  │  │ Actor A  │    │ Actor B  │  ...  │
  │  └────┬─────┘    └────┬─────┘       │
  │       │               │             │
  │  ┌────▼───────────────▼─────┐       │
  │  │    Event Router            │       │
  │  │    (consistent hashing)     │       │
  │  └────┬──────┬──────┬───────┘       │
  │       │      │      │               │
  │  ┌────▼─┐┌───▼──┐┌──▼───┐          │
  │  │Shard ││Shard ││Shard │  ...     │
  │  │ 0x00 ││ 0x01 ││ 0x0F │          │
  │  │.sqlite││.sqlite││.sqlite│          │
  │  └──────┘└──────┘└──────┘          │
  └─────────────────────────────────────┘
USE.CASES // 0xAPPS

Real-Time Systems

Chat applications, live collaboration, multiplayer game state. Each user is an entity with instant reads.

🏦

Financial Ledgers

Account balances, transaction history, audit compliance. Immutable event log with crypto-shredding for privacy.

🌐

IoT & Edge

Device state management at scale. Each sensor is an entity. SQLite shards keep data local and fast.