streambed
Stream PostgreSQL changes to Apache Iceberg tables on S3
TLDR
SYNOPSIS
streambed sync|resync|query|cleanup [flags]
DESCRIPTION
streambed is a change data capture (CDC) tool written in Go. It tails the PostgreSQL write-ahead log using logical replication, writes the resulting changes as Parquet files to S3, and commits Apache Iceberg metadata so the data is queryable as a versioned analytical table.The `sync` subcommand runs as a long-lived daemon and can optionally expose a query endpoint compatible with the PostgreSQL wire protocol, so existing Postgres clients can read Iceberg tables without changes. `resync` performs a one-shot backfill under a consistent snapshot using `COPY`. `query` runs the wire-protocol server alone against tables that were already populated. `cleanup` deletes S3 objects and tracking state for a given table.Streambed targets the use case of offloading analytical workloads from a production Postgres instance to an Iceberg-on-S3 lakehouse while still letting tools that speak the Postgres protocol query the result.
PARAMETERS
sync
Stream WAL changes, write Iceberg, optionally serve queries.resync
One-shot backfill via `COPY` under a consistent snapshot.query
Postgres-wire query server for existing Iceberg tables.cleanup
Delete S3 objects and state for a table.--source-url URL
Postgres connection string (or `STREAMBEDSOURCEURL`).--s3-bucket NAME
Destination S3 bucket (or `STREAMBEDS3BUCKET`).--s3-endpoint URL
S3 endpoint (use MinIO or other S3-compatible storage).--s3-prefix PATH
Key prefix within the bucket.--query-addr HOST:PORT
Bind address for the Postgres-wire query server.
CONFIGURATION
Every flag has an environment-variable equivalent with a `STREAMBED` prefix (for example `STREAMBEDSOURCE_URL`).
INSTALLATION
The project is built from source:
CAVEATS
Streambed needs Postgres logical replication to be enabled (`wal_level = logical`) and a replication slot. Like any CDC pipeline it can fall behind if the WAL grows faster than it is consumed, which keeps WAL segments on the primary until they are processed.
SEE ALSO
pg_basebackup(1), pg_recvlogical(1)
