An Emit Strategy (or Output Mode, Trigger Strategy) in stateful stream processing defines when and how results are produced and sent downstream from operators, particularly those involving Windowing or stateful aggregations. It controls the timing and frequency of output updates based on the arrival of new data or the progression of time.
Different emit strategies offer trade-offs between result freshness (latency), completeness, and the volume of downstream traffic generated.
Consider a continuous query calculating the count of events within a 5-minute Tumbling Window. When should the system output the result for a specific window (e.g., 10:00 AM - 10:05 AM)?
The emit strategy dictates which of these (or similar) behaviors is chosen.
Different stream processing systems use varying terminology, but common strategies include:
Emit on Watermark / On Window Close:
Emit Immediately / Continuous Mode:
Periodic Emit / Processing Time Trigger:
Accumulating Mode: (Similar to Emit Immediately for windows)
Accumulating & Retracting Mode:
RisingWave primarily uses a continuous, "Emit Immediately" strategy by default for its Materialized Views.
Understanding the emit strategy is crucial for interpreting the output of a streaming job and designing downstream consumers correctly.