Chain data in SQL

Chain data in your database.
Without the pipeline.

Postgres or ClickHouse, with the writes, the checkpoints and the reorganizations already handled.

  • Postgres and ClickHouse
  • Idempotent writes
  • Reorg aware
  • Hosted or self-run
≪SF / 01
FirehoseBlockchain extraction
HistoricalStreaming
≫SF / 02
SubstreamsParallel transformation
ComposableRust
Ethereum → Firehose → Substreams → PostgreSQL
Interactive illustration
Built in the open. Explore the code A core developer on The Graph

StreamingFast
ecosystem

The GraphMessariDecentralandAirstack

01 Chain data in SQL

Looks familiar?

Want to see your own schema filled?

See Hosted Sinks
RUST → WEBASSEMBLY

The hard part is not the connection.

Getting data into a database is an afternoon. Keeping it correct through retries, reconnections and reorganizations is the job, and it has no end date. A hosted sink is that job, run for you: writes are idempotent by construction, progress is versioned by block, and a reorganization reverses what it has to and leaves the rest.

Read the guide
FilterMapAggregateDeliver
▧ substreams.yamlPACKAGE STRUCTURE
01 specVersion: v0.1.0
02 package:
03   name: token_transfers
04   version: v0.1.0
05
06 modules:
07   - name: map_transfers
08     kind: map
09     inputs:
10       - source: sf.ethereum.type.v2.Block
11     output:
12       type: proto:transfers.Transfers
Illustrative excerpt Build a complete package ↗

What you get

01 /

Idempotent writes

A retry does not double a row.

02 /

Block-versioned progress

A reorganization unwinds exactly what it should.

03 /

Postgres and ClickHouse

Two supported destinations, same contract.

04 /

Hosted or self-run

Let it run for you, or run it yourself. The behaviour does not change.

05 /

A schema you declare

You define the tables. Nothing is invented on your behalf.

02 Chain data in SQL

How it works

FROM HISTORY TO THE CHAIN HEAD
Historical blocks
New blocks
TRANSACTIONS
TRACES & LOGS
STATE CHANGES
Rich block data. One continuous stream.
01

Declare the schema

The tables, and the keys that make a write idempotent.

02

Deploy the sink

A form and a deploy button, or your own process.

03

Let it unwind

Reorganizations arrive as signals, not as numbers that silently change.

Want to see your own schema filled?

See Hosted Sinks

03 Chain data in SQL

What you stop owning

[01]

The glue between the stream and the database

[02]

The checkpoint logic, and the day it is wrong

[03]

A standing percentage of an engineer, forever, for repair