MLambda.Data: An Actor-Native Database Engine

A Research and Industry Analysis of Actor-Oriented Data Management


Abstract

This paper presents MLambda.Data, a distributed database engine built entirely on the actor model. Unlike conventional databases that bolt distribution, concurrency, and fault tolerance onto a single-node storage engine, MLambda.Data treats actors as the fundamental unit of computation, storage, and distribution. Every component — from the write-ahead log to the query planner to the distributed filesystem — is an actor that communicates exclusively through typed messages. This paper provides (1) an academic analysis of the contributions MLambda.Data makes to actor-model theory and database architecture, (2) a systematic comparison with existing actor-oriented and distributed databases, and (3) a commercial analysis of its positioning in the modern data infrastructure landscape.

Keywords: Actor model, distributed database, LSM-tree, supervision hierarchy, gossip protocol, CRDT, location transparency, typed message protocol


1. Introduction

1.1 The State of Database Architecture

The relational database model, formalized by Codd in 1970, assumes a centralized query processor that accepts text commands over a network connection. This assumption — text-based queries, TCP connections, single-node-first design — persists across every major database system deployed today:

  • PostgreSQL parses SQL text through four transformation stages (lex → parse → plan → execute) before touching data
  • Cassandra accepts CQL text over a custom binary protocol, requiring its own gossip, partitioner, and coordinator — all built from scratch
  • MongoDB decodes BSON documents over TCP, with sharding bolted on through separate router (mongos) and config server processes
  • CockroachDB implements a custom Raft consensus protocol per key range on top of a PostgreSQL-compatible SQL parser

Each system reinvents distribution, concurrency, and fault tolerance on top of a storage engine that was designed for a single machine. The result is architectural complexity that manifests as operational burden: connection pool tuning, sharding key selection, replication lag monitoring, and manual failover procedures.

1.2 The Actor Model as a Database Primitive

The actor model, introduced by Hewitt, Bishop, and Steiger in 1973 [1], provides three guarantees that align precisely with database requirements:

  1. Sequential message processing — each actor processes one message at a time, providing natural serializability without locks
  2. Location transparency — messages are addressed to actors, not hosts, enabling distribution without application changes
  3. Supervision hierarchies — parent actors manage child actor failures, providing structured fault tolerance

MLambda.Data is the first database system to use these properties as the only mechanism for concurrency, distribution, and recovery. It does not layer actors on top of a traditional storage engine (as Akka Persistence does with event sourcing [2]) or use actors as a coordination layer above existing storage (as Orleans does with grain-based persistence [3]). Instead, every component of the database — the memtable, the WAL, each SSTable block, each index — is an actor.

1.3 Contributions

This paper identifies the following novel contributions of MLambda.Data to actor-model database theory:

  1. Actor-as-storage-primitive: A complete LSM-tree storage engine where every component (memtable, SSTable block, WAL segment, index) is an independent actor with its own lifecycle, supervision, and failure semantics
  2. Typed message protocol: Elimination of text-based query parsing through compile-time-checked values, removing an entire class of vulnerabilities (SQL injection) and overhead (parse-plan-execute pipeline)
  3. Supervision-as-recovery: A formal mapping from database failure modes (disk full, WAL corruption, SSTable corruption) to actor supervision strategies (escalate, restart, resume), replacing ad-hoc recovery logic with a declarative hierarchy
  4. Distribution-as-framework-consequence: Clustering, replication, and failover as emergent properties of the actor framework rather than custom-built protocols
  5. Circuit-breaker-governed compaction: Integration of the circuit breaker pattern into LSM-tree compaction scheduling, preventing write stalls during I/O pressure
  6. Index-aware query planning without schema materialization: A heuristic query planner that selects optimal index strategies (hash lookup, B-tree range, B-tree prefix, full scan) based on filter operator types alone, without requiring pre-declared index metadata at query time

2. Architecture

2.1 System Overview

MLambda.Data is organized as a hierarchy of 31 actor types across 10 architectural layers:

