Overview
BlockDB is a logical multi-model database built for blockchain data. It manages MySQL-protocol OLTP databases underneath, and exposes ready-to-use on-chain semantic tables (Block tables) in its logical layer.Core capabilities
- High-performance online tables: BlockDB constrains and optimizes read/write access to the underlying OLTP tables from its logical layer, reaching throughput on the order of 1 million rows/second for blockchain workloads. This supports high-concurrency online applications as well as fast historical block backfill.
- Logical multi-model design: One online store serves regular tables, Block State/Event tables, and Time tables. You no longer need a separate store and ETL pipeline for state, events, and time series.
- On-chain data specialization: Query on-chain state at any block height, or subscribe to any contract’s real-time changes, without dealing with block reorgs and data management yourself.
- Event subscription: Table-level event subscription lets you consume any upstream table’s real-time data, so your business code runs on the database’s change stream like a “virtual smart contract”.
Quickstart
Complete your first read, write, and subscription in a few steps: Go to quickstartLearn more
Core concepts
BlockDB abstracts on-chain data processing into a small set of concepts, from the data model to writes and subscriptions.- What is BlockDB: The definition, two-layer model, and core capabilities.
- Data model: Table, BlockTable, TimeTable, and the shadow table mechanism.
- Block State Table and Block Event Table: The two on-chain semantic table models and their blockchain semantics.
- Writes and event subscription: Real-time writes, batch writes, and block subscription events.
- Time Table: Time-bucketed series tables with built-in dedup and storage compaction.
Architecture
How BlockDB is organized as services and components.- Architecture overview: The multi-service design, deployment topology, and data flow.
- Services and components: Each service’s responsibility and the core code packages.
- Write architecture: Real-time writes and batch writes.
Guides
Hands-on guides for reading, writing, subscribing, and plugging in compute.- Read and write data: Use the Table / BlockTable / TimeTable models.
- Real-time subscription: Subscribe to block write events and build incremental pipelines.
- Multi-table block height alignment: Use Aligned so all tables are ready at the same height.
- Filters and operator pipelines: Build filter and dedup preprocessing with Column / Operator.
- High-concurrency compute with BlockX: Distributed parallel compute over massive block data.
Reference
Complete API and protocol reference.- API overview: All SDK interfaces grouped by table type.
- Logical types: Type categories, formats, length limits, and index constraints.
- Error codes: Business error codes and their gRPC status mapping.