Real time is expensive and rarely needed everywhere. How batch, streaming and change data capture (CDC) actually work, what each one costs to run, how to measure the latency the business really needs, and a grid to decide source by source.
"We want real time." The request comes up in almost every data platform project. It comes from a real frustration: numbers that arrive too late. But a real-time pipeline costs more to build, to monitor and to change. And most decisions do not change whether the data is ten minutes or an hour old.
The right ingestion mode is chosen source by source, from two questions: when does the data need to be available, and what can the system that produces it handle? This article explains how each mode works underneath, because the cost differences come from there, then gives a grid to decide.
Batch: copy at fixed intervals
Batch copies data at fixed intervals: every night, every hour. A scheduled job reads the source, either the whole table or only the rows changed since the last run, and loads them into the warehouse.
It is the simplest mode to build, rerun and check. A failed run can be replayed. Quality tests run on a complete load, so a check like "the total equals the sum of the lines" sees all the lines. When something goes wrong at 3am, the fix can wait for the morning, because the next run is hours away.
Its limit is in the name: the data is as old as the last load. There is a second, quieter limit. An incremental batch finds changed rows through a "last modified" date. If the source does not maintain that date reliably, changes are missed. And a deleted row leaves no trace: it is simply no longer there, so a batch that only reads recent changes never learns it was removed.
Streaming: send each event as it happens
Streaming sends each event as it happens: a click, a payment, a sensor reading, a parcel scan. Instead of a job that starts and stops, a service runs continuously, receives events and passes them on within seconds.
That continuity is where the cost comes from. The infrastructure runs all the time and must be monitored all the time. Messages can arrive twice, so processing must cope with duplicates. Messages can arrive late or out of order: a phone that was offline sends its events an hour later. Somebody must decide how long to wait for late data before publishing a figure, and what to do when it arrives after that.
These are not edge cases. They are the central problem of stream processing, and Google engineers described it in 2015 in a paper called The Dataflow Model, whose subtitle sums up the trade-off: balancing correctness, latency and cost. The paper separates the time an event happened from the time it is processed, and introduces watermarks, an estimate of how far the pipeline has progressed in event time, to decide when a result can be considered complete. Every streaming system has to make the same choices, explicitly or not. Streaming is justified when an action must follow the event within seconds, and the team can run it.
Change data capture: read the database's own log
Change data capture (CDC) sits between the two. It reads the source database's log to pick up only the rows created, changed or deleted, close to the moment they change.
Most databases keep a log of every change they make, for their own recovery and for replication to other servers. Jay Kreps, then an engineer at LinkedIn, described in a widely read 2013 essay why that ordered log of changes is the most natural way to move data between systems: anyone who reads the log in order can rebuild the same state. CDC tools do exactly that. They read the log instead of querying the tables.

The Debezium documentation shows what this looks like in practice. Its MySQL connector reads the binlog, MySQL's change log. Its PostgreSQL connector reads PostgreSQL's logical replication stream. By default, the changes of each table go to their own stream of events, which other connectors deliver to a warehouse or a search index. The tool can also run without Kafka, as a standalone server or embedded in an application.
Reading the log has three advantages over querying the tables:
- deletions are visible: a deleted row appears in the log as a delete event;
- little load on the source: no heavy query runs against the production tables;
- every change, in order: not just the final state at the time of the copy.
It has one strong requirement: access to the log. Many software vendors and hosted services do not give it, and some database administrators are reluctant to. Check before designing anything around CDC.
The latency the business actually needs
Before choosing, ask each user which decision they make with the data, and how often. The answers almost always fall into four levels:
- next morning: leadership reporting, accounting, weekly sales reviews;
- within the hour: same-day sales tracking, replenishment, running a call centre;
- within minutes: logistics tracking, stock availability shown to customers;
- within seconds: fraud detection, security alerts, dynamic pricing.
Most companies have one or two sources at the last level, rarely more. Everything else is well served by an hourly or daily batch.
Source-system constraints
The best mode on paper can be impossible in practice. For each source, check:
- access: API, file export, direct database reads, access to the transaction log;
- acceptable load: a production ERP cannot always take heavy queries during the working day;
- deletions: a full copy does not see a deleted row, CDC does;
- timestamps: without a reliable last-modified column, an incremental batch misses changes;
- vendor limits: API quotas, licences, no database access for SaaS software.
These constraints often settle the debate before latency even comes up.
What each mode costs to run
The build cost is visible in the project budget. The running cost is not, and it decides whether the pipeline survives its first year:
- batch needs a scheduler and checks after each run. A failure is noticed at the next run and replayed;
- CDC needs a service that reads the log continuously, and a way to restart from the right position after an incident, without losing or repeating changes;
- streaming needs a service that is always on, alerts that wake someone up, and rules for late and duplicate events that the business has agreed to.
A useful question for any "real time" request: who will be called at night when it stops, and what will they do? If nobody can answer, the source should start in batch.
A decision grid
For each source, answer these questions in order:
- Must the decision follow the event within seconds? Yes: streaming. No: next question.
- Do you need data a few minutes fresh, or to track deletions? Yes, and the source database exposes its log: CDC. Yes, without log access: frequent incremental batch, with a check for deletions.
- Otherwise: batch, hourly or daily depending on the latency level.
Write down the choice and its reason in the documentation for each flow. When a need changes, everyone knows what was decided and why, and only the source that justifies it moves to real time.
Where to start
- List your sources and, for each, the decision it feeds.
- Place each use in one of the four latency levels.
- Check access and acceptable load with the team that runs each source.
- Apply the grid, and start with batch wherever it is enough.
These choices are at the heart of our data engineering and integration work. If you do not know which sources cause problems today, our data platform assessment builds that inventory in two to three weeks.
Sources
- Tyler Akidau et al., "The Dataflow Model: A Practical Approach to Balancing Correctness, Latency, and Cost in Massive-Scale, Unbounded, Out-of-Order Data Processing", Proceedings of the VLDB Endowment, vol. 8, 2015, pp. 1792-1803. research.google.
- Jay Kreps, "The Log: What every software engineer should know about real-time data's unifying abstraction", LinkedIn Engineering, 16 December 2013. web.archive.org.
- Debezium documentation, "Debezium Architecture". debezium.io.

