top of page

Data Quality in Real-Time Pipelines: Why Batch Validation Rules Don't Apply

Writer: Vexdata
Vexdata
32 minutes ago
8 min read

Streaming pipelines are no longer the exception. Payment events, IoT sensor readings, clickstream data, logistics updates — more data moves in real time than ever before, and the expectation that insights are available within seconds rather than hours has become a baseline requirement for most modern data products.


Data quality tooling has not kept pace with this shift.


Most data quality frameworks — the checks, the rules, the monitoring approaches — were designed in an era when data moved in batches. You run your pipeline, your data lands in a table, and then you validate it. The full dataset is available. You can look across rows, calculate distributions, compare current state to historical patterns.


Stream processing changes every one of those assumptions. Data arrives continuously, often out of order, in variable volumes, with no clean start and end. The validation logic that works perfectly on a batch of yesterday's records does not translate to a stream of events arriving at ten thousand per second.


This post explains precisely what breaks when you apply batch-era thinking to real-time pipelines, what the right validation approach looks like in a streaming context, and where batch and stream validation should genuinely co-exist rather than compete.


How Batch Validation Works and Why It Falls Apart in Streaming

Batch validation rests on a set of assumptions so fundamental that most data teams have never needed to make them explicit. The data has landed. You have all of it. You can look at the entire dataset before deciding what is good and what is not.


This makes certain checks straightforward. You can check that the count of records today matches yesterday within a reasonable range. You can flag records where a value sits more than three standard deviations from the column mean. You can verify that every order ID in your orders table exists in your customers table. These checks require the full dataset to be present before they run.

In a streaming pipeline, the full dataset never exists. Data is a continuous flow, not a finite set.


Referential integrity checks break immediately. If you want to validate that every event ID in your stream has a corresponding record in a reference table, you need to either maintain a local copy of that reference data at the stream layer or accept that some checks simply cannot run at ingest time.


Statistical distribution checks are window-dependent. There is no "today's data" when events arrive continuously. Any check based on distribution, volume, or ratio requires you to define a time window first — and the choice of window significantly changes what the check will and will not catch.


Late-arriving data invalidates point-in-time checks. A check that passed at 14:00 may no longer be valid at 14:05 when late events arrive and change the picture. Batch validation assumes the data is complete when the check runs. Stream validation cannot make that assumption.


Alert latency requirements are incompatible with post-hoc validation. If a payment fraud signal needs to trigger a block within 200 milliseconds, running validation after the fact is not a data quality strategy. The check has to happen in the pipeline, before the event is acted on.


The 4 Core Challenges of Real-Time Data Quality

Four challenges come up consistently when teams try to build real quality discipline into streaming pipelines. Each one requires a different response.

1. Late-arriving data

Events do not always arrive in the order they were generated. A mobile app event created at 13:00 might arrive in your Kafka topic at 13:08 because the device was briefly offline. A sensor reading timestamped at noon might arrive after your 12:05 processing window has already closed.

When a check depends on completeness — all events for a given transaction or session present before evaluation — late arrival means you either miss the check, run it prematurely, or hold the window open long enough to increase latency to the point where the real-time advantage disappears.

2. Out-of-order events

Related to late arrival but distinct: events that arrive in an order that does not match their actual event time. A sequence of three user actions that arrives as action 3, action 1, action 2 is not a data quality failure in the traditional sense — the data may be correct — but any check that assumes ordering will produce incorrect results.


3. No full-set context for cross-record checks

Many of the most useful data quality checks are relational. Does this order ID match a valid customer? Does this transaction value exceed the account limit for this user? Does this sensor reading fall within the expected range for this device at this time of day?


In batch, you join to the reference table and check. In streaming, the reference data must be available locally at the stream layer, kept current, and queryable at the speed the stream demands. That is a significantly harder infrastructure problem than it appears.


4. Aggregation-based rules require window definitions

A rule like "flag any user who places more than ten orders in a five-minute window" sounds simple. Implementing it correctly in a stream requires defining a tumbling window, a sliding window, or a session window — and each choice produces different results. The window definition is part of the data quality rule, not just an implementation detail, and changing it changes what the rule catches.


What Real-Time Validation Actually Looks Like

A streaming-native validation approach is built around the constraints of the stream, not retrofitted from batch logic. In practice, this means organising validation into what can be checked immediately at the record level and what requires a window or downstream pass.


Record-level checks at ingest

The fastest and most reliable checks are those that require only the current event to evaluate. Schema validation — is this event in the expected format? Field presence — are required fields populated? Type checks — is the timestamp actually a timestamp? Value range checks — is this sensor reading within physically plausible bounds?

These checks run at ingest, before the event moves further into the pipeline. Any event that fails them either gets routed to a dead-letter queue for review or triggers an immediate alert, depending on the severity and use case. They add microseconds, not seconds, to pipeline latency.


Schema enforcement at the stream layer

