Skip to the workspace
Pebellslearn by building
Ingestion and Pipelines  ›  Lesson

Batch Ingestion

Batch 12 minBatch processing gathers data over a fixed window and processes it together on a schedule, which is simple, cheap and easy to rerun but always somewhat stale.

data engineer / Batch Ingestion

Explore each scene at your own pace.

01 · The rule

The rule

Batch Ingestion

Most of PedalCity's pipelines run once a night. At 02:00 a job collects every ride from the previous day and processes them together. That is batch processing: it is the oldest, simplest and still the most common way data moves. Its one real cost is waiting.

The rule

Batch gathers data over a window, then processes it all at once.

A batch job is defined by three things:

  • Window: which slice of data one run covers, such as "all rides that ended on 24 September".
  • Schedule: when the run starts, such as daily at 02:00. It starts after the window closes, with a margin for late rows.
  • Latency: how old the newest data can be when it becomes available. Worst case, this is roughly the window, plus the wait before the run, plus the run time.

PedalCity's nightly job covers midnight to midnight, starts at 02:00 and takes 30 minutes. A ride ending at 23:50 on Sunday is available at about 02:30 on Monday, less than three hours later. A ride ending at 00:05 on Monday has to wait for Tuesday's run, so it is available at about 02:30 on Tuesday, more than 26 hours later.

Batch jobs usually write one partition per window, which is a slice of a table or a folder for that date:

INSERT INTO fact_rides
SELECT ...
FROM stg_rides
WHERE ended_at >= '2026-09-24' AND ended_at < '2026-09-25';

Why batch is so popular:

  • Simple: a job starts, runs and stops. There is nothing to keep alive in between.
  • Cheap: compute runs for 30 minutes, not all day.
  • Easy to rerun: if Tuesday's logic had a bug, fix it and rerun Tuesday's window.

Its weakness is staleness. Anything that needs minutes-fresh data, such as a live map of free bikes, cannot wait for 02:00.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.