You order an Uber. You watch the car move on the map, second by second. You order food. You watch the courier turn the corner. You send a message. It says “Seen.” You swipe your card in Tokyo. Your bank texts you in 2 seconds: “Was that you?”
None of that is magic. None of it is batch. All of it is real-time data — data processed as it happens, not in a nightly job at 2 a.m.
Finally Free Productions’ piece on how real-time data is reshaping modern applications makes the core point: modern apps no longer wait for yesterday’s report to make today’s decision. That is the headline. This article is the full system: why batch broke, what “real-time” actually means in milliseconds, the 5 patterns that power every modern app, Kafka + Flink vs the alternatives, WebSockets vs SSE vs WebRTC, how AI changed everything, when not to go real-time, and the exact checklist to ship it without losing data, money, or sleep.
The Verdict In 30 Seconds
| Question | Answer |
|---|---|
| What is real-time data? | Data processed continuously as it is generated, with latency measured in milliseconds to seconds — not hours to days. |
| Why now? | Users expect it. AI needs it. 5G, cloud, and streaming tools made it cheap. Batch is still fine for history, useless for live decisions. |
| What stack? | Kafka for the log, Flink for processing, a fast store (ClickHouse / Redis / Postgres) for serving, SSE / WebSockets for the browser. |
| What breaks? | Late data, duplicates, ordering, backpressure, schema changes. Exactly-once is end-to-end, not a checkbox. |
| When NOT to use it? | If your latency budget is minutes, not seconds, and stale data costs you nothing. Batch + fast OLAP will save you months. |
Batch Was A Hack. We Just Forgot It Was A Hack.
For 40 years, we processed data in batches because we had to, not because it was right.
Batch says: collect everything all day, then at midnight, run a giant ETL job, load it into a warehouse, and in the morning, look at what happened yesterday. That made sense when disks were slow, networks were slow, and computers were expensive.
It makes no sense when your business happens in real time. Execution of business events has always occurred in real time. Batch is an artificial construct driven by the limitations of old processing. Your customer does not buy “yesterday.” Your fraudster does not steal “yesterday.” Your driver does not crash “yesterday.” They do it now.
Microsoft Fabric’s real-time guide puts it bluntly: batch systems operate on a delay that does not impact historical reporting, but is not sufficient for live operations, and streaming flips that model, delivering a continuous flow of insights when they matter most — now. And the numbers back it: in Confluent’s 2024 Data Streaming Report, 51% of IT leaders cited data streaming as a top strategic priority, up from 44% in 2023, and 68% expected use to keep growing.
Think of it like this: batch is a photo. Real-time is a video. A photo tells you what happened. A video lets you react while it is happening. And in 2026, every app your users love — Uber, DoorDash, WhatsApp, Figma, ChatGPT streaming its answer token by token, Robinhood and Stripe checking fraud checks — is a video, not a photo.
What “Real-Time” Actually Means (It Is Not Instant)
Nothing is instantaneous. A message always needs time to be produced, queued, sent, forwarded, decoded, and shown. Real-time just means: fast enough that the user does not notice the delay, and the business can still act.
| Latency Budget | What It Feels Like | Examples |
|---|---|---|
| < 50 ms | Instant, multiplayer | Game state, trading, voice, WebRTC |
| 50–500 ms | Live, conversational | Chat, collaborative editing, fraud check, live dashboard |
| 500 ms – 5 sec | Near real-time | Uber ETA, delivery tracking, notifications, AI token streaming |
| 5 sec – 1 min | Fresh, not live | Analytics dashboard, inventory, personalization |
| 1 min – 1 hour | Micro-batch | Reports, alerts that can wait, ETL |
| Hours – days | Batch | Monthly reports, billing, historical ML training |
Most “real-time” apps are not 10ms. They are 200ms to 2 seconds, end to end. And that is enough. The goal is not to beat physics. The goal is to beat your competitor’s nightly batch.
The 3 times you must get right:
- Event time: When it actually happened at the device. A phone in a tunnel sends a GPS ping at 10:00, but it arrives at 10:05. Event time is 10:00.
- Processing time: When your server received it. 10:05. If you aggregate by processing time, you will put that ping in the wrong 5-minute window.
- Watermark: Your promise: “No more events with timestamp < T will arrive.” Watermarks let you close a window and fire a result, even if a few stragglers are still coming. Too early, you miss late data. Too late, you are slow. Tuning watermarks is the art of streaming.
The 5 Patterns That Power Every Modern App
Every real-time app you love is one of these five patterns, or a mix. Learn them, and you can design any system.
1. Live Tracking — “Where Is My Thing?”
Uber, DoorDash, Amazon delivery, flight tracking, fleet tracking. A device emits GPS every few seconds → stream → map updates → ETA recalculated → user sees it move.
Why it matters: ETA is not a static number. It is a live computation: traffic, speed, route, weather, driver behaviour. Batch ETA is wrong the moment it is printed. Streaming ETA gets more accurate as the trip goes on.
2. Fraud And Risk — “Block It Before It Clears”
Card swipe in Tokyo, 2 minutes after a swipe in London. Same card, impossible travel. A stream processor sees both events in a sliding window, scores them, and blocks the second one — before it clears, not in tomorrow’s fraud report.
This is the highest-value pattern in real-time. A fraud check that takes 2 seconds saves money. A fraud check that takes 2 hours is a post-mortem.
3. Personalization — “Show Me What I Want, Now”
You click on a jacket. You add it to cart. You leave. Two minutes later, you get a push: “Still thinking about the jacket? 10% off, today only.” That is not luck. That is a clickstream → Kafka → Flink → feature store → model → notification, in seconds.
Batch personalization says: “People like you bought this last month.” Real-time personalization says: “You, right now, in this session, just looked at this, and you are about to leave.” The second one converts. The first one is spam.
4. Collaboration — “We Are Editing The Same Thing”
Google Docs, Figma, Notion, Linear, Slack. Two people type at once. Both see each other’s cursors. No refresh. No conflicts. That is WebSockets + operational transforms / CRDTs + a stream of edits, not a batch save.
This pattern is why WebSockets exist. It is two-way, low-latency, and stateful. SSE cannot do it — SSE is one-way. Polling cannot do it — polling is too slow and too wasteful.
5. AI Streaming — “Think Out Loud, Don’t Wait”
ChatGPT does not wait 20 seconds and then dump a full answer. It streams token by token, via SSE. You see it thinking. That is not a UI trick. That is a real-time pattern: the model generates, the server streams, the client renders, the user reads while the model is still generating.
AI agents take it further: they watch streams — clicks, sensors, market ticks, support tickets — and act on them in real time, without waiting for a human to run a report. Most AI models were trained on static datasets. The next generation learns from streams, continuously, as the world changes.
The Stack: Kafka + Flink + A Fast Store (And Why That Trio Wins)
There are 100 streaming tools. In production in 2026, one trio wins for serious workloads.
Apache Kafka acts as a distributed commit log — a reliable, scalable event store with ordering guarantees, handling millions of events per second. Think of it as a post office that never throws mail away: producers drop events into topics, consumers read them at their own pace, and you can replay from any offset if you need to reprocess.
Apache Flink is a stateful stream processor with exactly-once semantics and sub-second latency. Think of it as the brain: it reads from Kafka, does windowing, joins, aggregations, pattern detection (FlinkCEP), and writes results to a sink. It remembers state — “this user has clicked 5 times in the last 10 minutes” — across restarts, via checkpointing.
The pipeline:
Producers (API, IoT, CDC, App)
→ Kafka (Topics, Partitions, Replication 3)
→ Flink (Windows, State, Checkpoints)
→ Sink (Postgres, Redis, ClickHouse, S3, API)
→ Dashboard / App / Alert / Model
Why not just Spark? Spark Structured Streaming is excellent for batch + streaming in one engine, and Databricks’ Real-Time Mode in 2026 makes it faster. But for true event-time, low-latency, stateful processing — fraud, trading, session windows with late data — Flink is the specialist. Spark is micro-batch by default. Flink is event-by-event. In a healthcare benchmark at 50k events/s, Flink achieved 3.1x lower p99 alert latency than Spark Structured Streaming under exactly-once guarantees (74ms vs 231ms).
Why not just Kafka Streams? Kafka Streams is a library inside your app, no separate cluster. Perfect for per-microservice logic. But for cross-team analytics, complex joins, large state, and SQL, Flink wins. Rule: Kafka Streams for one service, Flink for the platform.
What about the serving layer? Flink does not serve dashboards. It writes to a fast store: ClickHouse for analytics, Redis for low-latency lookups, Postgres for transactional reads, Elasticsearch for search. Pick the store by query pattern, not by hype. If you need sub-second aggregation over billions of rows, ClickHouse. If you need key-value in 1ms, Redis. If you need search, Elasticsearch.
The Browser Side: WebSockets vs SSE vs WebRTC (Pick By Direction, Not By Hype)
Every developer hears “real-time” and says “WebSockets.” That is a mistake. WebSockets are powerful, but they are also the most complex option. Pick by direction.
| Protocol | Direction | Transport | Reconnect | Best For |
|---|---|---|---|---|
| Polling | Client asks | HTTP | N/A | Low-frequency, can wait 30-60s |
| SSE | Server → Client | HTTP | Built-in, automatic | AI token streaming, dashboards, notifications, live feeds |
| WebSockets | Both ways | TCP, upgraded HTTP | Manual, you build it | Chat, collaboration, multiplayer, trading |
| WebRTC | Peer → Peer | UDP / SCTP | ICE restart, complex | Voice, video, screen share, P2P file transfer |
| WebTransport | Both ways | QUIC / HTTP/3 | Better on mobile | Future games, low-latency, unreliable networks |
Server-Sent Events (SSE) are the most underrated tool in real-time: they establish a persistent, unidirectional HTTP connection, the server keeps the socket open, and the browser’s EventSource API automatically reconnects if it drops. For AI apps, that is perfect: the server talks, the client listens, and if the connection drops, the browser resumes with the last event ID.
SSE in 5 lines (client):
const es = new EventSource("/api/stream");
es.onmessage = (e) => render(JSON.parse(e.data));
es.onerror = () => console.log("reconnecting…"); // browser does it for you
WebSockets, standardised in RFC 6455 in December 2011, upgrade an HTTP connection to a persistent, full-duplex TCP connection, with binary or text frames flowing both ways. That is what you need for chat, collaboration, and games — where both sides talk at once.
WebSockets in 5 lines (client):
const ws = new WebSocket("wss://api.example.com/stream");
ws.onopen = () => ws.send(JSON.stringify({ type: "join", room: "orders" }));
ws.onmessage = (e) => render(JSON.parse(e.data));
WebRTC enables direct peer-to-peer audio, video, and data transfer between browsers, without going through your server for media. It is the protocol behind Google Meet, Discord voice, and Zoom’s browser client. You still need WebSockets for signalling — to exchange SDP and ICE candidates — but the media flows peer-to-peer, which is why it is so low-latency.
Decision tree: Does only the server talk? → SSE. Do both sides talk? → WebSockets. Is it voice / video / P2P? → WebRTC. Can it wait 30 seconds? → Polling, and save yourself the infrastructure.
AI + Real-Time: Why Streaming Is Now The Default For AI Apps
AI did not just benefit from real-time. It made real-time mandatory.
Before AI, a dashboard that updated every hour was “real-time enough.” After AI, a user expects a model to answer in real time, a support bot to see a ticket the moment it arrives, a fraud model to score a transaction before it clears, and a recommendation model to update when you click, not when you log out.
The pattern is: Kafka takes in events, Flink builds features and scores them, and sinks store results with replay and failure handling built in. Features are not a batch table from yesterday. They are a stream: “pages viewed in last 10 minutes, cart value now, time on site now.” The model scores on the stream, not on a stale snapshot.
And for the user, the AI answer itself is a stream: OpenAI and Anthropic stream answers over SSE, token by token. Live voice uses WebRTC. MCP’s Streamable HTTP transport uses HTTP POST + SSE for streaming. The AI does not wait to be perfect. It thinks out loud, and you watch it think.
What that means for builders: Your AI app is not a request-response app. It is a streaming app. Design for streaming from day one: SSE for answers, WebSockets for sessions, Kafka for events, Flink for features, and a vector / feature store that updates in real time. If you design for batch and then bolt on streaming, you will rebuild it in 6 months.
What Breaks In Production (The 6 Traps)
Real-time is not hard to demo. It is hard to run. Here are the traps that kill production pipelines, and how to avoid them.
1. Exactly-Once Is End-To-End, Not A Checkbox
Exactly-once does not mean “Flink checkpointing on.” It means: Flink checkpointing + Kafka idempotent producers + transactional sink + idempotent consumer, all working together. If your sink is not idempotent — if it cannot handle the same event twice — you will double-count on replay. Make sinks idempotent: upsert on event ID, dedupe on replay, use a transactional sink like Delta / Iceberg.
2. Late Data Will Ruin Your Aggregations
A phone in a tunnel, a sensor with bad clock, a retry after a network blip — late data is normal. If you use processing time, late data goes in the wrong window. Use event time + watermarks, and route late data to a side output, not to the trash. You need to know how much late data you have, not just ignore it.
3. Backpressure Will Cascade
Your sink is slow. Flink buffers. Kafka fills up. Producers slow down. Your app slows down. That is backpressure, and it cascades upstream. Monitor three signals: consumer lag, checkpoint duration, and backpressure. If lag grows, checkpoint duration grows, and backpressure is high, you are not “a bit slow.” You are about to fall over. Scale out, or shed load, or fix the sink.
4. Schema Changes Will Break Everything
One producer adds a field, renames a field, or changes a type. Your Flink job crashes. Your dashboard breaks. Your fraud model gets nulls. Use a Schema Registry (Avro / Protobuf), enforce backward compatibility, version your topics as {domain}.{entity}.{version} (e.g. trading.orders.v2), and test schema changes in staging before they hit production.
5. Ordering Is A Lie (Unless You Design For It)
Kafka guarantees ordering within a partition, not across partitions. If you partition by account_id, all events for one account are ordered. If you partition randomly, they are not. Partition by the key you need to order by. For fraud, that is account_id. For a chat room, that is room_id. Get this wrong, and your “user did X then Y” becomes “user did Y then X.”
6. You Will Pay For It In Observability, Not In Compute
Streaming compute is cheap. Debugging a streaming pipeline at 2 a.m. is expensive. You need: per-job metrics in Prometheus / Grafana, per-topic lag, per-event tracing (event ID → Kafka offset → Flink checkpoint → sink), dead-letter queues (DLQ) for bad records, and replay from a known offset. If you cannot replay, you cannot fix a bug. If you cannot trace an event, you cannot prove what happened.
When NOT To Go Real-Time (The Honest Checklist)
An experienced writer does not just cheerlead streaming. Here is when batch is better.
| Signal | Use Batch / Fast OLAP Instead |
|---|---|
| Latency budget is minutes, not seconds | Batch + ClickHouse / DuckDB / StarRocks will be simpler and cheaper. |
| Event volume < 1,000 / sec | You do not need Kafka + Flink. Postgres + CDC (Debezium) + Elasticsearch gives you near-real-time with far less ops. |
| Stale data costs you nothing | If a 1-hour-old dashboard is fine, do not build a stream. |
| Team has no streaming experience | Streaming is a new failure mode. Train, or hire, or use managed Flink / Confluent Cloud first. |
| Use case is historical reporting | Batch is correct. Do not force streaming into a reporting job. |
Rule: If stale data costs you money, customers, or safety, go real-time. If it does not, go batch. The most expensive system is the real-time system nobody needed.
Your Action Plan: Ship Real-Time In 2 Weeks, Not 2 Quarters
- Week 1, Day 1-2: Pick one use case, not five. Fraud, live dashboard, personalization, or AI streaming — one. The one where stale data costs you money. Write it in one sentence: “When X happens, we need to do Y within Z seconds.” If you cannot write that sentence, you do not have a real-time use case.
- Week 1, Day 3-4: Design the event, not the pipeline. What is the event? What fields? What is the key? What is event time? What is the schema? Get the event right, and the pipeline is easy. Get it wrong, and you will rebuild it three times.
- Week 1, Day 5-7: Build the smallest stream. Producer → Kafka topic → Flink SQL job (5-min window) → Sink (Postgres / ClickHouse) → Dashboard (SSE). One topic, one job, one dashboard. No microservices, no 10 topics, no complex joins. Prove it works end-to-end.
- Week 2, Day 1-3: Add the hard parts. Schema Registry, DLQ, idempotent sink, watermarks, checkpointing, lag alerts. These are not “later.” They are production.
- Week 2, Day 4-5: Test failure. Kill Flink. Kill a broker. Send late data. Send a bad schema. Replay from offset. If you cannot recover in minutes, you are not production-ready.
- Week 2, Day 6-7: Measure, then decide. What is p99 latency? What is lag? What is cost per 1M events? What is the business impact — fraud blocked, conversion up, churn down? If you cannot measure impact, you cannot justify the next use case.
The Real Takeaway: Real-Time Is Not A Feature. It Is A Contract.
Real-time is not a feature you switch on. It is a contract between your system and your users: “When something changes, you will know immediately.”
Batch broke that contract. It said: “When something changes, you will know tomorrow.” For a long time, that was good enough, because everyone else was also tomorrow.
Now, it is not good enough. Your user watches their Uber move. Their bank blocks fraud in seconds. Their AI answers token by token. Their colleague edits the same doc at the same time. If your app still says “Please refresh” or “Report updated last night,” it does not feel old-fashioned. It feels broken.
Real-time is not about speed for speed’s sake. It is about acting while the action still matters. Blocking fraud before it clears. Personalizing while the user is still in the session. Alerting a doctor while the patient is still in the bed. Rerouting a truck before it hits traffic.
That is why Kafka + Flink, SSE + WebSockets, and AI streaming are not just tools. They are the new default for modern apps. Not because batch is evil, but because the world is real-time, and our apps finally caught up.
Start with one use case. Build the smallest stream. Make it reliable. Then do it again. The future is not batch or streaming. It is both — batch for history, streaming for now. And now is where your users live.