For pipelines using Kafka, schema enforcement via a schema registry means that producers cannot push events that do not conform to the agreed schema. This is not a check you run on the data after the fact — it is a constraint that makes non-conforming events impossible to publish. It is the streaming equivalent of a column constraint in a database, and it eliminates an entire class of quality failures before they can enter the pipeline.


Windowed anomaly detection

For checks that require context — volume anomalies, rate changes, sequence violations — windowed aggregations are the right mechanism. Define the window, calculate the metric over that window, and evaluate the metric against the expected range. The window type (tumbling, sliding, session) should be driven by the nature of the check, not by convenience.


Alerting latency as a first-class requirement

A data quality check in a real-time pipeline has a latency budget. If a fraud signal needs to block a transaction before it clears, the check and the alert need to happen within that clearing window. Building validation without defining the latency requirement is building it without understanding the problem. Every check in a streaming pipeline should have an explicit answer to the question: how quickly does a failure need to be surfaced?


Where Real-Time and Batch Validation Should Co-exist

Real-time validation and batch validation are not competing philosophies. They address different parts of the quality problem, and a mature pipeline needs both.

The mistake is treating them as alternatives: either you validate at the stream layer or you run a batch check downstream. In practice, the checks that make sense at the stream layer are fundamentally different from the checks that require a batch pass.


What belongs at the stream layer: record-level completeness and format checks, schema enforcement, immediate anomaly detection, latency-sensitive fraud or risk signals. These checks need to run before the event is acted on, within the latency budget of the pipeline.


What belongs in a downstream batch pass: referential integrity across full datasets, reconciliation between streaming aggregates and source-of-truth systems, statistical distribution checks over longer time horizons, checks that require joining across multiple event streams where maintaining that join at real-time speed is prohibitively complex.


The downstream batch pass is not a fallback for validation you could not get into the stream. It is a deliberately different layer of the quality programme, running checks that the stream layer is structurally unable to perform. In regulated industries especially, the batch reconciliation layer is often what satisfies audit requirements — because auditors want to see the final state validated against the authoritative record, not just that individual events passed ingest checks.


Designing a real-time data quality programme means being explicit about which checks belong where, and ensuring that the two layers are complementary rather than redundant.


Industries Where This Matters Most

Four industries carry the most concentrated exposure to real-time data quality failures, and each one illustrates a different dimension of the problem.


Fintech and payments

Payment event streams are where the latency requirement is most acute. A fraudulent transaction that needs to be blocked has a window measured in milliseconds. Real-time validation here is not about data quality in the abstract — it is about catching malformed events, out-of-range values, and sequence anomalies before they propagate into settlement systems. The cost of a false negative is a completed fraudulent transaction. The cost of a false positive is a declined legitimate payment and a customer support call.


IoT and manufacturing

Sensor data arrives at high volume, often from hardware that is degrading, miscalibrated, or intermittently offline. A temperature sensor that starts returning values 15 degrees above its historical range might be detecting a real event — or it might have failed. Getting this wrong in one direction means ignoring a real equipment fault. Getting it wrong in the other direction means triggering an unnecessary shutdown.


Real-time validation on sensor streams means maintaining expected value ranges per device, detecting anomalies at the event level, and distinguishing between data quality failures and actual physical signals — which requires device-level context available at the stream layer.


Logistics and shipment tracking

Shipment event streams — pickup, in-transit, delivery confirmations — feed customer-facing tracking systems and operational dashboards. Out-of-order events are common because scan hardware in different facilities updates at different rates. A delivery event arriving before an in-transit event is a data ordering problem, not necessarily a data error, but it will display as a quality issue on any customer-facing system that expects sequential status updates.


Digital advertising

Impression and click event streams are among the highest-volume data sources in existence, and they are also among the most prone to quality problems: bot traffic, duplicate events, attribution mismatches, and timestamp skew across ad servers. Real-time validation here directly affects billing accuracy and campaign performance measurement — two things that advertisers and agencies audit closely.


Stop Applying Batch Thinking to a Streaming Problem

The data quality tooling most teams rely on was built for a world where data was stationary long enough to be fully checked before it was used. That world is shrinking.

Streaming pipelines are now a standard part of the data stack — not an edge case handled by a specialist team. And as more decisions get made on real-time data, the quality of that data at the moment it enters the pipeline matters more than it ever has.


The teams that are ahead of this problem have done three things. They have separated what needs to be validated in the stream from what needs a downstream batch pass. They have built record-level checks that run within the latency budget of the pipeline. And they have accepted that streaming data quality is a different engineering problem from batch data quality — not a harder version of the same problem.


Vexdata is built to handle data validation across both batch and streaming contexts, with checks designed for the constraints of real-time pipelines rather than retrofitted from batch tooling. If your data quality programme has not yet caught up to your streaming infrastructure, that is worth looking at.

 
 
 

Comments


bottom of page