← Docs
Recipe

Recipe: Change Data Capture pipeline design

A step-by-step pattern for streaming database mutations into Meridian with exactly-once semantics and sub-second latency.

1. Capture

Attach a logical replication slot to your Postgres source. Meridian consumes the WAL stream via the pgoutput plugin, decoding INSERT, UPDATE, and DELETE events into structured payloads.

CREATE PUBLICATION meridian_pub FOR ALL TABLES;
SELECT * FROM pg_create_logical_replication_slot(
  'meridian_slot', 'pgoutput'
);

2. Transform

Route each change through a lightweight mapper that normalizes column names, strips internal-only fields, and attaches a Meridian event envelope with a deterministic idempotency key.

{
  "idempotency_key": "tx_42f9a1_lsn_0/16B3E80",
  "table": "public.orders",
  "op": "UPDATE",
  "after": { "id": 881, "status": "shipped" },
  "ts": "2026-01-15T14:02:11.342Z"
}

3. Deliver

Push transformed events into Meridian via the Ingestion API. The client library deduplicates on idempotency_key and retries with exponential backoff on transient failures.

curl -X POST https://api.getnimbus.net/v1/ingest \
  -H "Authorization: Bearer sk_live_..." \
  -d '{"stream":"orders_cdc","events":[...]}'

4. Observe

Monitor pipeline health in the Meridian dashboard. Track replication lag, delivery success rate, and per-table throughput in real time.

Need a managed CDC connector? Browse connectors →