You can replace Kafka consumer code and most of a Debezium pipeline with streaming SQL: RisingWave, a PostgreSQL-compatible streaming database, connects directly to Kafka topics or to a database's replication log, maintains aggregations, enrichments, filters, and windows as materialized views that update on every message with offsets and exactly-once delivery handled by its checkpoints, and pushes results to PostgreSQL, Kafka, or Elasticsearch through sinks. This guide starts from a verified walkthrough of four consumer patterns rewritten as SQL, then covers Debezium PostgreSQL CDC with and without Kafka, real-time data sync with delete propagation, pipeline health monitoring, the outbox pattern for microservices event sourcing, and CDC-driven search indexing.
The Kafka Consumer Accumulation Problem
Every team running Kafka accumulates consumer code. A requirement arrives, revenue per region in real time, and someone writes a consumer with an in-memory dictionary and a periodic flush. Another needs enriched orders, so a second consumer reads one topic and looks up reference data from a cache. A third needs alerts on failed orders. Within months there is a fleet of processes, each with its own offset management, error handling, deployment pipeline, and on-call rotation, and adding a field to an aggregation is a code change, a review, a test run, and a deploy. The processing logic itself was always SQL-expressible.
The same accumulation happens around Debezium. The connector reads PostgreSQL's write-ahead log and publishes every row change to Kafka with full before and after state, which is the right foundation for keeping warehouses, search indexes, and microservices in sync. But the consumers of those topics are more code, and the pipeline itself is three systems, the database, Kafka Connect, and the downstream, any of which can lag silently while the connector status says RUNNING.
RisingWave processes each Kafka message exactly once through a dataflow graph and propagates changes to every downstream view in one incremental pass. You write CREATE MATERIALIZED VIEW instead of a consumer loop, and the same engine parses Debezium envelopes, embeds a CDC reader for PostgreSQL and MySQL so Kafka and Kafka Connect are optional for the CDC path, and serves the results over the PostgreSQL protocol. RisingWave is open source under Apache 2.0, written in Rust, and checkpoints state to S3.
Kafka topic or CDC log
|
v
CREATE TABLE or SOURCE (connector reads, parses JSON, Avro, Protobuf, or Debezium)
|
+---> materialized view: aggregation
+---> materialized view: join and enrichment
+---> materialized view: filter for errors
|
+---> sinks: PostgreSQL, Kafka, Elasticsearch, Iceberg
Four Consumer Patterns Rewritten as SQL
The following was run on RisingWave 2.8.0. The kcons_orders table is populated with direct inserts for demonstration; with the Kafka connector the SQL is identical.
CREATE TABLE kcons_products (product_id VARCHAR PRIMARY KEY, product_name VARCHAR, category VARCHAR);
CREATE TABLE kcons_orders (
order_id VARCHAR PRIMARY KEY,
customer_id INT,
product_id VARCHAR,
quantity INT,
unit_price NUMERIC,
status VARCHAR,
region VARCHAR,
event_time TIMESTAMP
);
-- In production:
-- CREATE TABLE kcons_orders (...) WITH (connector = 'kafka', topic = 'orders', properties.bootstrap.server = 'broker:9092', scan.startup.mode = 'latest') FORMAT PLAIN ENCODE JSON;
Pattern 1, the aggregation consumer. The old way is an in-memory dict flushed periodically to a store. The SQL way is one view that is always current.
CREATE MATERIALIZED VIEW kcons_order_summary_mv AS
SELECT region, COUNT(*) AS order_count, SUM(quantity * unit_price) AS total_revenue, AVG(quantity * unit_price) AS avg_order_value
FROM kcons_orders
WHERE status = 'completed'
GROUP BY region;
SELECT * FROM kcons_order_summary_mv ORDER BY total_revenue DESC;
region | order_count | total_revenue | avg_order_value
----------+-------------+---------------+-----------------
us-east | 3 | 359.91 | 119.97
eu-west | 2 | 268.98 | 134.49
ap-south | 2 | 238.99 | 119.4950
Pattern 2, the enrichment consumer. The old way is a KafkaConsumer in one thread, reference lookups from a database or cache in another, and a join in application code. The SQL way is a JOIN that RisingWave maintains as either side changes; the products table can come from CDC, static inserts, or another topic.
CREATE MATERIALIZED VIEW kcons_enriched_orders_mv AS
SELECT o.order_id, o.customer_id, p.product_name, p.category, o.quantity, o.unit_price, o.quantity * o.unit_price AS order_total, o.status, o.region, o.event_time
FROM kcons_orders o
JOIN kcons_products p ON o.product_id = p.product_id;
SELECT order_id, product_name, category, order_total, status, region FROM kcons_enriched_orders_mv ORDER BY event_time;
order_id | product_name | category | order_total | status | region
----------+---------------------+-------------+-------------+-----------+----------
ORD-1001 | Wireless Headphones | electronics | 59.98 | completed | us-east
ORD-1002 | Office Chair | furniture | 149.00 | completed | eu-west
ORD-1003 | Running Shoes | apparel | 179.97 | completed | us-east
ORD-1004 | Coffee Maker | appliances | 89.99 | completed | ap-south
ORD-1005 | Wireless Headphones | electronics | 149.95 | failed | us-east
ORD-1006 | Running Shoes | apparel | 119.98 | completed | eu-west
ORD-1007 | Office Chair | furniture | 149.00 | completed | ap-south
ORD-1008 | Wireless Headphones | electronics | 119.96 | completed | us-east
Pattern 3, the alerting consumer. The old way reads every message, checks a condition, and calls an alerting API. The SQL way is a filtered view plus a sink; one statement replaces the consumer and the integration layer.
CREATE MATERIALIZED VIEW kcons_order_errors_mv AS
SELECT order_id, customer_id, product_id, quantity * unit_price AS order_total, status, region, event_time
FROM kcons_orders
WHERE status <> 'completed';
CREATE SINK kcons_error_alerts_sink FROM kcons_order_errors_mv
WITH (connector = 'kafka', topic = 'order-alerts', properties.bootstrap.server = 'broker:9092') FORMAT PLAIN ENCODE JSON;
SELECT * FROM kcons_order_errors_mv;
order_id | customer_id | product_id | order_total | status | region | event_time
----------+-------------+------------+-------------+--------+---------+---------------------
ORD-1005 | 104 | SKU-A100 | 149.95 | failed | us-east | 2026-04-01 10:03:05
Pattern 4, the windowed consumer. Window boundaries, late arrivals, and state expiry are where consumer code gets verbose. TUMBLE, HOP, and SESSION replace all of it.
CREATE MATERIALIZED VIEW kcons_revenue_by_region_mv AS
SELECT region, window_start, window_end, SUM(quantity * unit_price) AS total_revenue, COUNT(*) AS order_count
FROM TUMBLE(kcons_orders, event_time, INTERVAL '2' MINUTE)
WHERE status = 'completed'
GROUP BY region, window_start, window_end;
SELECT * FROM kcons_revenue_by_region_mv ORDER BY window_start, total_revenue DESC;
region | window_start | window_end | total_revenue | order_count
----------+---------------------+---------------------+---------------+-------------
eu-west | 2026-04-01 10:00:00 | 2026-04-01 10:02:00 | 149.00 | 1
us-east | 2026-04-01 10:00:00 | 2026-04-01 10:02:00 | 59.98 | 1
us-east | 2026-04-01 10:02:00 | 2026-04-01 10:04:00 | 179.97 | 1
eu-west | 2026-04-01 10:02:00 | 2026-04-01 10:04:00 | 119.98 | 1
ap-south | 2026-04-01 10:02:00 | 2026-04-01 10:04:00 | 89.99 | 1
ap-south | 2026-04-01 10:04:00 | 2026-04-01 10:06:00 | 149.00 | 1
us-east | 2026-04-01 10:04:00 | 2026-04-01 10:06:00 | 119.96 | 1
Offsets, Fault Tolerance, and Startup Position
Nobody writes consumer.commit() or configures enable.auto.commit. RisingWave creates a consumer group and commits offsets in sync with its checkpoints, every 10 seconds by default, so a restart resumes from the last checkpoint with every view consistent. Startup position is a property: scan.startup.mode = 'earliest', 'latest', or 'timestamp' with scan.startup.timestamp.millis. SASL/SCRAM, SSL, and AWS MSK IAM authentication are WITH clause properties.
Consumer code still wins in three places: ML inference on every message before any SQL, where a model-serving call in the consumer is cleaner than a user-defined function; very complex event pattern matching with many interdependent sequences, where a purpose-built CEP engine has the edge over window functions; and proprietary binary formats that need business-specific decoding before the data has typed columns, since Avro and Protobuf are handled natively and ad hoc formats are not.
Debezium PostgreSQL CDC: Through Kafka or Direct
Debezium plugs into PostgreSQL logical decoding. A replication slot tells PostgreSQL to retain WAL until the consumer has processed it, a publication names the tables to capture, and pgoutput, built into PostgreSQL 10 and later, is the recommended decoding plugin. The connector snapshots existing rows as op=r events and then streams.
# postgresql.conf
wal_level = logical
max_replication_slots = 4
max_wal_senders = 4
CREATE ROLE debezium REPLICATION LOGIN PASSWORD 'secret';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO debezium;
CREATE PUBLICATION dbz_publication FOR TABLE public.orders, public.customers, public.products;
{
"name": "pg-orders-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"database.hostname": "postgres.internal",
"database.port": "5432",
"database.user": "debezium",
"database.password": "secret",
"database.dbname": "production",
"topic.prefix": "pg1",
"slot.name": "debezium_slot",
"plugin.name": "pgoutput",
"publication.name": "dbz_publication",
"table.include.list": "public.orders,public.customers,public.products",
"heartbeat.interval.ms": "10000",
"errors.tolerance": "all",
"errors.deadletterqueue.topic.name": "dlq.pg1-cdc",
"errors.deadletterqueue.context.headers.enable": "true"
}
}
RisingWave reads the Debezium envelope, before, after, op, ts_ms, and maintains the current state of each table, applying updates and deletes, with FORMAT DEBEZIUM:
CREATE TABLE orders_cdc (
id BIGINT PRIMARY KEY, customer_id BIGINT, product_id BIGINT, quantity INT, unit_price NUMERIC, amount NUMERIC, status VARCHAR, created_at TIMESTAMPTZ
) WITH (connector = 'kafka', topic = 'pg1.public.orders', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'earliest')
FORMAT DEBEZIUM ENCODE JSON;
CREATE TABLE customers_cdc (id BIGINT PRIMARY KEY, email VARCHAR, country VARCHAR, tier VARCHAR)
WITH (connector = 'kafka', topic = 'pg1.public.customers', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'earliest')
FORMAT DEBEZIUM ENCODE JSON;
CREATE TABLE products_cdc (id BIGINT PRIMARY KEY, name VARCHAR, description VARCHAR, category VARCHAR, price NUMERIC(10,2), in_stock BOOLEAN, updated_at TIMESTAMPTZ)
WITH (connector = 'kafka', topic = 'pg1.public.products', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'earliest')
FORMAT DEBEZIUM ENCODE JSON;
CREATE MATERIALIZED VIEW customer_order_stats AS
SELECT customer_id, COUNT(*) AS total_orders, SUM(amount) AS lifetime_value, MAX(created_at) AS last_order_at
FROM orders_cdc
GROUP BY customer_id;
When Elasticsearch or RisingWave is the only consumer, the Kafka Connect cluster and the topic are overhead. RisingWave embeds the Debezium engine and reads the slot directly; the table definitions and every view below are unchanged.
CREATE SOURCE pg_production WITH (
connector = 'postgres-cdc', hostname = 'postgres.internal', port = '5432', username = 'rwuser', password = 'secret',
database.name = 'production', schema.name = 'public', slot.name = 'risingwave_slot', publication.name = 'rw_publication'
);
CREATE TABLE orders_cdc (id BIGINT PRIMARY KEY, customer_id BIGINT, product_id BIGINT, quantity INT, unit_price NUMERIC, amount NUMERIC, status VARCHAR, created_at TIMESTAMPTZ)
FROM pg_production TABLE 'public.orders';
Keep Debezium and Kafka when several teams consume the same change stream, when routing is complex, when long-term event replay must outlast any one system, or when the organization already runs a Kafka platform. Many teams run both: Debezium fans out to Kafka for microservices and audit, and RisingWave reads from Kafka or directly from PostgreSQL for the SQL-shaped consumers.
Real-Time Data Sync with Delete Propagation
Batch sync runs on a schedule, not a signal, so it produces stale dashboards, thundering-herd load on both ends, fragile soft-delete workarounds, and no before-state. Log-based CDC fixes all four, and streaming SQL lets the sync apply business logic, select columns, and join tables on the way to the target.
CREATE MATERIALIZED VIEW enriched_orders AS
SELECT o.id AS order_id, o.status, o.created_at, c.email AS customer_email, c.country AS customer_country, c.tier AS customer_tier,
p.name AS product_name, p.category AS product_category, o.quantity * o.unit_price AS order_value
FROM orders_cdc o
JOIN customers_cdc c ON o.customer_id = c.id
JOIN products_cdc p ON o.product_id = p.id;
CREATE SINK enriched_orders_pg_sink FROM enriched_orders
WITH (connector = 'jdbc', jdbc.url = 'jdbc:postgresql://analytics-db:5432/warehouse', table.name = 'enriched_orders', type = 'upsert', primary_key = 'order_id');
CREATE SINK enriched_orders_kafka_sink FROM enriched_orders
WITH (connector = 'kafka', topic = 'enriched-orders', properties.bootstrap.server = 'kafka:9092', primary_key = 'order_id')
FORMAT UPSERT ENCODE JSON;
CREATE SINK customer_stats_sink FROM customer_order_stats
WITH (connector = 'kafka', topic = 'customer-order-stats', properties.bootstrap.server = 'kafka:9092', primary_key = 'customer_id')
FORMAT DEBEZIUM ENCODE JSON;
The view updates whenever any of the three source tables changes, and a Debezium op=d with a populated before becomes a delete in the view. Upsert sinks emit a null value for the deleted key, which the JDBC target applies as DELETE and Kafka consumers read as a tombstone. is_deleted flags are no longer needed. Emitting the Debezium format on the outbound sink lets downstream systems that already speak Debezium consume the aggregated stream unchanged.
Monitoring Pipeline Health
A Debezium pipeline that lags silently is worse than one that stops. Problems originate in three places: the database's WAL grows because the slot is not consumed, the Kafka topic grows because the downstream is slow, or a schema change breaks deserialization and events route to the dead letter queue. Connector JMX metrics, SecondsBehindSource, RemainingTableCount, TotalNumberOfEventsSeen, NumberOfErroneousEvents, Connected, and QueueRemainingCapacity, scrape into Prometheus through the JMX exporter. Consumer group lag per partition comes from kafka-consumer-groups.sh --describe. The heartbeat topic, enabled by heartbeat.interval.ms, is the signal RisingWave itself can watch.
CREATE SOURCE debezium_heartbeats (server_name VARCHAR, ts_ms BIGINT)
WITH (connector = 'kafka', topic = '__debezium-heartbeat.pg1', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'latest')
FORMAT PLAIN ENCODE JSON;
CREATE MATERIALIZED VIEW connector_last_heartbeat AS
SELECT server_name, TO_TIMESTAMP(MAX(ts_ms) / 1000.0) AS last_heartbeat
FROM debezium_heartbeats
GROUP BY server_name;
CREATE MATERIALIZED VIEW stalled_pipelines AS
SELECT server_name, last_heartbeat, EXTRACT(EPOCH FROM (NOW() - last_heartbeat)) AS lag_seconds,
CASE WHEN last_heartbeat < NOW() - INTERVAL '120 seconds' THEN 'CRITICAL' ELSE 'WARNING' END AS alert_level
FROM connector_last_heartbeat
WHERE last_heartbeat < NOW() - INTERVAL '30 seconds';
CREATE MATERIALIZED VIEW cdc_throughput_1m AS
SELECT window_start, COUNT(*) AS orders_changed
FROM TUMBLE(orders_cdc, created_at, INTERVAL '1 MINUTE')
GROUP BY window_start;
CREATE SOURCE cdc_dlq (raw JSONB)
WITH (connector = 'kafka', topic = 'dlq.pg1-cdc', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'latest')
FORMAT PLAIN ENCODE JSON;
CREATE MATERIALIZED VIEW dlq_events_1h AS
SELECT window_start, COUNT(*) AS failed_events
FROM TUMBLE(cdc_dlq, _rw_kafka_timestamp, INTERVAL '1 HOUR')
GROUP BY window_start;
On the PostgreSQL side, pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn) from pg_replication_slots is the WAL retention risk for both Debezium and RisingWave slots. Grafana reads stalled_pipelines and dlq_events_1h through the PostgreSQL data source: lag above 30 seconds warns, above 120 pages, any dead letter event is investigated, and QueueRemainingCapacity under 100 means connector backpressure.
The Outbox Pattern and CQRS Read Models
A microservice that saves an order and then publishes OrderCreated to Kafka has a dual-write bug: if either step fails after the other succeeds, services drift. The outbox pattern writes the event to an outbox_events table in the same transaction as the business row, and Debezium's EventRouter transform publishes outbox rows to per-aggregate topics. Both writes commit or neither does, with no distributed transaction.
CREATE TABLE outbox_events (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
aggregate_type VARCHAR NOT NULL, -- 'Order'
aggregate_id VARCHAR NOT NULL, -- order id
event_type VARCHAR NOT NULL, -- 'OrderCreated', 'OrderPaid', 'OrderShipped'
payload JSONB NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
BEGIN;
INSERT INTO orders (id, customer_id, total, status) VALUES ('ord-123', 'cust-456', 149.99, 'pending');
INSERT INTO outbox_events (aggregate_type, aggregate_id, event_type, payload)
VALUES ('Order', 'ord-123', 'OrderCreated', '{"orderId":"ord-123","customerId":"cust-456","total":149.99,"status":"pending"}');
COMMIT;
{
"name": "orders-outbox-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"database.hostname": "postgres", "database.port": "5432", "database.user": "debezium", "database.password": "secret",
"database.dbname": "orders_service", "topic.prefix": "ordersvc", "plugin.name": "pgoutput",
"table.include.list": "public.outbox_events",
"transforms": "outbox",
"transforms.outbox.type": "io.debezium.transforms.outbox.EventRouter",
"transforms.outbox.table.field.event.id": "id",
"transforms.outbox.table.field.event.key": "aggregate_id",
"transforms.outbox.table.field.event.payload": "payload",
"transforms.outbox.table.field.event.type": "event_type",
"transforms.outbox.route.by.field": "aggregate_type",
"transforms.outbox.route.topic.replacement": "outbox.event.${routedByValue}"
}
}
RisingWave consumes the routed topic as the read side of CQRS. The current state per order is the latest event, saga monitoring is a temporal filter on it, and cross-service consistency is a join against the payment service's events.
CREATE SOURCE order_events (
order_id VARCHAR, customer_id VARCHAR, total NUMERIC, status VARCHAR, event_type VARCHAR, updated_at TIMESTAMPTZ
) WITH (connector = 'kafka', topic = 'outbox.event.Order', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'earliest')
FORMAT PLAIN ENCODE JSON;
CREATE SOURCE payment_events (
payment_id VARCHAR, order_id VARCHAR, amount NUMERIC, status VARCHAR, updated_at TIMESTAMPTZ
) WITH (connector = 'kafka', topic = 'outbox.event.Payment', properties.bootstrap.server = 'kafka:9092', scan.startup.mode = 'earliest')
FORMAT PLAIN ENCODE JSON;
CREATE MATERIALIZED VIEW current_order_state AS
SELECT DISTINCT ON (order_id) order_id, customer_id, total, status, event_type AS last_event, updated_at AS last_updated
FROM order_events
ORDER BY order_id, updated_at DESC;
CREATE MATERIALIZED VIEW stalled_sagas AS
SELECT order_id, customer_id, total, last_updated, EXTRACT(EPOCH FROM (NOW() - last_updated)) AS seconds_pending
FROM current_order_state
WHERE status = 'pending' AND last_updated < NOW() - INTERVAL '10 minutes';
CREATE MATERIALIZED VIEW consistency_check AS
SELECT o.order_id, o.total AS order_total, p.amount AS payment_amount,
CASE WHEN p.order_id IS NULL THEN 'payment_missing' WHEN o.total <> p.amount THEN 'amount_mismatch' ELSE 'consistent' END AS consistency_status
FROM current_order_state o
LEFT JOIN (SELECT DISTINCT ON (order_id) * FROM payment_events ORDER BY order_id, updated_at DESC) p ON o.order_id = p.order_id
WHERE o.status <> 'pending';
CREATE MATERIALIZED VIEW order_event_history AS
SELECT order_id, event_type, status, updated_at,
LAG(event_type) OVER (PARTITION BY order_id ORDER BY updated_at) AS previous_event
FROM order_events;
The event history view with LAG is the audit trail event sourcing promises, and an OrderShipped whose previous event is not OrderPaid is a saga ordering bug caught in the stream.
CDC-Driven Search Indexing
Nightly re-index jobs are no longer acceptable; users expect a product going out of stock to disappear from results in seconds. The classic route is Debezium to Kafka to the Kafka Connect Elasticsearch sink with ExtractNewRecordState unwrapping and behavior.on.null.values=delete for tombstones. It works and fans out to other consumers. What it cannot do is reshape the document. RisingWave puts a materialized view between the CDC table and the index, so the document is exactly what search needs: denormalized fields, computed tiers, a combined text field, and a row filter.
CREATE MATERIALIZED VIEW products_search_doc AS
SELECT p.id, p.name, p.description, p.price, p.category, p.in_stock, p.updated_at,
CASE WHEN p.price < 25 THEN 'budget' WHEN p.price < 100 THEN 'mid-range' ELSE 'premium' END AS price_tier,
p.name || ' ' || COALESCE(p.description, '') AS search_text,
s.units_sold_30d
FROM products_cdc p
LEFT JOIN (SELECT product_id, SUM(quantity) AS units_sold_30d FROM orders_cdc WHERE created_at > NOW() - INTERVAL '30 days' GROUP BY product_id) s ON p.id = s.product_id
WHERE p.in_stock = true OR p.updated_at > NOW() - INTERVAL '7 days';
CREATE SINK products_to_elasticsearch FROM products_search_doc
WITH (connector = 'elasticsearch', index = 'products', url = 'http://elasticsearch:9200', primary_key = 'id');
A product leaving stock drops out of the view's result set and the sink issues a DELETE to the index, with no tombstone configuration. Popularity from recent orders rides along for ranking, something a row-replication connector cannot compute. Use the Debezium to Kafka Connect route when Elasticsearch is one of many consumers or when routing by event content to different indexes is required; use RisingWave when search is the main consumer, when SQL transformations are needed before indexing, or when the team prefers SQL to connector configuration. The hybrid, Debezium fanning out to Kafka and RisingWave reading from Kafka to feed Elasticsearch, gives the fan-out without burdening the index with raw Debezium event shapes.
Consumer Code and Connect Pipelines vs Streaming SQL
| Concern | Consumer code and Kafka Connect | Streaming SQL (RisingWave) |
|---|---|---|
| Aggregation, enrichment, filter, window | One process per pattern, custom state and flush | One materialized view each, updated in a single pass |
| Offsets and recovery | Manual commits, per-consumer error handling | Checkpointed with the views, exactly once |
| Adding a field | Code, review, test, deploy | CREATE MATERIALIZED VIEW with the new column |
| CDC path | Database, Kafka Connect, Kafka, consumers | Direct CDC into RisingWave, Kafka optional |
| Deletes | Tombstones and sink flags, or soft-delete columns | Propagate through views to upsert sinks |
| Search documents | Row replication, reshaping in the application | SQL view shapes the document, joins add ranking signals |
| Health | JMX, consumer lag scripts, dashboards per component | Heartbeat lag, throughput, and DLQ counts as views |
Frequently Asked Questions
Does RisingWave replace Kafka? No. It replaces the consumer code and, for the CDC path, Kafka Connect. Kafka stays as the event bus wherever more than one system consumes the stream, and RisingWave reads from it and writes back to it.
What happens to in-flight messages on a RisingWave restart? Offsets are committed with checkpoints, so processing resumes from the last checkpoint and every view is consistent with it. Messages after the checkpoint are reprocessed exactly once from Kafka's perspective of the committed offset.
Can the same table be fed by Debezium through Kafka and by direct CDC?
Pick one per table. Both produce the same typed table in RisingWave, so switching from the Kafka route to direct CDC later is a CREATE TABLE ... FROM source TABLE with the same columns and views.
How does the outbox table avoid growing forever?
Debezium only needs the row until it is captured. A scheduled DELETE FROM outbox_events WHERE created_at < NOW() - INTERVAL '1 day' or a partitioned table with dropped partitions is standard; the events live on in Kafka and in RisingWave's views.
Where do the monitoring views get their time from?
stalled_pipelines compares the last heartbeat to NOW() in the filter, which RisingWave re-evaluates continuously, so a connector that stops appears in the view within seconds of crossing the threshold and disappears when heartbeats resume.