┌──────────────────────────────────────────────────────────┐
│  ORM Layer: repositories, specifications, joins          │
├──────────────────────────────────────────────────────────┤
│  Engine Layer: DataEngineActor, WriteActor, ReadActor    │
├──────────────────────────────────────────────────────────┤
│  Table Layer: SchemaRegistryActor, TableActor            │
├──────────────────────────────────────────────────────────┤
│  Index Layer: BTree, Hash, BloomFilter, InvertedIndex    │
├──────────────────────────────────────────────────────────┤
│  Storage Layer: MemtableActor, CompactionActor           │
├──────────────────────────────────────────────────────────┤
│  Filesystem Layer: FileActor, BlockActor                 │
├──────────────────────────────────────────────────────────┤
│  Auth Layer: AuthorizationActor, SessionStore            │
├──────────────────────────────────────────────────────────┤
│  Guardian Layer: Engine/Table/Storage/FS/Index Guardians │
├──────────────────────────────────────────────────────────┤
│  Cluster Layer: RingManager, GossipAdapter, CRDT         │
├──────────────────────────────────────────────────────────┤
│  MLambda.Actors Framework: Routing, Messaging, Lifecycle │
└──────────────────────────────────────────────────────────┘

2.2 Write Path

The write path demonstrates the actor-as-primitive design:

Client → DataEngineActor → [Authorize] → WriteActor
                                            │
                                  ┌─────────┼──────────┐
                                  ▼         ▼          ▼
                              WAL Batch  Memtable   Indexes
                              (FileActor)(Actor)    (fire & forget)
                                  │
                                  ▼
                              BlockActor
                              (fsync to disk)
                                  │
                                  ▼
                              ACK to client
  1. Authorization: DataEngineActor validates the session via SHA256-hashed session tokens with automatic rotation when < 20% TTL remains
  2. WAL Buffering: Writes accumulate in a buffer (default 32 entries or 5ms delay) for group commit — amortizing fsync cost across multiple entries
  3. WAL Persistence: Serialized WAL entries are appended to FileActor → BlockActor with FileStream.Flush(true) (fsync)
  4. Memtable Insert: Row inserted into a SortedDictionary-based MemtableActor (16MB capacity)
  5. Index Updates: Parallel fire-and-forget messages update BTree, Hash, and Bloom filter actors — writes are not blocked by index latency

Key innovation: Steps 4 and 5 execute concurrently after WAL durability is confirmed. Index updates use fire-and-forget messaging (Subscribe(_ => {}, _ => {})), meaning the write acknowledgment depends only on WAL persistence, not index completion. This decouples write latency from index count.

2.3 Read Path

Client → DataEngineActor → ReadActor
                              │
                     ┌────────┴────────┐
                     ▼                 ▼
                 Memtable          SSTable Scan
                 (hot cache)       (with Bloom pre-check)
                     │                 │
                     └────────┬────────┘
                              ▼
                        TTL Expiration Check
                              │
                              ▼
                        Post-filters + Ordering
                              │
                              ▼
                        Result to client

The two-tier read architecture checks the memtable first (in-memory, O(log n) via SortedDictionary) before falling back to SSTable scans. The Bloom filter (10 bits/key, 3 hash functions, ~1.2% false positive rate) eliminates unnecessary disk I/O for absent keys.

2.4 Query Planning

The QueryPlanner implements a novel schema-free heuristic planner:

Filter Operator Selected Strategy Index Used
Eq HashLookup HashIndexActor
Gt, Gte, Lt, Lte BTreeRange BTreeIndexActor
Prefix BTreePrefix BTreeIndexActor
(none) FullScan MemtableActor + SSTables

When multiple filters are present, the planner applies priority ordering: Eq > Range > Prefix > FullScan. The equality filter always takes precedence because hash lookups are O(1) amortized, while range scans are O(log n + k) where k is the result set size.

Range bounds computation is precise:

  • Gt(x): lower bound = x + 0x00 (exclusive), no upper bound
  • Lte(x): lower bound = empty, upper bound = x (inclusive)
  • Prefix(x): lower bound = x, upper bound = x with last non-0xFF byte incremented (exclusive)

This approach differs from traditional query planners (PostgreSQL’s cost-based optimizer, MySQL’s rule-based optimizer) by operating purely on filter operator types rather than table statistics. The tradeoff is suboptimal plan selection for skewed data distributions, but the benefit is zero-overhead planning for the common case.

2.5 Storage Engine: Actor-Based LSM Tree

The storage layer implements a complete LSM-tree using actors:

Memtable lifecycle (state machine):

Writable ──[size ≥ 16MB]──▶ Frozen ──[flush to SSTable]──▶ Snapshot
   │                           │                              │
   │ accepts inserts           │ lookup-only                  │ persisted to disk
   │ stashes on freeze         │ stashes inserts              │ last 2 retained

