Meaning
Computational burdens represent the additional CPU cycles and memory bandwidth consumed solely for the purpose of managing and updating persistent variables. In a stream processing engine, state execution overhead is the difference between the time taken to process an event and the time spent interacting with the state backend. This overhead includes the costs of serialization, network transport, context switching and locking mechanisms.
It is a fixed tax on every operation that requires access to persistent data. The boundary of this concept is the point where the overhead is zero, which only occurs in stateless applications.
Processing Cost
Updates to a counter or a window require several steps that consume CPU time. This processing cost is the most visible part of the overhead. It includes the logic for checking if the state exists, modifying it and then marking it as dirty for the next checkpoint.
Reducing this cost often involves using more efficient data structures within the state itself.
Throughput Impact
High levels of overhead directly reduce the total number of events a system can process per second. This impact is ordinal, as the system slows down relative to the complexity of the state management tasks. In systems with very complex state, the overhead can account for more than half of the total processing time.
Optimizing the way the state is accessed can reclaim this lost capacity.
Memory Requirement
Storing the state in memory for fast access increases the total RAM footprint of the application. This memory requirement is a cardinal cost that must be balanced against the need for speed. If the state is too large for memory, it must be spilled to disk, which noticeably increases the execution overhead.
Maintaining this balance is a central requirement for large-scale stateful systems.