Skip to main content
What this does: Joins a live Kafka event stream with reference data synced from a PostgreSQL database via CDC. The JOIN is maintained incrementally — when reference data changes, the enriched output updates automatically. When to use this: You need to augment high-volume event streams with context from an operational database (user profiles, product catalog, account data) before delivering downstream.

Setup

1. Ingest events from Kafka

2. Sync reference data from PostgreSQL via CDC

3. Create an enriched materialized view

The JOIN is maintained incrementally. When a user’s segment changes in PostgreSQL, the enriched output updates automatically.

4. Deliver enriched events downstream

Key points

  • The JOIN between a streaming source and a CDC table is maintained incrementally — no periodic recompute
  • When a row in users changes in PostgreSQL, the enriched_clicks MV updates to reflect the new value
  • For late-arriving events or joins where the reference data may not exist yet, use a LEFT JOIN to avoid dropping records
  • Use force_append_only = 'true' on Kafka sinks from materialized views that contain aggregations or joins

Next steps