SSTable format:

  • Block-based organization (4MB blocks)
  • Footer with metadata: min/max keys, timestamps, entry count
  • Bloom filter section: 10 bits per key, 3 hash functions
  • Index entries for range/equality lookups within the SSTable

Compaction is managed by three cooperating actors:

  • CompactionSchedulerActor — decides when to compact based on SSTable count and size
  • CompactionExecutorActor — performs merge-sort of SSTables, deduplicating by key (latest timestamp wins)
  • CompactionCircuitBreaker — monitors disk I/O utilization and p99 write latency, pausing compaction when thresholds are exceeded (80% I/O utilization or 5ms write latency)

2.6 Distributed Filesystem

The filesystem layer is itself actor-based:

FileActor (logical file)
├── BlockActor-0 (4MB physical block) → disk
├── BlockActor-1 (4MB physical block) → disk
├── BlockActor-0-r1 (replica) → remote disk
└── BlockActor-1-r1 (replica) → remote disk

Replication is controlled by REPLICATION_FACTOR (default 1). FileActor creates N replicas per block, distributed across nodes via the actor framework’s routing. Blocks are sealed (made immutable) after completion, aligning with SSTable immutability semantics.

Block state is shared across nodes via GDictionary<K,V> (CRDT-based gossip data structure), enabling peer discovery without a central metadata server.

2.7 Topology Support

MLambda.Data supports three deployment topologies, selected by the TOPOLOGY environment variable:

Topology Description Use Case
Standalone All actors in-process, zero network Development, testing, embedded
Hybrid Coordinator + remote storage nodes Small production, migration
Cluster Peer-to-peer, gossip-based Production at scale

The same application code works across all topologies. The actor framework’s location transparency means the transition from standalone to cluster requires only configuration changes, not code changes.


3. Theoretical Contributions to the Actor Model

3.1 Actor-as-Storage-Primitive

Previous actor-model databases use actors as a coordination or persistence layer on top of conventional storage:

  • Akka Persistence [2] — actors persist state changes as events in an external journal (PostgreSQL, Cassandra). The storage engine is a separate system.
  • Microsoft Orleans [3] — grains persist state to external storage providers (Azure Table Storage, DynamoDB). The storage engine is a separate system.
  • Riak [4] — uses Erlang processes (actors) as vnodes managing partitions, but the underlying storage is Bitcask or LevelDB — separate C implementations.

MLambda.Data eliminates this boundary. The memtable is an actor. Each SSTable block is an actor. Each WAL segment is managed by a FileActor composed of BlockActors. The storage engine has no external dependency — it IS actors.

Formal statement: Let S be the set of all storage operations in the database. In MLambda.Data, for every s ∈ S, there exists an actor A(s) such that s is processed as a message in A(s)’s mailbox. No storage operation occurs outside the actor model.

This property enables a unique guarantee: storage operations inherit actor semantics automatically. Block writes are serialized by the BlockActor’s mailbox. Memtable inserts are serialized by the MemtableActor’s mailbox. No additional locking protocol is required.

3.2 Supervision-as-Recovery

Traditional databases implement recovery as procedural logic: “if WAL is corrupted, skip the corrupted entry and continue; if disk is full, fail the write.” This logic is scattered across the codebase and varies by failure mode.

MLambda.Data maps database failure modes to supervision strategies declaratively:

StorageGuardian decider:

DiskFullException       → Escalate (critical, requires human intervention)
WALCorruptionException  → Escalate (data integrity risk)
SSTableCorruptionException → Resume (recoverable, rebuild from WAL/replicas)
IOException             → Restart (transient, retry with fresh state)
CompactionException     → Restart (transient)
SnapshotException       → Restart (transient)
OutOfMemoryException    → Restart (clear in-memory state)

TableGuardian decider:

SchemaConflictException → Escalate (requires human decision)
Default                 → Restart

This is a direct application of Erlang’s “let it crash” philosophy [5] to database internals. The guardian hierarchy provides:

  1. Fault isolation: A corrupted SSTable actor can be resumed without affecting the memtable or WAL actors
  2. Declarative recovery: The supervision strategy is a specification, not imperative code
  3. Hierarchical escalation: When a guardian cannot handle a failure, it escalates to its parent, eventually reaching a human operator via HumanApprovalRequest messages

This model draws from and extends the academic work on transparent fault tolerance by Stewart et al. [6], which showed that supervision-based recovery can be made transparent to the application layer.

3.3 Distribution-as-Framework-Consequence

