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.

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.
| Tier | Typical end-to-end band | What it makes possible | What it costs you |
|---|---|---|---|
| Traditional batch | 4-24 hours | Historical reporting, finance close, regulatory extracts | Lowest — one paradigm, business-hours operations |
| Micro-batch | 5-15 minutes | Operational dashboards, near-real-time replication, most CDC use cases | Modest — a scheduler and idempotent writes; usually the right default |
| Stream processing | 10-500 ms | Fraud scoring, personalisation, alerting, online feature computation | High — stateful services, checkpointing, 24/7 on-call, replay discipline |
| Edge or in-process | Single-digit ms | Bidding, industrial control loops, in-request model inference | Highest — 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.
| Platform | Best for | Typical latency band | Operational burden | Choose it when |
|---|---|---|---|---|
| Apache Kafka | High-throughput event streaming with a broad connector and tooling ecosystem | Tens of milliseconds | Moderate to high self-managed; low as a managed service | You want the default, the largest talent pool, and portability across clouds |
| Apache Flink | Stateful stream processing, event-time windows, complex event processing | Sub-second | High — state backends, checkpoint tuning, savepoint discipline | Your logic is genuinely stateful and event-time correctness matters |
| AWS Kinesis | Cloud-native streaming inside an AWS-centric estate | Low hundreds of milliseconds | Low — managed shards and scaling | You are AWS-committed and want the integration rather than the ecosystem |
| Google Pub/Sub | Global-scale messaging with automatic capacity management | Low hundreds of milliseconds | Low — no partitions to size | Your workload is fan-out messaging more than ordered log processing |
| Apache Pulsar | Multi-tenancy, geo-replication, unified queuing and streaming | Sub-second | Moderate — separate broker and storage tiers to operate | You need hard tenant isolation or built-in geo-replication semantics |
| Redpanda | Kafka-protocol compatibility with a simpler single-binary deployment | Single-digit to low tens of milliseconds in tuned deployments | Low — no ZooKeeper or JVM tuning | Latency 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.
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.
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.
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.
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
- Data InfrastructureData Mesh vs. Fabric: Selecting the Right Architecture for 2026Data mesh versus data fabric across ten dimensions: what each one fixes, how each one fails, and a decision framework for choosing or combining them.13 min read
- Data InfrastructureLakehouse Performance Tuning: Optimising Multi-Petabyte Databricks EnvironmentsBeyond Z-Order and Liquid Clustering: how to tune a multi-petabyte Databricks lakehouse in the order that pays — layout, then skipping, then compute.14 min read
- Agentic ArchitecturesDesigning Production Agentic AI Systems: Architecture Patterns, Guardrails, and EvaluationHow production agentic AI is built: the agent loop, typed tool contracts, guardrail config, evaluation harnesses, and the gates that grant autonomy safely.15 min read
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