This topic explains the four core objects in RisingWave: Source, Table, Materialized View (MV), and Sink. Learn their distinct roles in data storage, ingress, real-time computation, and egress.
Object | Stores Data | Directly Queryable | Continuously Updated | Typical Use Case |
---|---|---|---|---|
Table | ✅ Stored within RisingWave | ✅ Directly queryable | Supports updates (from inserts or external sources) | Persisting data, querying, serving as input for MVs or Sinks |
Source | ❌ Does not store; only connects to external systems | Depends on the connector (Kafka/S3/Iceberg are queryable, CDC is not) | Reads from upstream in real-time | Data ingress, ad-hoc exploration, building Tables or MVs |
Materialized View (MV) | ✅ Stores query results | ✅ Directly queryable | Refreshes automatically | Real-time aggregation, cleaning, analysis; recommended as Sink input |
Sink | ❌ Does not store; writes results to external systems | ❌ Not directly queryable | Outputs automatically | Writing results back to Kafka, databases, or object storage |
Connector Type | Direct Source Query | Direct Table Creation | Primary Key Required | Can Create MV | Can Be Sink Input |
---|---|---|---|---|---|
Kafka / Pulsar / Kinesis / NATS / MQTT / PubSub | ✅ | ✅ | ❌ | ✅ | ✅ |
S3 / GCS / Azure Blob | ✅ | ✅ | ❌ | ✅ | ✅ |
PostgreSQL CDC | ❌ (Requires Table) | ✅ | ✅ | ✅ | ✅ |
MySQL CDC | ❌ (Requires Table) | ✅ | ✅ | ✅ | ✅ |
SQL Server CDC | ❌ | ❌ (Must create Source then Table) | ✅ | ✅ | ✅ |
MongoDB CDC | ❌ | ❌ (Must create Source then Table) | ✅ | ✅ | ✅ |
Iceberg | ✅ | ✅ | ❌ (Unless declared for writes) | ✅ | ✅ |
UPDATE users SET name='Bob' WHERE id=1
in PostgreSQL, RisingWave needs to know which row to update. Only a Table, which stores the data’s state and has a primary key, can support this semantic. Furthermore, a CDC stream is a continuous log of changes. If it were just a Source, consistency could not be restored after a task interruption. A Table, on the other hand, can resume from the last checkpoint thanks to its persistence and offset tracking. Finally, a single database transaction might update multiple tables. RisingWave relies on Tables to correctly apply transactional boundaries.
Therefore, for CDC, you must create a table. You can either create a CDC table directly or create a Source first and then derive a Table from it.
CREATE SINK
statement.CREATE SINK AS SELECT <select_query>
syntax.CREATE SINK INTO
command. A common use case for this is to union multiple sources and write them into a single table.