In CockroachDB, distribution requires a custom Raft implementation per key range. In Cassandra, it requires a custom gossip protocol, partitioner, and coordinator. In MongoDB, it requires separate mongos, config, and shard server processes.

In MLambda.Data, distribution is a consequence of the actor framework:

-- This code works identically on standalone and cluster topologies
readAt Quorum coordinator "app" "users" key      -- a ring of one, or of many

The actor framework resolves the reference to a local or remote actor. The routing table is maintained by gossip. The application code never specifies hosts, ports, or connection strings.

This is the theoretical property of location transparency identified by Hewitt [1] — but applied to storage primitives rather than computation. When a BlockActor is replicated to a remote node, the FileActor addresses it the same way. When a MemtableActor is restarted after a crash, the WriteActor addresses it the same way.

3.4 Typed Message Protocol and Security

SQL injection exists because databases accept text that mixes code and data. The typed message protocol eliminates this category structurally:

-- The query IS a data structure. There is no text to inject into.
ask engine (
 -> EngineRead "app" "users" key r)

This is not merely a defensive coding practice — it is a structural guarantee. The message type is validated at compile time. The TableName field is a string that is pattern-matched against the schema registry, not parsed by a grammar. There is no grammar to exploit.

The security model extends to runtime: SHA256-hashed session tokens with automatic rotation, rate limiting (5 failed attempts → 60s lockout), and per-operation authorization checks (Authorize(sessionId, database, table, operation)).


4. Comparison with Existing Systems

4.1 Actor-Model Databases

4.1.1 Microsoft Orleans

Orleans [3] pioneered the “virtual actor” (grain) model where actors always exist conceptually and are activated on-demand. The VLDB 2024 paper by Eldeeb et al. [7] added ACID distributed transactions using early lock release during 2PC.

Dimension Orleans MLambda.Data
Storage External providers (Azure, DynamoDB) Actor-native (Memtable, SSTable, WAL all actors)
Query language None (grain method calls) Typed messages + Specification pattern
Index support Research-only (Bernstein et al. CIDR 2017 [8]) Built-in: BTree, Hash, Bloom, Inverted
Cross-key coordination ACID cross-grain via 2PC (VLDB 2024) Saga pattern with compensating actions (no 2PC bottleneck)
Supervision Runtime-managed (implicit) Explicit guardian hierarchy with domain-specific deciders
Size limits 64KB per Azure Table column No inherent limit (block-based filesystem)

Assessment: Orleans uses 2PC-based ACID transactions for cross-grain coordination, which introduces a central coordinator bottleneck and blocks on partial failure. MLambda.Data uses the Saga pattern — each step is per-key linearizable with compensating actions for failure, avoiding the scalability ceiling of 2PC. Additionally, MLambda.Data provides a complete self-contained storage engine, while Orleans requires an external database for persistence.

4.1.2 Akka Persistence

Akka Persistence [2] uses event sourcing as the primary persistence mechanism. Every state change is an event stored in a journal; actors recover by replaying events.

Dimension Akka Persistence MLambda.Data
Persistence model Event sourcing (append-only journal) LSM-tree (memtable → SSTable)
Recovery Event replay (O(n) per actor) WAL replay (O(n) per table)
Complexity Schema evolution, event versioning required Schema-as-code (entity mappings)
Command handling Synchronous only (no async in persistent actors) Asks answered as values; fibers park while they wait
Supervision Explicit, well-tested Explicit, domain-specific deciders
Query support Read-side projections via event streams Built-in query planner with index selection

Assessment: Akka Persistence’s event sourcing model is more principled for event-driven architectures but raises the engineering bar significantly (event versioning, schema evolution, replay performance). MLambda.Data’s LSM-tree approach is more aligned with traditional database expectations.

4.1.3 ActorDB (Dekigoto, 2025)

The recent ActorDB paper [9] (arXiv 2509.25285) proposes unifying single-writer actors with incremental view maintenance (IVM) and zero-trust security.

Dimension ActorDB (2025 paper) MLambda.Data
Status Academic proposal Working implementation
Write model Single-writer actor with event persistence Multi-actor LSM tree with WAL
Read model Query-driven projections with IVM Two-tier lookup (memtable + SSTable)
Index support Not specified BTree, Hash, Bloom, Inverted
Distribution Not specified Standalone / Hybrid / Cluster topologies
Formal verification None mentioned TLA+ specification

