MLambda.Data — Executive Summary
The Actor-Native Database Engine
What Is MLambda.Data?
MLambda.Data is a distributed database engine where every component is an actor. Unlike traditional databases that bolt distribution and fault tolerance onto single-node designs, MLambda.Data treats the actor model as its foundation — the storage engine, the query planner, the filesystem, and the cluster layer are all actors communicating through typed messages.
Why It Matters: Three Problems Solved
1. The Impedance Mismatch Problem
Every application that uses a traditional database must bridge a gap:
Your code: User object with typed properties
Your database: SQL text, wire protocol, connection pool, ORM mapping
MLambda.Data eliminates this gap entirely. An entity’s mapping IS the schema. A repository accepts and returns your type directly. There is no SQL to write, no ORM to configure, no migration files to manage.
case openRepository engine of
Right users -> case save users (User "u-1" "Alice" (Just "[email protected]") 30) of
_ -> find users (B.bytesFromString "u-1")
Left fault -> ...
2. The Operational Complexity Problem
Scaling a traditional database requires specialized knowledge:
| Task | PostgreSQL | MLambda.Data |
|---|---|---|
| Add capacity | Set up replication, configure Patroni, test failover | Change topology config |
| Handle node failure | External HA tooling, manual failover procedures | Automatic (guardian supervision) |
| Tune connections | Size pools, configure PgBouncer, monitor leaks | Not applicable (no connections) |
| Add an index | CREATE INDEX CONCURRENTLY, monitor lock contention |
Add [Hash] attribute, deploy |
| Change schema | Write DDL migration, coordinate downtime | An evolution the registry checks against old rows |
| Monitor | Install pg_stat_statements, configure Prometheus exporter | Built-in MetricsCollector actor |
3. The Security-by-Default Problem
SQL injection is the #1 web vulnerability (OWASP A03:2021). It exists because databases accept text that mixes code and data.
MLambda.Data has zero SQL injection surface. Queries are typed values checked at compile time. There is no text parser to exploit.
How It Compares
vs. Traditional Databases (PostgreSQL, MySQL)
| Traditional | MLambda.Data | |
|---|---|---|
| Query interface | SQL text (parse → plan → execute) | Typed messages (zero parsing) |
| Connection model | TCP pool (leak-prone) | Actor mailbox (nothing to leak) |
| Distribution | Bolt-on (replication, sharding) | Native (actor framework) |
| Serialization | 4 boundaries per operation | 0 (local) or 2 (remote) |
vs. Distributed Databases (CockroachDB, Cassandra)
| CockroachDB/Cassandra | MLambda.Data | |
|---|---|---|
| Distribution mechanism | Custom Raft/Gossip from scratch | Actor framework (built-in) |
| Schema management | DDL statements | Entity mappings in code |
| Fault recovery | Custom recovery logic | Guardian supervision hierarchy |
| Deployment complexity | Multi-component | Single binary, 3 topology modes |
vs. Actor Frameworks (Orleans, Akka)
| Orleans/Akka | MLambda.Data | |
|---|---|---|
| Storage | External (Azure Tables, PostgreSQL) | Self-contained (LSM-tree actors) |
| Query support | None / Read projections | Built-in planner with 4 index types |
| Focus | Application framework | Database engine |
Six Innovations
-
Actor-as-Storage-Primitive — Memtable, WAL, SSTable blocks, indexes are all actors. No external storage engine.
-
Typed Message Protocol — Compile-time validated messages replace SQL text. Structurally eliminates injection vulnerabilities.
-
Supervision-as-Recovery — Database failure modes (disk full, WAL corruption, SSTable corruption) map to actor supervision strategies (escalate, restart, resume). Declarative, not procedural.
-
Distribution-as-Framework-Consequence — Same code runs standalone or clustered. The actor framework handles routing, replication, and failover.
-
Circuit-Breaker Compaction — Compaction pauses automatically when disk I/O exceeds 80% or write p99 exceeds 5ms, preventing write stalls.
-
Schema-Free Query Planning — Automatic index selection (hash, B-tree range, B-tree prefix, full scan) based on filter operators alone, without pre-declared index metadata.
Who It’s For
| Audience | Value Proposition |
|---|---|
| Aleph teams | Embedded database that scales from single-process to cluster without code changes |
| Microservice architects | Each service owns its data layer — no external database dependency |
| IoT / Edge developers | Same codebase runs on edge devices (standalone) and cloud (cluster) |
| Security-conscious teams | Zero SQL injection surface, built-in auth with session rotation |
| DevOps / SRE teams | Self-healing recovery, built-in metrics, no connection pool tuning |
Academic Validation
- TLA+ formal verification of consistency properties (per-key linearizability, write durability, recovery completeness)
- BDD test suite with consistency model scenarios, chaos tests, and query optimizer validation
- Chaos testing verifying WAL corruption recovery, concurrent write ordering, multi-crash recovery cycles
- Builds on peer-reviewed research: Hewitt (1973), Shah & Salles (2017), Bernstein et al. (CIDR 2017), Eldeeb et al. (VLDB 2024)
The Bottom Line
Traditional databases were designed in the 1970s-90s as centralized query processors accepting text over TCP. Every system since — from Cassandra to CockroachDB — has worked within that paradigm, adding distribution as an afterthought.
MLambda.Data starts from a different premise: the actor model provides everything a database needs. Sequential processing gives you serializability. Location transparency gives you distribution. Supervision gives you fault tolerance. Typed messages give you safety.
The result is a database that is simpler to operate, safer to use, and naturally distributed — because it was designed that way from the first line of code.