In RisingWave, a Subscription is a feature that allows external applications or services to consume changes from a Materialized View or a Table in a streaming fashion. When data in the source Materialized View or Table changes (due to incoming stream data being processed), RisingWave automatically sends these changes (inserts, updates, deletes) to active subscribers.
This provides a powerful mechanism for downstream systems to react to real-time updates and maintain consistency with the data managed by RisingWave, without needing to repeatedly poll the views or tables for changes.
-- Example (syntax might vary based on the exact RisingWave version and target)
CREATE SUBSCRIPTION my_subscription
FROM my_materialized_view
PUBLISH VIA KAFKA 'kafka_broker_address' TOPIC 'my_topic'
FORMAT JSON;
Subscriptions are a powerful feature in RisingWave for building reactive, event-driven architectures and integrating processed streaming data with the wider data ecosystem.