Last Updated: January 8, 2026
Lambda Architecture solves the latency-accuracy trade-off by running batch and stream processing in parallel. It works, but maintaining two separate codebases for the same logic is painful. Every change requires updates to both systems. Testing is complex. Bugs can cause the two implementations to diverge.
In 2014, Jay Kreps (co-creator of Apache Kafka) proposed a simpler alternative: Kappa Architecture. The core idea is radical. Instead of running batch and stream in parallel, use only stream processing. If you need to reprocess historical data, replay the event log through the same streaming system.
Kappa Architecture trades the complexity of dual systems for the challenge of making stream processing robust enough to handle all use cases. With modern streaming engines and event logs, this is increasingly practical.
In this chapter, you will learn:
Kappa Architecture takes the messy “two pipelines” problem and replaces it with a single, consistent path:
Everything is a stream.
Batch processing is just a special case. It is a stream with an end. If your stream processor can handle a continuous stream, it can also handle a bounded stream.
Kappa works when you have three things:
If those conditions hold, you do not need a separate batch layer. Reprocessing is simply replaying history through the same pipeline.
Reprocessing is the moment Kappa becomes real.
When you find a bug, change business rules, or want to add a new derived field, you do not spin up a separate batch job. You do a controlled cutover.
The cost is that replay can be expensive if your history is huge and your pipeline is heavy.
| Aspect | Lambda | Kappa |
|---|---|---|
| Processing systems | Two (batch + stream) | One (stream only) |
| Codebase | Duplicate logic | Single codebase |
| Reprocessing | Re-run batch job | Replay events through stream |
| Complexity | Operational (two systems) | Conceptual (stream everything) |
| Latency | Batch: hours, Stream: seconds | Always streaming latency |
| Accuracy | Batch is authoritative | Stream must be robust |
| Event log retention | Optional for batch | Required for reprocessing |
| Maturity | Proven at scale | Newer, evolving |
Kappa is not automatically better. There are situations where Lambda is still the more practical choice.
| Scenario | Why Lambda |
|---|---|
| Very complex aggregations | Some computations need batch semantics |
| Petabyte-scale history | Replaying years of data takes too long |
| Team expertise | Team knows batch, stream is new |
| Existing infrastructure | Hadoop cluster already running |
| Strict accuracy requirements | Batch provides stronger guarantees |
Kappa shines when simplicity and speed of iteration matter, and when your system is already event-driven.
| Scenario | Why Kappa |
|---|---|
| Simpler operations | One pipeline to deploy, monitor, and debug |
| Unified logic | Single codebase, no divergence |
| Fast iteration | One deployment path for changes |
| Stream-first use case | You are building real-time features anyway |
| Modern stack | Using Kafka, Flink, cloud-native |
The event log is the foundation of Kappa. It is the system of record.
Your views can be deleted and rebuilt. Your processors can be upgraded. Your source of truth remains the log.
| Requirement | Why |
|---|---|
| Immutable | Events never change, only append |
| Ordered | Within partition, events have deterministic order |
| Durable | Replicated storage, survives failures |
| Replayable | Can seek to any offset and replay |
| Long retention | Must keep history for reprocessing |
For true Kappa, you typically want long retention, often “effectively infinite” through tiered storage.
Kafka is the most common implementation because it supports the event-log model naturally:
It also supports multiple consumers at once, for example:
Retention is a design decision. It shapes what kind of “Kappa” you can realistically support.
| Strategy | Description | Use Case |
|---|---|---|
| Time-based | Keep 7 days, 30 days, etc. | Logs, metrics |
| Size-based | Keep 1TB per partition | When storage is limited |
| Compact | Keep latest value per key | Changelog streams |
| Infinite | Never delete | Full reprocessing capability |
For true Kappa Architecture, you need long or infinite retention.
Tiered storage makes long retention practical by splitting data across cost tiers:
Modern Kafka supports tiered storage:
You still get the same log abstraction. Consumers can replay old data even if it lives in the cold tier. You get reprocessing capability without paying premium storage costs forever.
Kappa sounds simple on paper: replay the log, rebuild the views, move on. In practice, the trick is doing it without breaking production, confusing users, or losing confidence in your numbers.
The good news is that the workflow is well understood and repeatable.
Think of reprocessing as a controlled migration from v1 to v2 of your streaming job and its output views.
At this moment, you are running two pipelines:
The key principle: never mutate the old view in place. Build the new one side-by-side, then switch.
| Challenge | Solution |
|---|---|
| Time to reprocess | Parallelize, more resources |
| Storage for two views | Temporary during transition |
| Cutover coordination | Atomic switch in load balancer |
| Consistency during transition | Accept brief inconsistency |
| Ordering guarantees | Same partitioning as original |
A practical mindset: during reprocessing, you are intentionally running in a “migration mode.” You plan for temporary cost and temporary complexity, but you make the cutover clean.
Reprocessing speed is often limited by how fast you can read and process the log. Partitioning is your friend.
If the event log has 100 partitions, you can assign them across multiple instances of the new job:
All instances write into the same New View, usually through a sink that can handle concurrent writers safely.
A complete Kappa setup typically has these pieces:
Kafka (or similar) with long retention. This is your system of record.
Flink, Kafka Streams, or Spark Streaming, often doing stateful processing and windowing.
Stores optimized for query patterns:
Optional but common, especially for dashboards and APIs that need very fast reads.
The application queries the serving views, not the event log.
| Component | Options |
|---|---|
| Event Log | Kafka, Pulsar, Kinesis, Event Hubs |
| Stream Processor | Flink, Kafka Streams, Spark Streaming |
| Serving Store | Cassandra, Druid, Pinot, Redis |
| Schema Registry | Confluent Schema Registry, AWS Glue |
Kappa moves the burden of correctness to streaming. If your stream processing is flimsy, your entire architecture becomes fragile.
A practical Kappa-capable processor needs:
| Requirement | Why |
|---|---|
| Exactly-once semantics | Accurate results despite failures |
| Stateful processing | Maintain aggregations across events |
| Checkpointing | Recover from failures without reprocessing all |
| Windowing | Handle time-based aggregations |
| Late event handling | Process events that arrive out of order |
Events can arrive out of order. How do you handle an event from 2 hours ago?
Which one you choose depends on what “correctness” means for your product. Dashboards often allow corrections. Billing systems often require strict cutoffs and explicit adjustments.
For queries like "events per hour," define windows:
Window choice is not just a technical detail. It directly affects how users interpret the metric.
Stream processors maintain state for aggregations:
The typical pattern:
This is what makes long-running streaming jobs reliable. Without state plus checkpointing, you either lose accuracy or you are forced to replay huge ranges after every incident.
Choosing between Kappa and Lambda is not about picking the “modern” one. It is about matching the architecture to your constraints.
A good decision comes down to two questions:
If the answer to the second question is uncertain, Lambda often becomes the safer choice. If the answer is clearly yes, Kappa usually wins on simplicity.
| Factor | Choose Kappa | Choose Lambda |
|---|---|---|
| Operational simplicity | ✓ One system | Two systems |
| Code simplicity | ✓ One codebase | Duplicate logic |
| Reprocessing speed | Slower (replay) | ✓ Batch is fast |
| Accuracy guarantees | Stream must be robust | ✓ Batch is authoritative |
| Team expertise | Need stream skills | Batch is familiar |
| Petabyte scale | Challenging | ✓ Batch handles well |
Kappa Architecture simplifies data processing by using only stream processing: