Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeReal-time data integration moves data from where it is created to where it is used within seconds instead of waiting for a scheduled job. Streaming, change data capture (CDC) and micro-batch are the three patterns, and the right one depends on the age of data at the moment someone looks. For most analytics, leaving hourly batch matters more than shaving the last minute.
What you will learn
- Think in data age: capture + wait + processing + load + dashboard refresh; in the sample a 60-second refresh is 97% of the streaming design's 61.9 seconds
- Cost grows with freshness: the sample stream costs $94 a month provisioned or $444 on-demand, and always-on compute costs 4× a job run 15 minutes per hour
- Choose from the decision, not the technology: if a number 15 minutes late changes nothing, batch is enough
What real-time data integration means
Real-time data integration moves data from where it is created to where it is used within seconds, continuously, instead of waiting for a scheduled job. "Real time" is a spectrum, not a switch. The useful way to talk about it is the age of the data when someone looks at it: seconds, a minute, an hour or a day.
Three patterns get called real time, and they answer different questions:
- Streaming: events are published as they happen and consumed continuously.
- Change data capture (CDC): changes in a source database are read from its transaction log and sent on.
- Micro-batch: data is processed in very small, frequent batches that look like a stream from outside.
They are not rivals so much as different tools. CDC is a way to get changes out of a database; streaming and micro-batch are ways to process a flow of records. This article compares them on latency, cost and failure behaviour, then gives rules for choosing. For the wider map of integration methods, including ETL and ELT, see data integration approaches; for platforms, see real-time analytics platforms.
The three patterns side by side
| Streaming | CDC | Micro-batch | |
|---|---|---|---|
| What is read | Events published to a log or queue | Row changes from the database's transaction log | Small slices of new data, on a short trigger |
| Unit | One event | One inserted, updated or deleted row | A batch of seconds' worth of records |
| Best-case latency (documented) | Milliseconds in continuous mode | Depends on the connector and the downstream | "As low as 100 milliseconds" in Spark's default engine |
| Delivery guarantee | Depends on engine; at-least-once is common | Depends on connector and sink | Exactly-once with replayable sources and idempotent sinks |
| Captures deletes | If the producer emits them | Yes, as delete events | If the source keeps them |
| Typical fit | Per-event actions, alerts, live counters | Copying operational tables to analytics | Near-real-time dashboards and aggregates |
Two of those cells come straight from documentation. The Apache Spark Structured Streaming guide says its default micro-batch engine "processes data streams as a series of small batch jobs thereby achieving end-to-end latencies as low as 100 milliseconds and exactly-once fault-tolerance guarantees", and that its continuous processing mode can reach "as low as 1 millisecond with at-least-once guarantees". Those are best-case figures; your numbers will depend on the sink, the data size and the cluster.
Debezium's PostgreSQL connector documentation describes the CDC side: it "continuously captures row-level changes that insert, update, and delete database content" and generates "a data change event for each row-level INSERT, UPDATE, and DELETE operation", using logical decoding, "a mechanism that allows the extraction of the changes that were committed to the transaction log".
Latency is a sum, and the dashboard is often the biggest term
When someone asks for "real-time", ask what happens after the data lands. End-to-end data age at the moment of viewing is the sum of five stages:
data age ≈ capture + wait for trigger or schedule + processing + load + dashboard refresh
Sample data: three designs for the same orders feed, with a dashboard that refreshes every 60 seconds. Times are worst-case seconds, chosen for the example.
| Stage | Streaming | CDC with micro-batch merge | Hourly batch |
|---|---|---|---|
| Capture | 0.1 | 0.5 | 0 |
| Wait for trigger or schedule | 0 | 30 | 3,600 |
| Processing | 0.8 | 20 | 600 |
| Load | 1.0 | 10 | 300 |
| Dashboard refresh | 60 | 60 | 60 |
| Worst-case data age | 61.9 s | 120.5 s | 4,560 s (76 min) |
Two things follow from the arithmetic. First, the streaming design's pipeline takes 1.9 seconds and its dashboard refresh takes 60, so refresh is 60 ÷ 61.9 = 97% of what the viewer experiences. Spending money to cut the pipeline from 1.9 to 0.5 seconds changes almost nothing until the refresh interval drops. Second, the gap between the CDC design (about 2 minutes) and the hourly batch (76 minutes) is far larger than the gap between streaming and CDC. For most analytics questions, the step that matters is leaving hourly batch, not shaving the last minute.
What each pattern costs
Freshness is paid for in compute that is always on and in the stream itself. Two recomputable examples, with prices read from AWS's Kinesis Data Streams pricing page on 2026-11-22 for the US East (N. Virginia) region.
The stream. Sample data: 2,000 events a second, each about 1 KB, for a 30-day month (720 hours). A provisioned shard takes up to 1 MB per second or 1,000 records per second in, so 2,000 records a second needs 2 shards.
- Shards: 2 × 720 h × $0.015 = $21.60
- PUT payload units (25 KB each, $0.014 per million): 2,000 × 2,592,000 s = 5,184 million records, each one unit, so 5,184 × $0.014 = $72.58
- Provisioned total: $94.18 a month for the stream alone
The same volume in on-demand Standard mode is 2,000 × 1 KB = 2 MB per second, or 5,184 GB a month (counting 1 KB as 1,000 bytes), so data in costs 5,184 × $0.08 = $414.72, plus 720 stream-hours × $0.04 = $28.80, for $443.52 before data out. On-demand removes capacity planning, and at a steady 2,000 events a second it costs about 4.7 times as much as provisioned.
The compute. Sample data: a processing job costing $0.50 an hour. Always on for the month it runs 720 hours: $360. Run for 15 minutes every hour it runs 180 hours: $90, a quarter of the cost. The always-on job buys a data age of seconds instead of up to an hour.
| Cost line (sample) | Monthly |
|---|---|
| Stream, provisioned (2 shards, 5.2 billion events) | $94 |
| Stream, on-demand standard | $444 |
| Processing always on | $360 |
| Processing scheduled 15 min per hour | $90 |
These prices exclude storage, consumers, data out and the warehouse. The point is the shape: reducing data age from an hour to seconds multiplies the running cost by a factor of about four on the compute side alone, before the stream.
Monthly cost of freshness
sample, USDFailure behaviour: what breaks quietly
Fast pipelines fail differently from slow ones, and the failures are rarely loud.
- Duplicates and gaps. Spark's documentation says end-to-end exactly-once needs "replayable sources and idempotent sinks"; if your sink is not idempotent, a restart can double-count. Make writes keyed, for example by order id.
- CDC log retention. The Debezium documentation notes that PostgreSQL "normally purges write-ahead log (WAL) segments after some period of time", so a connector that is down for long enough may not be able to catch up. A CDC pipeline needs an alert on connector lag.
- Late and out-of-order events. A phone that was offline sends yesterday's events today. Decide how long you will wait before closing a window and whether late events update past numbers.
- Schema changes. A new or renamed column in the source can break a downstream merge. Test with a column added.
- Silent staleness. The scariest failure is a dashboard that looks fine and is six hours old. Show "data as of" on the dashboard.
How to choose
Start from the decision, not the technology. Ask: what would someone do differently if this number were 15 minutes late? If the answer is "nothing", you do not need real time.
| If the decision is... | Freshness needed | Use | Why |
|---|---|---|---|
| A weekly or daily report | Hours to a day | Scheduled batch | Cheapest, simplest to reproduce |
| A campaign or traffic check during working hours | 1 to 5 minutes | Micro-batch | A minute of age is fine, cost stays near batch |
| An alert someone must act on | Under a minute | Streaming or micro-batch with a short trigger | Alerts lose value with every minute |
| Copy operational tables into analytics, including deletes | Minutes | CDC, then micro-batch merge | Reads the log instead of polling the tables |
| Per-event action such as a block or an in-session offer | Under a second | Streaming | Latency is part of the product |
Three more criteria:
- Who maintains it. Streaming and CDC need on-call ownership; a failing batch job can wait until morning.
- Do you need history or just the latest state? CDC gives every change, streaming gives every event, a nightly snapshot gives only the latest state.
- Can the consumer keep up? A dashboard that refreshes every minute cannot use a one-second pipeline.
| If the decision is... | Freshness needed | Use |
|---|---|---|
| A weekly or daily report | Hours to a day | Scheduled batch |
| A campaign or traffic check in working hours | 1 to 5 minutes | Micro-batch |
| An alert someone must act on | Under a minute | Streaming or micro-batch with a short trigger |
| Copy operational tables into analytics, with deletes | Minutes | CDC, then micro-batch merge |
| A per-event action such as a block or in-session offer | Under a second | Streaming |
Freshness bands are working rules for this article; latency figures for Spark are documented best cases, not guarantees.
Real time for web and app analytics in TapCub
TapCub is a collection and analysis product. It does not run CDC, a message bus or stream processing for your warehouse. It gives you a fresh view of visitor behaviour and ways to move data in and out.
- Check freshness first. Web analytics › Realtime shows visitors with an event in the last 5 minutes, active pages and sources over the last half hour, and a feed of events with a pause button. After you install the script, a pageview should appear within seconds.
- Send server events. Send purchases and signups from your server through the HTTP interface, with the order id so a retry does not create a second order. Historical events sent by the server that are more than 72 hours old are recorded with the receive time as the event time, so late backfills do not rewrite past days.
- Import history. All-platform analytics › Data › Data import takes CSV events, CSV user properties and Nginx or Apache logs, up to 100,000 lines per file, for catching up after a gap.
- Get an alert for a number that matters. All-platform analytics › Operations › Monitors checks by the hour, day, week or month and notifies by email, WeCom, DingTalk, Feishu or webhook. A dry run tells you how many times it would have fired in the past 30 days.
- Export raw detail. For the warehouse, use All-platform analytics › Data › Data export, an asynchronous export of detail within the retention period; console reports are summaries.
TapCub's Realtime and monitors cover the "see it now" and "tell me when it moves" cases. If you need sub-second per-event decisions or database replication, build that in your own stack and send the results to TapCub as events.
FAQ
What is real-time data integration?
It is moving data from its source to where it is used continuously, with latency of seconds rather than the hours of a scheduled batch job. The main patterns are streaming of events, change data capture from a database log and micro-batch processing. What matters is the age of the data when someone looks at it, not the technique.
Is CDC the same as streaming?
No. Change data capture reads row-level inserts, updates and deletes from a database's transaction log. Streaming is the continuous flow and processing of records. CDC often feeds a stream, but it is one way of obtaining changes, not a processing model in itself.
What is the difference between micro-batch and streaming?
Micro-batch processes data in very small batches on a short trigger and can offer exactly-once guarantees; Spark documents latencies as low as 100 milliseconds. Record-at-a-time streaming can reach about 1 millisecond in Spark's continuous mode, with at-least-once delivery. Most dashboards cannot tell the difference.
How much does real-time integration cost?
More than batch, in two places: the stream and always-on compute. In the sample, a provisioned stream of 2,000 one-kilobyte events a second costs about $94 a month and the same volume on-demand about $444, and an always-on job costs four times a job that runs 15 minutes per hour. Storage and consumers come on top.
Do I need real time for my dashboards?
Usually not. Ask what someone would do differently if the number were 15 minutes late. If nothing changes, an hourly or daily refresh is cheaper and easier to reproduce. In the sample, a 60-second dashboard refresh accounts for 97% of the streaming design's data age, so refresh is the first thing to fix.
Sources
- Apache Spark, Structured Streaming Programming Guide (micro-batch latency "as low as 100 milliseconds", continuous processing "as low as 1 millisecond"). Checked 2026-11-22.
- Apache Spark, Structured Streaming: Getting Started (fault tolerance semantics, exactly-once). Checked 2026-11-22.
- Debezium, Connector for PostgreSQL (row-level change capture, logical decoding, WAL retention). Checked 2026-11-22.
- Amazon Web Services, Amazon Kinesis Data Streams pricing (US East shard-hour, PUT payload units and on-demand rates). Checked 2026-11-22.
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Customer Experience Consultant
Writes about live chat, visitor conversations, and self-service, sharing practical ways to make customer communication clearer and more effective.
