Skip to main content

Data Infrastructure

Kafka-to-Lakehouse Streaming Patterns for Global Scale

Implementation patterns for Kafka-to-lakehouse pipelines: exactly-once ingestion, schema evolution, stream processing, and millisecond serving.

By Binu Kuttappan12 min read
An event backbone feeding a lakehouse through hot, warm, and cold processing paths, with a schema registry governing every topic
6
Streaming platforms compared
4
Latency tiers compared
3
Processing paths in the hybrid pattern
4
Migration phases mapped

A Kafka-to-lakehouse pipeline is an event backbone feeding a governed table format, with a stream processor between them holding the state. The hard engineering is exactly-once delivery, schema evolution, and state recovery — not throughput. Latency is the easy part. Correctness under replay is what decides whether anyone trusts the platform.

#Why Batch-Only Pipelines Stop Being Defensible

What this means for you: the case for streaming is not speed for its own sake — it is the set of decisions your organisation currently cannot make because the data arrives after the decision window has closed.

Batch is not obsolete, and anyone who tells you otherwise is selling a platform. Nightly aggregation remains the cheapest way to compute most historical metrics, and it will still be running in your estate a decade from now.

What has changed is that a growing class of decisions has a window measured in seconds. Fraud authorisation, inventory allocation across channels, dynamic pricing, service-degradation response, and feature computation for online models all expire before an overnight job completes. For those workloads the batch pipeline is not slow — it is structurally unable to participate.

The question stopped being "should we stream?" some years ago. It is now "which decisions justify the operational cost of streaming, and which do not?"

That reframing matters because streaming carries a real bill: a second processing paradigm, on-call rotation for stateful services, and a class of failure — silent state corruption after a replay — that batch systems simply do not have.

#Latency Tiers and What Each One Costs

What this means for you: pick the loosest latency tier your decision actually needs. Every step tighter multiplies operational cost and narrows the pool of engineers who can run it.

The figures below are order-of-magnitude planning bands observed in production estates, not benchmarks. Your numbers will depend on payload size, network topology, and how much enrichment sits in the path.

TierTypical end-to-end bandWhat it makes possibleWhat it costs you
Traditional batch4-24 hoursHistorical reporting, finance close, regulatory extractsLowest — one paradigm, business-hours operations
Micro-batch5-15 minutesOperational dashboards, near-real-time replication, most CDC use casesModest — a scheduler and idempotent writes; usually the right default
Stream processing10-500 msFraud scoring, personalisation, alerting, online feature computationHigh — stateful services, checkpointing, 24/7 on-call, replay discipline
Edge or in-processSingle-digit msBidding, industrial control loops, in-request model inferenceHighest — bespoke deployment, constrained observability, hardest to change

Most estates that believe they need the third tier need the second one for ninety per cent of the workload and the third for a handful of decisions. Sizing the tier per use case rather than per platform is the single largest cost decision in this architecture.

#Choosing the Streaming Backbone

What this means for you: the backbone choice is mostly a decision about which operational burden your team can carry for the next five years, not about peak throughput.

PlatformBest forTypical latency bandOperational burdenChoose it when
Apache KafkaHigh-throughput event streaming with a broad connector and tooling ecosystemTens of millisecondsModerate to high self-managed; low as a managed serviceYou want the default, the largest talent pool, and portability across clouds
Apache FlinkStateful stream processing, event-time windows, complex event processingSub-secondHigh — state backends, checkpoint tuning, savepoint disciplineYour logic is genuinely stateful and event-time correctness matters
AWS KinesisCloud-native streaming inside an AWS-centric estateLow hundreds of millisecondsLow — managed shards and scalingYou are AWS-committed and want the integration rather than the ecosystem
Google Pub/SubGlobal-scale messaging with automatic capacity managementLow hundreds of millisecondsLow — no partitions to sizeYour workload is fan-out messaging more than ordered log processing
Apache PulsarMulti-tenancy, geo-replication, unified queuing and streamingSub-secondModerate — separate broker and storage tiers to operateYou need hard tenant isolation or built-in geo-replication semantics
RedpandaKafka-protocol compatibility with a simpler single-binary deploymentSingle-digit to low tens of milliseconds in tuned deploymentsLow — no ZooKeeper or JVM tuningLatency and operational simplicity outweigh ecosystem breadth

