# Storage

Storage is the single biggest performance bottleneck in the original Ethereum design. In the original Ethereum L1 the main storage is an **Merkle Patricia Trie (MPT)** stored in a KV database. It is simply and straightforward. It suffers from performance issues due to its design. Let along handling the workload from parallel execution.

A **single state update** modifies multiple trie nodes along the way, all requiring new writes to the LevelDB. The root hash must be recalculated, leading to **many redundant disk writes**. Fetching account data requires **traversing multiple trie levels**, each stored separately in the DB. This results in **multiple random disk reads**, slowing down state access.

While concurrent reads are OK on MPT by principle, updates much be sequential, which is another challenge because nodes must be added one-by-one, creating a huge bottleneck. This problem only gets worse when dealing with workload coming from with parallel execution.

### **Dual Storage System**

Arcology's solution utilizes a **dual storage system** to optimize execution and state management. It consists of:

1. **Flattened Key-Value Datastore:** Used for **state access during execution**. This database is optimized for fast and efficient retrieval of state data. The flattened **database** is updated **synchronously**.
2. **StateDB with a Parallelized Merkle Patricia Trie (MPT):** Maintained separately to support **root hash calculation and Ethereum RPC Enquiries**. The StateDB is only updated **asynchronously**, decoupling from execution to enhance performance.

<figure><img src="/files/8VZ1TrvlqTAtGDquP63D" alt=""><figcaption></figcaption></figure>

Once the conflict detector has verified that there are no conflicts (or has resolved any that were found), the state changes can be committed to the state database. Clear transitions represent the successful commitment of these changes to the state database, ensuring the blockchain state is updated consistently. Storage is the single biggest performance bottleneck in the original Ethereum design.


---

# Agent Instructions: 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:

```
GET https://docs.arcology.network/parallel-execution-design/storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
