Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Ingestion and Pipelines  ›  Lesson

Realtime and Hybrid Ingestion

Realtime 12 minStreaming handles each event within seconds for decisions that cannot wait, micro-batching offers a cheaper middle ground, and hybrid designs pair a fast path with an accurate batch path.

Realtime and Hybrid Ingestion

A rider opens the PedalCity map at 08:03 and walks to a dock that showed four bikes. It is empty: the map was built from last night's batch. Some data loses its value within seconds. For that data you need streaming, and usually you keep batch running alongside it.

The rule

Stream when a decision can't wait; batch when it can; hybrid when both.

Realtime (streaming) ingestion handles each event as it arrives. Dock sensors publish readings to a message broker, a system such as Apache Kafka, RabbitMQ or a cloud queue, which holds the events in order. A stream processor reads them continuously and updates results within seconds.

dock sensor ──► broker topic "dock-readings" ──► stream processor ──► live availability table ──► map

Streaming earns its place when someone acts on the data straight away: the rider choosing a dock, or a van driver sent to an empty station. It costs more. The processor runs all day, and late or duplicate events must be handled without the luxury of a finished window.

A middle ground is micro-batching: tiny batches every 30 seconds to a few minutes. Many "realtime" systems actually work this way, and it is often fresh enough.

Hybrid ingestion runs both paths on the same events:

  • A fast path streams readings to the live map. It is quick and may be slightly off.
  • A batch path lands the same readings in the lake and recomputes accurate hourly counts each night, after all late and duplicate events have settled.

The fast path serves decisions right now. The batch path is the record of truth for reports and model training. When the two disagree, the batch result wins for history.

The shortcut

For each use, ask "What happens if this data is an hour old?" If someone makes a worse decision → stream it. If nothing changes → batch. If the same data serves both a live decision and a careful report → hybrid.

Planning dock-reading ingestionStep 1 of 4
  1. Live map

    An hour-old count sends riders to empty docks, so stream it with seconds of delay.

Drills

Answer fast — trust the rule.

quick drill

Which PedalCity use most needs streaming?

quick drill

What does a message broker do in a streaming pipeline?

quick drill

In a hybrid design, the live map and the nightly report show slightly different counts for 08:00. Which is the record of truth for history?

quick drill

Van drivers are dispatched every 15 minutes. Which approach is fresh enough and simplest?

Remember

  • Stream when a decision can't wait, batch when it can, and go hybrid when both apply.
  • Ask what happens if the data is an hour old.
  • In hybrid designs the fast path serves now, while the batch path is the record of truth.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainDesign a hybrid flow

PedalCity wants to flag suspicious unlock patterns (many unlocks from one account within a minute) and also publish a monthly fraud report. Describe a design that serves both, and say which path is the record of truth.