#What the Architecture Has to Get Right

What this means for you: these four properties are what an auditor, a finance controller, or an incident review will actually test. Throughput never comes up.

01

Exactly-once into the lakehouse

Transactional table formats plus idempotent writes with deduplication keys. At-least-once delivery into a non-transactional sink means duplicate revenue rows, and you will find them at quarter end.

02

Schema evolution as a contract

A schema registry with enforced compatibility rules, so a producer cannot ship a breaking change on a Friday. This is a data contract with a runtime, not documentation.

03

State that survives recovery

Checkpoint intervals, state backend sizing, and tested restore-from-savepoint runbooks. Untested recovery is the same as no recovery, discovered under pressure.

04

Event time, not arrival time

Watermarks and allowed lateness decide which late events land in which window. Get this wrong and yesterday's aggregates change quietly after they were reported.

The second of those four is where most estates are weakest. A registry with compatibility enforcement turns a data contract from a wiki page into something a deployment pipeline can refuse, and a published data quality SLO on freshness and consumer lag gives the contract a measurable service level rather than an aspiration.

Ordering deserves a note of its own. Kafka guarantees ordering within a partition, not across a topic, so any logic that depends on sequence must key events onto the same partition — which in turn caps the parallelism available to that logic. That trade-off between ordering and throughput is a design decision, and it is much cheaper to make it before the first partition scheme ships.

#The Hot, Warm, and Cold Path Pattern

What this means for you: you are not choosing between streaming and batch. You are deciding which of three paths each workload belongs on, and paying for all three.

                        ┌──────────────────────────────┐
   web · mobile · IoT ─▶│  Event backbone (Kafka)       │
   CDC from OLTP    ─▶  │  schema registry · replay log │
                        └───────────────┬──────────────┘
                                        │
          ┌─────────────────────────────┼─────────────────────────────┐
          ▼                             ▼                             ▼
   HOT  (Flink)                 WARM  (micro-batch)            COLD  (batch)
   stateful windows             5-15 min aggregation           full history
   sub-second alerts            operational dashboards         backfills · ML training
          │                             │                             │
          └─────────────┬───────────────┴─────────────┬───────────────┘
                        ▼                             ▼
              Serving (feature store,        Governed lakehouse tables
              low-latency store)             (transactional, time-travel)

The cold path is not a legacy remnant. It is the reconciliation authority: the place where the hot path's numbers are checked against a full recomputation, and the only practical way to detect the silent state corruption described earlier.

Both paths should write into the same governed lakehouse tables, with the batch recomputation authorised to correct the streaming result rather than sitting in a parallel schema that nobody reconciles. Where that lakehouse layer needs tuning for streaming write patterns — small-file compaction, partition design, and clustering — the mechanics are covered in lakehouse performance tuning.

Anything a stream processor computes, a batch job must be able to recompute. Where it cannot, you have an unverifiable number in production.

#Migrating from Batch to Streaming

What this means for you: this is a four-phase programme, and the timeframes below are per streaming domain and first production wave — not an estate-wide total.

Phase 1 — Event infrastructure. Deploy the backbone, schema registry, monitoring, and a first pair of producers and consumers on a workload whose failure is survivable. Establish topic naming, partitioning, and retention conventions now; they are painful to change once producers exist. Typically four to eight weeks for a first domain, with our real-time streaming and data engineering practices running the platform build in parallel with the first use case.

Phase 2 — Change data capture. Enable change data capture on the transactional databases that matter, stream the changes onto the backbone, and build materialised replicas. This phase usually delivers the most business value per unit of effort, because it removes nightly extract windows without requiring anyone to rewrite application logic. Six to ten weeks per source system family.

