MemDB
, VersionDB
, and memory-mapped storage (mmap
) to dramatically improve its throughput.
Why Disk I/O Is a Bottleneck
State Transition and Persistence
Every time a block of transactions is executed, the blockchain transitions from one state to the next. This process has two fundamental stages:- State Commitment: The new application state is committed after transaction execution.
- State Storage: The committed state is persisted to disk for long-term access and historical verification.

- The node must wait for the new state to be fully stored on disk before proceeding with the next block’s execution.
- The state data is written in random disk locations that are not mapped to fixed addresses. This leads to high latency when retrieving state data during execution of subsequent transactions.
Optimizing DB Operations for Higher Throughput
To overcome these limitations, Stable proposes a two-fold architectural enhancement focused on decoupling state operations and introducing memory-mapped DB optimizations.1. Decoupling State Commitment and Storage

- After committing a new state, the node immediately proceeds to execute the next block.
- The actual persistence of state to disk occurs asynchronously in the background.
2. Introducing MemDB
and VersionDB
via mmap
We enhance this with a dual-database model powered by mmap
(memory-mapped file access):
- MemDB (Memory DB):
- Stores recent and active states that are frequently accessed.
- Uses fixed address mapping via
mmap
, enabling fast and deterministic lookups. - Ideal for most transaction workloads which target recently modified state.
- VersionDB (Historical DB):
- Stores older, historical states on disk.
- Optimized for archival and long-range queries, not for high-frequency access.
mmap
access with smart state tiering, Stable can significantly reduce the DB read/write latency during block execution.