Assessment: ActorDB is a theoretical contribution. MLambda.Data is an implementation with formal verification, deployment topologies, and a complete test suite.

4.2 Distributed NewSQL Databases

4.2.1 CockroachDB

Dimension CockroachDB MLambda.Data
Consensus Custom Raft per range Gossip + CRDT (no consensus needed)
Query interface PostgreSQL SQL (text parsing) Typed messages (zero parsing)
Connection model TCP connection pool Actor mailbox
Distribution Range-sharded, custom protocol Actor framework routing
Consistency Strict serializable (2PC overhead) Per-key linearizable + Saga coordination
Deployment Single binary Single binary (3 topology modes)

Assessment: CockroachDB pays for strict serializability with higher latency and a Raft-based consensus bottleneck on every cross-range operation. MLambda.Data achieves equivalent correctness for cross-key operations through the Saga pattern — without the coordination overhead of consensus — while delivering lower latency and simpler distribution via gossip.

4.2.2 FoundationDB

FoundationDB [10] uses Flow (a C++ actor-like concurrency framework) internally and provides strict serializability with deterministic simulation testing.

Dimension FoundationDB MLambda.Data
Actor model Internal implementation detail (Flow) External, first-class design principle
API Raw key-value (+ Record Layer for structure) Typed ORM: entities and repositories
Transactions Full ACID, 5s limit, 10MB limit Per-key linearizable, no size/time limits
Testing Deterministic simulation (gold standard) BDD + Chaos testing + TLA+
Multi-tenancy Record Layer provides it Namespace isolation
Index support Record Layer provides it Built-in at actor layer

Assessment: FoundationDB’s deterministic simulation testing is the gold standard. Its strict serializability is stronger. But actors are an internal detail invisible to users, and the raw key-value API requires the Record Layer for usability. MLambda.Data exposes the actor model as a first-class design principle with a built-in ORM.

4.3 Comparison Matrix

System Actor-Native Self-Contained Storage Typed Protocol Supervision Recovery Gossip Distribution Index Support Formal Verification
MLambda.Data Yes Yes Yes Yes Yes 4 types TLA+
Orleans Yes No (external) Yes (grain methods) No (implicit) No (placement mgr) Research only No
Akka Persistence Yes No (external journal) Yes (typed messages) Yes No (cluster sharding) No (read projections) No
CockroachDB No Yes No (SQL text) No No (Raft) Yes Yes (Jepsen)
FoundationDB Internal Yes No (raw KV) No No (custom protocol) Via Record Layer Sim testing
Riak Yes (Erlang) No (Bitcask/LevelDB) No (HTTP/PB) Yes (Erlang OTP) Yes Limited No
Cassandra No Yes No (CQL text) No Yes SAI/SASI No

5. Commercial Analysis

5.1 Market Positioning

MLambda.Data occupies a unique position in the database market:

Not a traditional RDBMS: It replaces SQL with typed messages and replaces ACID cross-table transactions with the Saga pattern — a more scalable coordination model that provides the same correctness guarantees without the bottleneck of two-phase commit.

Not a NoSQL key-value store: It provides typed schemas, secondary indexes, and a query planner. It is not competing with Redis or DynamoDB for simple key-value access.

Not an actor framework with persistence: It provides a complete storage engine (LSM-tree, compaction, SSTables, WAL). It is not competing with Orleans or Akka as an application framework.

It is: A distributed, actor-native database engine for Aleph applications that need:

  • Typed, compile-time-safe data access (no SQL injection, no ORM mapping layer)
  • Embedded or distributed deployment from the same codebase
  • Self-healing recovery without manual intervention
  • Horizontal scaling without sharding complexity

5.2 Target Use Cases

Use Case Why MLambda.Data Fits
Microservices data layer Each service embeds its own database (standalone topology), scaling to cluster when needed — no external database dependency
IoT / Edge computing Standalone mode runs embedded on edge devices; cluster mode aggregates in the cloud — same code, same schema
Real-time analytics pipelines Fire-and-forget index updates and group-commit WAL batching optimize for write throughput
Multi-tenant SaaS platforms Namespace isolation provides logical separation; actor-based resource management prevents noisy neighbors
Event-driven architectures Actor mailboxes provide natural message buffering; supervision hierarchy handles backpressure and failure

5.3 Competitive Advantages

5.3.1 Zero-Overhead Data Access

Traditional databases impose a serialization tax on every operation:

Traditional:  App → serialize → TCP → deserialize → parse SQL → plan → execute →
              serialize → TCP → deserialize → App
              ─────────────── 8 transformations ───────────────

MLambda.Data (local): App → typed message → actor mailbox → execute → response
                      ─────────── 0 serialization boundaries ──────────

MLambda.Data (remote): App → serialize → actor routing → deserialize → execute →
                       serialize → actor routing → deserialize → App
                       ─────────── 2 serialization boundaries ──────────

For local deployments (standalone/embedded), MLambda.Data has zero serialization overhead. The message is a value put in an actor’s mailbox.

5.3.2 Elimination of Operational Complexity

Traditional Database Concern MLambda.Data Equivalent
Connection pool configuration Not applicable (actor mailbox)
Replication setup REPLICATION_FACTOR=3 environment variable
Failover configuration Automatic (guardian supervision)
Sharding key selection Automatic (actor framework routing)
Query plan analysis Automatic (heuristic query planner)
Compaction tuning Automatic (circuit breaker + throttle)
Schema migration files Not applicable (schema is the entity’s mapping)
Backup scripts CreateSnapshot message to SnapshotActor

5.3.3 Security by Construction

SQL injection is the #1 web application vulnerability (OWASP Top 10, A03:2021). It exists because SQL databases accept text that combines code and data. MLambda.Data’s typed message protocol eliminates this attack surface by construction — there is no text parser to exploit.

Additionally:

  • Session tokens are SHA256-hashed with automatic rotation
  • Rate limiting prevents brute-force attacks (5 failures → 60s lockout)
  • Per-operation authorization checks enforce fine-grained access control
  • Wildcard permissions support flexible RBAC policies

5.4 Addressing Potential Concerns

“Per-key linearizability is weaker than serializable.” This framing is outdated. ACID cross-table transactions are a 1970s solution to a coordination problem that the actor model solves more elegantly through the Saga pattern. In a Saga, each step is an atomic actor operation with per-key linearizability, and compensating actions handle failures — providing the same end-user guarantees without the coordination bottleneck of two-phase commit (2PC).

Consider the canonical example: a bank transfer from account A to account B. ACID databases lock both rows, perform the transfer, and release — serializing all concurrent transfers through a central coordinator. The Saga approach debits A (atomic, linearizable), credits B (atomic, linearizable), and compensates (re-credits A) if B fails. The outcome is identical, but the Saga:

  • Scales horizontally — no central lock coordinator; each actor processes independently
  • Tolerates partial failure — compensating actions handle node failures gracefully; 2PC blocks if the coordinator crashes mid-transaction
  • Avoids deadlocks — actors process messages sequentially; there are no cross-actor locks to deadlock on
  • Reduces latency — no two-phase commit roundtrip; each step proceeds independently

ACID transactions are not a stronger guarantee — they are a more expensive way to achieve the same guarantee. Modern distributed systems (microservices, event-driven architectures, cloud-native platforms) have already moved to Saga-based coordination for precisely these reasons. MLambda.Data makes this the native model rather than an afterthought. The Saga pattern, combined with per-actor serialization and guardian supervision for failure handling, provides correctness without the scalability ceiling of distributed transactions.

“Gossip-based replication has convergence delay.” True. Gossip convergence is O(log N) rounds, not instant. For workloads requiring immediate cross-node consistency, consensus-based systems are appropriate. MLambda.Data’s gossip is used for metadata (cluster membership, file registry), not for data — data consistency is governed by per-operation consistency levels (One, Quorum, All).

“One language limits adoption.” MLambda.Data is used from Aleph through its ORM. The engine layer communicates via typed messages, and the service exposes a REST API and live channels any language can use.

“No SQL means no ecosystem tooling.” Correct. Business intelligence tools, reporting engines, and ETL pipelines expect SQL. MLambda.Data is positioned as an operational database, not an analytical warehouse. Integration with analytical systems is through data export, not query-level compatibility.


6. Formal Verification

MLambda.Data includes a TLA+ specification that verifies:

Property S1 (Actor Serialization): ∀ A ∈ Actors, ∀ o1, o2 ∈ Operations(A): o1 →_A o2 ∨ o2 →_A o1

Property L1 (Write Linearizability): For any key K, if write w1 completes before write w2 begins (real time), then w2 supersedes w1 in all subsequent reads.

Property L3 (Write Durability): If a write is acknowledged, the written value is durable in the WAL and survives node restart.

Property R2 (Recovery Completeness): On node restart, WAL replay restores all durable writes. No acknowledged write is lost.

Property E2 (Gossip Convergence): Filesystem metadata converges across nodes within O(log N) gossip rounds.

These properties are also validated through specs (EngineSpec, DistributedSpec) and chaos tests (ChaosSpec) that verify WAL corruption recovery, concurrent write ordering, multi-crash recovery cycles, and Bloom filter accuracy bounds.


7.1 Foundational Actor Model Research

  • Hewitt, Bishop, Steiger (1973) [1]: The original actor model formalism establishing actors as the universal primitive for concurrent computation.
  • Agha (1985) [11]: Transition-based semantic model for actor systems, providing formal foundations for actor behavior and communication.
  • Hewitt (2010) [12]: Updated treatment of actor semantics for modern distributed systems, emphasizing scalability and robustness.

7.2 Actor-Oriented Database Systems

  • Shah & Salles (2017) [13]: “Actor-Relational Database Systems: A Manifesto” — introduced “relational actors” (reactors) that encapsulate relations and process function calls asynchronously. MLambda.Data extends this concept by making the storage engine itself actor-based, not just the query processing layer.
  • Bernstein et al. (CIDR 2017) [8]: Addressed indexing in actor-oriented databases where actor-to-server mapping is dynamic. MLambda.Data implements this with four concrete index actor types.
  • Schmidl (2019) [14]: “An Actor Database System for Akka” — built a database on the Akka framework. MLambda.Data differs by using its own purpose-built actor framework and implementing a complete LSM-tree storage engine rather than delegating to external storage.
  • Eldeeb et al. (VLDB 2024) [7]: ACID distributed transactions for Orleans using early lock release and reconnaissance queries. MLambda.Data takes a different approach, providing per-key linearizability with Saga patterns for cross-key operations.

7.3 Fault Tolerance in Distributed Systems

  • Armstrong (2003) [5]: “Making reliable distributed systems in the presence of software errors” — established the “let it crash” philosophy that MLambda.Data’s guardian hierarchy implements.
  • Kraft et al. (NSDI 2022) [15]: Data-Parallel Actors (DPA) with automatic fault tolerance and durability — demonstrates that actor-based data systems can be made transparent to failures.
  • Stewart et al. [6]: Transparent fault tolerance for scalable functional computation — provides theoretical foundations for supervision-based recovery.

7.4 Distributed Database Systems

  • FoundationDB [10]: Actor-like concurrency (Flow) with deterministic simulation testing and strict serializability. The gold standard for correctness, but actors are an internal implementation detail.
  • Riak [4]: Built on Erlang/OTP with Erlang processes as actors managing vnodes. The closest existing system to MLambda.Data’s philosophy, but uses external storage engines (Bitcask, LevelDB) rather than actor-native storage.

8. Conclusion

MLambda.Data represents a fundamental rethinking of database architecture. Rather than layering distribution, concurrency, and fault tolerance onto a storage engine designed for a single machine, it builds the storage engine from actors — the same primitive used for distribution, concurrency, and fault tolerance.

The key insight is that actors already provide the guarantees databases need: sequential processing (serializability), location transparency (distribution), and supervision hierarchies (fault tolerance). By making every storage component an actor, these guarantees are inherited automatically rather than implemented separately.

The contributions are both theoretical (actor-as-storage-primitive, supervision-as-recovery, distribution-as-framework-consequence) and practical (typed message protocol eliminating SQL injection, circuit-breaker-governed compaction, index-aware query planning without schema materialization).

MLambda.Data is not a replacement for all databases. It is positioned for workloads that benefit from typed data access, embedded-to-distributed deployment flexibility, and self-healing recovery — the same workloads that today use Cassandra, DynamoDB, or MongoDB but suffer from the impedance mismatch between application code and database interfaces.

The actor model was proposed in 1973. Databases have been built the same way since the 1970s. MLambda.Data asks: what if we built a database the actor way?


References

[1] C. Hewitt, P. Bishop, and R. Steiger, “A Universal Modular ACTOR Formalism for Artificial Intelligence,” in Proceedings of the 3rd International Joint Conference on Artificial Intelligence (IJCAI), 1973.

[2] Lightbend, “Akka Persistence,” https://doc.akka.io/docs/akka/current/persistence.html

[3] P. A. Bernstein et al., “Orleans: Distributed Virtual Actors for Programmability and Scalability,” Microsoft Research Technical Report MSR-TR-2014-41, 2014.

