Let's say we want to compute the sum and average of the items,
and can either working with states
or windows
(time).
Example working with windows
-
https://ci.apache.org/projects/flink/flink-docs-release-0.10/apis/streaming_guide.html#example-program
Example working with states
-
https://github.com/dataArtisans/flink-training-exercises/blob/master/src/main/java/com/dataartisans/flinktraining/exercises/datastream_java/ride_speed/RideSpeed.java
Can I ask what would be the reasons to make decision? Can I infer that if the data arrives very irregularly (50% comes in the defined window length and the other 50% don't), the result of the window approach is more biased (because the 50% events are dropped)?
On the other hand, do we spend more time checking and updating the states when working with states?
windows
withstates
is still confused for me. How it can have the same effect asevictor
inwindows
? Why it doesn't have to defined an interval for unbounded stream? the example working withstates
also follows the concept ofevent time
, comparing to the event time with windows what would be the differences? – HungUnicorn