In a computer program, when values change over time we call this state. This is why we have two different words available to us for differentiating the context: the specific use of “state” instead of “value” signifies to the reader that we are intentionally composing two things, namely value and time.
Each of those concepts are simpler to reason about on their own, but when put together they require much more care. When you hear people saying “state is inherently complex”, this is what they are referring to. This is especially relevant when we are learning about data streaming tools as they need to consider state in many areas, and at scale: windowed aggregations, joins and other stateful operations, not to mention horizontal scaling, memory management through watermarks and checkpoints, fault tolerance and more.
So how best to understand the state management of these tools? Let’s take a look at what some of the most popular options provide to educate and inform users in this regard:
Tool | Flink | Kafka Streams | Spark Structured Streaming | Storm |
---|---|---|---|---|
Word count of reference docs | 20,042 | 45,492 | 19,908 | 28,682 |
Informing users on stateful operations: t = written text d = diagrams & charts a = animations u = unit test facility s = simulator | t,d,u,s 1 | t,d,u | t,d,u | t,d,u |
Execution plan checked against documented capabilities before running it? | Yes 2 | No 3 | Yes 4 | Yes 5 |
If a simulator is available, where does it run? 1 = local 2 = browser + server / cloud 3 = browser only | N/A | N/A | N/A | N/A |
Based on the above, we can see that
With that in mind, consider again that stateful data streaming problems necessarily involve the consideration of time, and as such they are fundamentally a dynamic concern. By contrast, written documentation is of course only static and for that reason I will submit that it is inefficient and inadequate for the intended purpose.
Indeed, I was affected by this issue personally when I ran into trouble with one of these tools. I still don't know if the problem I encountered is due to a misunderstanding of the (20,000 word) documentation or a bug.
So what’s the solution? Well, consider that we learn best by a combination of reading and doing rather than by reading alone. The “doing” is something that happens in real time, and one way to achieve this is by simulation.
In our case, I will define a simulation thus:
A means to observe the effects of a stateful operation, where for the same input as given to the production equivalent, the simulation will give the same output.
Given the stated purpose of a simulator in our case is to educate and inform, I will also add to the definition that it must require zero installation or setup. Further, to reduce costs and complexity it should also require minimal resources and ideally be fully serverless or standalone in operation. Finally, since the goal is to represent stateful operations, it should be capable of representing those in a visual dynamic by using animated forms for example.
I think there’s an opportunity for these tools (or new ones) to provide visual simulators as the primary means of reasoning for their stateful operations, and also as a complement to their existing documentation.
So with that out of the way, if we could build such a simulator what would it look like, how would it work and how could it be built? Here’s a motivational blueprint!
In conclusion, I hope you can appreciate the benefits that simulations would bring in this space, and I also hope to have suitably motivated other people in the community to take the baton!
Igor Garcia for your feedback and advice: thank you 🙏
Published: 2025-05-28