What Real-Time Actually Means

Concepts covered: Batch vs Streaming

'Real-time' is a request, and requests arrive without numbers attached. When a product manager asks for signups in real time, the engineer's job is to turn those words into a freshness tier: the maximum age the number may have at the moment someone reads it. Four tiers cover almost every request, and each tier points to a different architecture and a different bill.

TierMaximum age when readExample requestWhat delivers it
Sub-secondUnder 1 secondBlock a card swipe that looks stolen before the terminal says approvedA stream consumer holding the data it needs in memory
SecondsBetween 1 and 60 secondsA wall screen showing orders placed in the last minuteA streaming pipeline writing to a serving table
MinutesBetween 1 and 60 minutesAn on-call engineer checking whether signups dropped after a releaseA batch job scheduled every 5 to 15 minutes
Hours or moreBetween 1 hour and 1 dayThe Monday morning review of last week's signups by countryA nightly or hourly batch job

Each tier is about 60 times stricter than the one below it, and the architecture changes with it. Hours and minutes are both served by the batch picture from 2 sections ago, with a shorter window and a more frequent trigger as the tier tightens. Seconds and sub-second need the streaming picture, because a job scheduled every 5 seconds would spend more time starting up than working, and would in effect be an always-on process with extra overhead. The line between batch and streaming sits at roughly 1 minute of allowed age.

Three questions that produce a number

The second question usually exposes the tier. A number read once each Monday at 10:00 gains nothing from being 5 seconds old. It gains everything from being correct by 10:00. A number on a wall screen that someone glances at every few minutes benefits from being under a minute old. A number that gates a payment helps only if it arrives before the payment completes. The reading rhythm sets the ceiling on how fresh the data needs to be, and building fresher than that ceiling buys nothing.

One request, three translations

Suppose 3 people in the same week each ask for 'real-time signups'. Each conversation ends somewhere different.

Who asksWhat they do with itTierArchitecture
Head of marketingReviews signups by country at the Monday 10:00 meetingHoursNightly batch, finished by 03:00
On-call engineerWants to see a drop within 5 minutes of a release so a bad release can be rolled backMinutesBatch every 5 minutes over the last 5 minutes of signups
Growth teamCloses a promotion the moment the 1,000th signup lands, so nobody is promised a gift that is goneSecondsStream consumer keeping a running count

Three identical requests, 3 different pipelines, and a cost range of more than 100 to 1. The marketing report costs 8 minutes of compute a day. The release monitor costs a short job 288 times a day. The promotion counter costs a process that is up for all 86,400 seconds, and it is the only one of the 3 that needs to be. Writing the tier down before building anything keeps the first 2 requesters from paying for the third one's architecture.

The finance team says daily revenue totals must be real-time. In conversation you learn they review the totals at 09:00 each morning and again at 17:00. Which tier and architecture fit?

About this lesson

This section is part of the Batch vs Streaming: Beginner lesson on DataDriven, the home of data engineering. Lessons cover SQL, Python, Spark, data modeling and pipeline architecture, and each section pairs its explanation with worked examples and practice you run as you go.