Databases
Chapter 29: Database Backends (LevelDB, RocksDB, MDBX)
Section titled “Chapter 29: Database Backends (LevelDB, RocksDB, MDBX)”Overview
Section titled “Overview”Blockchain nodes use key-value databases to store blockchain data.
29.1 Database Types
Section titled “29.1 Database Types”LevelDB
Section titled “LevelDB”- Used by: Geth (legacy)
- Written in: C++
- Type: LSM tree
RocksDB
Section titled “RocksDB”- Used by: Many blockchain clients
- Written in: C++
- Type: LSM tree
- Facebook-developed
- Used by: Erigon
- Written in: C
- Type: B+ tree
- Fast, memory-efficient
29.2 Comparison
Section titled “29.2 Comparison”| Database | Speed | Memory | Use Case |
|---|---|---|---|
| LevelDB | Medium | Medium | Legacy Geth |
| RocksDB | Fast | High | Many clients |
| MDBX | Very Fast | Low | Erigon |
29.3 Configuration
Section titled “29.3 Configuration”Geth with RocksDB
Section titled “Geth with RocksDB”# Build Geth with rocksdbmake geth TAGS=rocksdbSummary
Section titled “Summary”- Database choice affects performance
- MDBX (Erigon) is fastest
- RocksDB widely used
Last Updated: 2026-02-20