Phase 3 — Stateful stream processing. Deploy the processing framework, implement windowing, joins, and aggregations, and build the first feature pipeline. This is where operational maturity is genuinely tested: state sizing, checkpoint tuning, and restore drills belong in this phase, not the next one. Eight to twelve weeks for a first stateful workload.

Phase 4 — Unified hot and cold paths. Reconcile streaming output against batch recomputation in the same governed tables, publish freshness and lag SLOs alongside accuracy, and retire the batch jobs that the streaming path has genuinely replaced. Twelve to sixteen weeks per subject area. The observability discipline this depends on is set out in continuous data observability, and the team operating model in platform engineering and DataOps culture.

#When Streaming Is the Wrong Answer

What this means for you: four conditions should send you back to micro-batch, and recognising them early is worth more to your budget than any platform choice.

  • The decision window is longer than the pipeline. If nobody acts on the data until the next working day, sub-second delivery buys nothing and costs a permanent on-call rotation.
  • The source is inherently batch. A supplier who sends one file a day cannot be streamed into freshness. Streaming a daily file adds moving parts to the same latency.
  • The logic requires a full-history scan. Some computations need all the data, not a window over it. Forcing them into a stream processor produces unbounded state and an eventual outage.
  • The team cannot carry a second paradigm. Stateful streaming needs people who can reason about watermarks and checkpoints at three in the morning. Without that capability, micro-batch is the more honest architecture.

Where the workload does justify streaming, the platform decision usually arrives alongside a broader lakehouse choice — the trade-offs in that comparison are set out in Microsoft Fabric versus Databricks, and the surrounding platform design is what our data platform building engagements are shaped around.

#Frequently Asked Questions

#What is a Kafka-to-lakehouse pipeline?

It is an architecture where events land on a durable log such as Apache Kafka, a stream processor applies windowing, joins, and enrichment, and the results are written into transactional lakehouse tables that both streaming and batch workloads read. The log provides replay, the processor provides state, and the table format provides the atomic writes that make the result queryable and correctable.

#Do we need Flink, or is Kafka Streams enough?

Kafka Streams is sufficient when processing stays within one Kafka cluster and the state is modest, because it deploys as a library inside your own service. Apache Flink earns its additional operational cost when you need large managed state, event-time correctness with watermarks, connectors beyond Kafka, or independent scaling of processing from the application. Start with the simpler option and migrate when a specific limit binds.

#How do you achieve exactly-once delivery into a lakehouse?

By combining transactional writes with idempotency. The stream processor commits offsets and output atomically, and the sink writes into a transactional table format so a partially written batch is never visible. Deduplication keys on the event catch retries the transaction boundary cannot. At-least-once delivery into a non-transactional sink will produce duplicates, and those duplicates surface as inflated business metrics.

#How do you handle schema changes without breaking consumers?

Enforce compatibility rules in a schema registry at publish time, so a producer cannot ship a breaking change into a shared topic. Backward-compatible evolution — adding optional fields, never repurposing existing ones — lets consumers upgrade on their own schedule. Treat the schema as a versioned contract with a named owner on both sides, and route incompatible changes onto a new topic version.

#Is streaming more expensive than batch?

Usually yes, and the difference is operational rather than infrastructural. Compute costs are often comparable, but streaming adds a second processing paradigm, continuous on-call, state recovery drills, and reconciliation against a batch baseline. The economics work when a specific decision expires before batch can deliver. They do not work when streaming is applied estate-wide by default.


Unolabs is a Data and AI first engineering consultancy, headquartered in the United Kingdom with engineering operations in Pune and active engagements across the UK, Australia, and Hong Kong. We help enterprises build the architectural foundation for autonomous AI execution — governed data platforms, semantic intelligence, and agentic systems that enterprises can stand behind.

If you are deciding which of your workloads genuinely justify a streaming backbone, book a discovery call and we will size the operational cost with you.

Continue reading

Work out which decisions actually justify streaming

We will size your use cases against the four latency tiers above and tell you honestly which ones micro-batch would serve just as well, for far less.

Book a Streaming Review