AI Glossary / Data engineering and architecture / Intermediate
Data stream management system
Definition
A data stream management system, or DSMS, is a system designed to manage and query data that arrive continuously. It maintains ongoing computations over streams, often combining incoming records with stored data, and produces results as the relevant inputs change. Continuous queries, state management and resource control are central concerns.
What it means
A familiar database query asks a question about available stored data and returns a result. A continuous query can remain active: for example, “keep reporting each device's average reading over the latest five minutes.” New records and changes to the relevant window update the answer.
This difference affects query meaning as well as implementation. An ongoing stream may have no known end, so waiting for every record before calculating a final answer is impossible. The system needs rules about which records count, when results are emitted and whether later information can revise earlier output.
How it works
A DSMS receives records through input operators and applies a query plan containing operations such as filtering, projection, joins and aggregation. It keeps state needed by those operations, including recent records or compact summaries.
Windows can limit a computation to a defined time interval or number of records. For example, a five-minute window discards records from that query's active scope as they become too old. Window definitions and boundaries are part of the answer's meaning, not just memory-saving implementation details.
The system schedules work and manages queues as arrival rates change. Some designs share computation across queries or use controlled approximation when exact processing cannot keep up. Modern streaming systems also provide mechanisms for handling event time, late data and recovery, although capabilities differ. Stanford's STREAM research prototype and its CQL language are influential examples, not a specification that every DSMS implements identically.
Three practical examples
1. Operational dashboard: a service continuously calculates request counts and response-time summaries over recent intervals. The dashboard receives updated results without repeatedly exporting the entire event history.
2. Sensor analysis: a query combines incoming equipment measurements with a stored table describing each machine. It produces summaries by machine group while maintaining the required recent state.
3. AI feature preparation: a pipeline maintains rolling activity counts for an inference service. The team defines timestamps, duplicate handling and update behavior so the feature means the same thing during development and operation.
Think of it this way
Think of a kitchen order board that continuously shows the number of outstanding meals of each type. New orders add to the count; completed orders leave it. Staff maintain the board as work changes rather than preparing a fresh historical report every time.
The analogy explains a maintained answer. A DSMS adds precise query semantics, automated state management and rules for delayed or repeated records, which a kitchen's informal board may not need.
Worked example
Consider a teaching query that reports the sum of values in the event-time interval (T − 5 minutes, T]. The left boundary is excluded and the right boundary included.
Four records have event times and values: 10:00 → 2, 10:02 → 4, 10:04 → 6 and 10:06 → 8. At T = 10:05, the active interval is (10:00, 10:05], so the sum is 4 + 6 = 10. The 10:00 record is excluded by the stated boundary rule.
At T = 10:06, the interval becomes (10:01, 10:06], producing 4 + 6 + 8 = 18. If a record for 10:03 arrives late, whether it revises an earlier output depends on the configured lateness and result-update policy. These calculations assume known event timestamps and illustrate query semantics, not a particular system's default window syntax.
Illustrative case study
Fictional case: WindowWorks maintains a live operations dashboard. A developer interprets “last five minutes” as the most recent five records because the test source emits one record per minute. The results initially appear correct.
During a burst, five records arrive within several seconds, and the dashboard unexpectedly forgets most of the intended history. The team replaces the implicit assumption with an explicit time-based query and adds examples covering quiet periods, bursts and delayed arrivals. It documents which clock determines membership.
The case shows that a record-count window and a time window answer different questions. No actual company or measured operational improvement is implied.
Common misconceptions and mistakes
Do not assume a continuous query is just a normal query run very frequently. It may maintain state and emit changing results according to distinct semantics.
Do not leave “recent” undefined. Specify time basis, interval length, boundary behavior and treatment of late records.
Do not assume every DSMS stores the entire input stream forever or returns exact answers under any load. Retention, approximation and overload policies depend on the system and configuration.
Business use
A DSMS can support applications where repeatedly scanning full datasets would be wasteful or too slow. Its business value depends on whether continuously updated answers improve a relevant operation.
Evaluation should include correctness under out-of-order arrival, changing rates and recovery, alongside average throughput. For AI features, compare the maintained result with an independently calculated historical result on a controlled sample. This helps reveal semantic mismatches that a fast, apparently stable pipeline would otherwise hide. Operational owners should understand when outputs are provisional and how corrections reach consumers.
People also ask
Is a DSMS the same as a message broker?
No. A broker can transport or retain messages; a DSMS emphasizes ongoing query execution and managed computation over streams.
Can queries combine streams with stored tables?
Yes, many systems support this, but the interpretation of changing reference data must be defined.
Does every window contain the same number of records?
No. Time windows can contain varying counts, while record-count windows define membership differently.
Check your understanding
Why does the 10:00 record not contribute to the sum at 10:05 in the worked example?
Answer: The query explicitly excludes the left boundary of its five-minute interval. A different boundary definition could produce a different result and must be stated.
Related terms
- Stream processing
- Aggregation
- Data stream
- Continuous query
- window
- event time
- watermark
- stateful computation
- stream join
- backpressure
- CQL
Learn next
Learn about window semantics and late-data handling next. Write a small timestamped dataset and calculate a query result manually at several times. Then introduce a late record and specify whether the expected output is updated, delayed or handled separately.
More in Data engineering and architecture
- Data auditing - Data auditing is a systematic examination of data and, where relevant, the processes that handle it against stated criteria.
- Data binding - Data binding is a mechanism that connects data values to another representation so that values can be displayed, transferred or updated according to defined...
- Data blending - Data blending combines information from separate sources for an analysis or view, using agreed links and compatible levels of detail.
- Data-centric computing - Data-centric computing is an approach to computer-system design that treats the location, movement and access patterns of data as central concerns.
- Data-centric programming language - A data-centric programming language emphasizes describing, querying and transforming collections of data.
- Data-centric security - Data-centric security is an approach that organizes protection around the information itself: what it contains, how sensitive it is, who may use it and...
Sources
Arasu and colleagues, STREAM: The Stanford Data Stream Management System, original system description: https://cs.brown.edu/courses/cs227/archives/2015/papers/ss-STREAM.pdf
Arasu, Babu and Widom, The CQL Continuous Query Language, formal semantics and windows: https://web.stanford.edu/class/cs245/readings/cql.pdf
Apache Flink, contemporary event-time and window concepts: https://nightlies.apache.org/flink/flink-docs-stable/docs/learn-flink/streaming_analytics/
Primary papers and documentation consulted. The worked interval and fictional case are original examples with explicitly chosen semantics.
Previous: Data stream Next: Data stream mining