LioranDB begins with a local transactional storage engine, but its architecture extends beyond one process.
The DBMS backend can operate in several modes:
Local
Multi-core
Multi-node
Remote cluster
One DBMS interface
The document layer talks through a backend abstraction.
A read transaction may therefore target:
Local(ReadTxn)
MultiCore
MultiNode
Cluster
The document query layer does not need a completely different API for each deployment model.
Multi-core routing
In multi-core mode, a table and key are mapped to one engine partition.
table + key
↓
partition hash
↓
local engine partition
Multi-node routing
In multi-node mode, the operation first selects a node and then a partition inside that node.
table + key
↓
node
↓
partition
↓
engine
Global scans visit several partitions or nodes and merge the returned keys.
WAL-based replication
The cluster crate includes a leader-driven replication abstraction.
A replicator:
- Fetches WAL entries from a starting LSN.
- Limits the batch by entries and bytes.
- Sends the batch to a follower.
- Receives the follower's acknowledged LSN.
- Continues from the next LSN.
The current abstraction is synchronous, but it cleanly separates WAL production from transport.
That transport can later be backed by RPC.
gRPC server
The server crate opens a node using:
- Cluster configuration
- Node identity
- On-disk engine configuration
- TLS certificates
- Certificate authority
- ACL rules
- gRPC listen address
- Metrics address
This is the boundary where the database becomes a network service instead of an embedded library.
The larger idea
A distributed database should not be designed by gluing networking onto a single global engine at the end.
It needs internal seams for:
Partition ownership
Request routing
WAL shipping
Follower application
Read preferences
Node configuration
Security
Observability
LioranDB's architecture is building those seams from the storage layer upward.
The result is a path from one Rust process to a multi-core and eventually replicated database system without replacing the entire core halfway through.
That is the architectural long game.
LioranDB is developed by Swaraj Puppalwar under Lioran Group.
Explore the project:
Top comments (0)