> For the complete documentation index, see [llms.txt](https://neafs-organization.gitbook.io/japanads-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://neafs-organization.gitbook.io/japanads-doc/na/execution/monaddb.md).

# MonadDb

MonadDbは、ブロックチェーンの状態を保存するためのカスタムデータベースです。

ほとんどのEthereumクライアントは、B-Tree(例は[LMDB](https://www.symas.com/lmdb))またはLSM-Tree(例は[LevelDB](https://github.com/google/leveldb)および[RocksDB](https://rocksdb.org/))データ構造として実装されたキー/値データベースを使用します。ただし、イーサリアムは状態を保存するために[マークル パトリシアトライ](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/)(MPT)データ構造を使用します。これにより、あるデータ構造が異なるタイプの別のデータ構造に埋め込まれる、次善のソリューションが得られます。MonadDbは、[Patricia Trie](https://en.wikipedia.org/wiki/Radix_tree)データ構造をディスク上とメモリ内の両方でネイティブに実装します。

Monadは複数のトランザクションを[並行して実行](https://docs.monad.xyz/technical-discussion/execution/parallel-execution)します。あるトランザクションがディスクから状態を読み取る必要がある場合、その操作が完了するのを待ってブロックするべきではありません。代わりに、読み取りを開始し、その間に別のトランザクションの作業を開始する必要があります。したがって、この問題にはデータベースの[非同期 i/o](https://docs.monad.xyz/technical-discussion/concepts/asynchronous-i-o) (async i/o) が必要です。上記のキーと値のデータベースには、適切なasync i/oサポートがありません(ただし、この領域では改善するための取り組みがいくつかあります)。MonadDbは、async i/o(Linux では[io\_uring](https://unixism.net/loti/index.html) )の最新のカーネルサポートを最大限に活用します。これにより、作業を非同期に実行しようとして保留中のi/o要求を処理するために多数のカーネル スレッドを生成する必要がなくなります。

MonadDbは、高価なオーバーヘッドを追加するファイルシステムのバイパスなど、i/oに関連するその他の最適化を数多く行います。


---

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

```
GET https://neafs-organization.gitbook.io/japanads-doc/na/execution/monaddb.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.
