> For the complete documentation index, see [llms.txt](https://polarischain-1.gitbook.io/polarischain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polarischain-1.gitbook.io/polarischain/7.-storage-and-persistence-architecture/7.2-hybrid-storage-engine-hot-vs.-cold-state.md).

# 7.2 - Hybrid Storage Engine: Hot vs. Cold State

Polarischain separates transactional hot state from historical/archival data, routing each to the database engine best suited for its access pattern.

**LMDB — Hot State (Validation Path)**

Account balances, per-sender nonces, and high-frequency validation data are stored in **LMDB** (Lightning Memory-Mapped Database), a B+ tree engine with copy-on-write semantics:

* **Zero-Copy `mmap` Reads:** Point queries resolve in \~200–500 ns, bypassing page cache overhead and eliminating I/O wait during block application.
* **No Background Compaction:** Removes latency spikes associated with merge cycles, ensuring deterministic consensus timing.
* **Copy-on-Write Crash Safety:** Inherently durable without requiring a secondary WAL.
* **MVCC Readers:** Balance and nonce lookups proceed concurrently with block application, never blocking consensus progression.

**Hot State Contents:**

* Account balances (including `$POLA` and Native Attached Assets)
* Per-sender transaction nonces
* Faucet claim cooldowns & minting counters

**RocksDB — Cold & Historical Storage**

Block history, asset registries, DAG metadata, and indexing layers are persisted in **RocksDB**, organized into isolated column families for precise lifecycle management:

<table data-header-hidden><thead><tr><th width="219.66015625"></th><th width="242.21484375"></th><th width="239.16796875"></th></tr></thead><tbody><tr><td>Column Family</td><td>Contents</td><td>Access Pattern</td></tr><tr><td><code>Blocks</code></td><td>Full block payloads</td><td>Keyed by author/round/digest</td></tr><tr><td><code>Collections</code> &#x26; <code>NAAs</code></td><td>Native Attached Asset definitions &#x26; metadata</td><td>Loaded at startup, static reads</td></tr><tr><td><code>DAG_Metadata</code></td><td>Parent references, commit status, wave alignment</td><td>Sequential write, range read</td></tr><tr><td><code>Snapshots</code></td><td>Periodic state checkpoints</td><td>Bulk write, bulk restore</td></tr><tr><td><code>Indices</code></td><td>Block height mappings, timestamp lookups</td><td>Range &#x26; point queries</td></tr><tr><td><code>Prune_Markers</code></td><td>Blocks eligible for archival cleanup</td><td>Background batch processing</td></tr><tr><td><code>Tx_By_Address</code></td><td>Transaction index per participant</td><td>Wallet/explorer queries</td></tr><tr><td><code>Authority_Bans</code></td><td>Persisted equivocation penalties</td><td>Loaded pre-P2P listener startup</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://polarischain-1.gitbook.io/polarischain/7.-storage-and-persistence-architecture/7.2-hybrid-storage-engine-hot-vs.-cold-state.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