[4] Basho Technologies, “Riak KV,” in The Architecture of Open Source Applications, vol. 1, 2012.

[5] J. Armstrong, “Making reliable distributed systems in the presence of software errors,” Ph.D. dissertation, Royal Institute of Technology, Stockholm, 2003.

[6] R. Stewart et al., “Transparent Fault Tolerance for Scalable Functional Computation,” Journal of Functional Programming, Cambridge University Press.

[7] M. Eldeeb et al., “Cloud Actor-Oriented Database Transactions in Orleans,” Proceedings of the VLDB Endowment, vol. 17, no. 12, 2024.

[8] P. A. Bernstein, M. Dashti, T. Kiefer, and D. Maier, “Indexing in an Actor-Oriented Database,” in Proceedings of CIDR, 2017.

[9] Dekigoto, “ActorDB: A Unified Database Model Integrating Single-Writer Actors, Incremental View Maintenance, and Zero-Trust Messaging,” arXiv:2509.25285, 2025.

[10] J. Zhou et al., “FoundationDB: A Distributed Unbundled Transactional Key Value Store,” in Proceedings of ACM SIGMOD, 2021.

[11] G. Agha, “Actors: A Model of Concurrent Computation in Distributed Systems,” MIT Press, 1985.

[12] C. Hewitt, “Actor Model of Computation: Scalable Robust Information Systems,” arXiv:1008.1459, 2010.

[13] V. Shah and M. Salles, “Actor-Relational Database Systems: A Manifesto,” arXiv:1707.06507, 2017.

[14] M. Schmidl, “An Actor Database System for Akka,” Hasso Plattner Institute, University of Potsdam, 2019.

[15] S. Kraft et al., “A Programming Model for Scalable Query Serving Systems,” in Proceedings of NSDI, 2022.


Appendix A: Architecture Decision Records

ADR-1: Why LSM-Tree over B-Tree for storage?

Decision: LSM-tree with MemtableActor → SSTable flush → CompactionActor

Rationale: LSM-trees convert random writes to sequential writes, aligning with actor-based append-only messaging. The memtable is naturally an actor (in-memory sorted buffer). SSTable blocks are naturally actors (immutable, append-only). Compaction is naturally an actor (background processing with circuit breaker supervision).

B-trees require in-place updates, which conflict with actor immutability principles and complicate supervision (a crashed B-tree node cannot simply be restarted — it must be repaired).

ADR-2: Why Gossip over Raft for distribution?

Decision: Gossip protocol with CRDTs for metadata, tunable consistency per operation for data.

Rationale: Raft requires a leader, creating a single point of coordination. Gossip is peer-to-peer, matching the actor model’s symmetric design. CRDTs provide conflict-free merging, eliminating coordination for metadata updates.

The tradeoff is weaker consistency (eventual vs. linearizable for metadata), but metadata changes (cluster membership, schema updates) are infrequent and can tolerate convergence delay. Data consistency is governed by per-operation consistency levels, allowing applications to choose their tradeoff.

ADR-3: Why fire-and-forget for index updates?

Decision: Index updates (BTree, Hash, Bloom) are sent as fire-and-forget messages from WriteActor, not awaited.

Rationale: Write acknowledgment depends only on WAL durability. Index updates are eventually consistent — a write is durable (in the WAL) even if an index update fails. The index will be rebuilt on recovery. This decouples write latency from the number of secondary indexes.

The tradeoff is that a query may miss a recently written entry if the index update hasn’t been processed yet. This is acceptable because the memtable (which IS up-to-date) is checked first on reads.


Appendix B: Formal TLA+ Properties

\* Per-key linearizability
LinearizableKey(k) ==
    \A w1, w2 \in Writes :
        /\ w1.key = k /\ w2.key = k
        /\ RealTime(w1.ack) < RealTime(w2.start)
        => \A r \in Reads :
            /\ r.key = k
            /\ RealTime(r.start) > RealTime(w2.ack)
            => r.value = w2.value \/ \E w3 \in Writes :
                /\ w3.key = k
                /\ RealTime(w3.start) > RealTime(w2.ack)
                /\ r.value = w3.value

\* Write durability
WriteDurable(w) ==
    w.acked => \E wal \in WALEntries : wal.key = w.key /\ wal.value = w.value

\* Recovery completeness
RecoveryComplete ==
    \A wal \in WALEntries :
        \E m \in MemtableEntries' : m.key = wal.key /\ m.value = wal.value