Lambda Architecture vs Kappa Architecture
Compare dual batch+speed (Lambda) vs stream-replay-centric (Kappa) platform designs.
In plain words
Finite history and replay capacity. Next, one stream transform or dual batch/speed code. Finally, shadow/rebuild, correction, and consumer switch.
Think of it like…
Lambda sends live telegraph updates and a later audited newspaper, requiring a reconciliation desk; Kappa keeps every edition of the wire and can regenerate the newspaper from that single source.
Where you’ve seen it
A dashboard receives approximate Flink revenue plus an hourly Spark truth job in Lambda; a Kappa design emits the same model from Kafka/Iceberg, replays a new consumer version, and swaps outputs after validation.
Words you’ll hear
- Lambda
- A dual-path design with batch completeness plus stream speed layers merged at serving time.
- Kappa
- A stream/log-centric design in which historical replay rebuilds serving state instead of maintaining separate batch logic.
- Replay
- Rerunning the immutable event history into a new versioned topology or table to correct state and code.
- Operational boundary
- Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics. Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline.
Visual diagram
Theory & deep dive
Lambda: the working mechanism
Lambda architecture keeps a batch layer for complete/recomputed truth and a speed layer for low-latency views; Kappa replays one durable stream/log to rebuild state and avoids maintaining two logic paths.
Finite history and replay capacity. One stream transform or dual batch/speed code, then approximate now, corrected later, or replay cutover; this exposes the state governed by Replay.
A dashboard receives approximate Flink revenue plus an hourly Spark truth job in Lambda; a Kappa design emits the same model from Kafka/Iceberg, replays a new consumer version, and swaps outputs after validation.
Lambda Architecture vs Kappa Architecture: failure mode and production response
Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline. Track Replay time as "full retained history divided by rebuild throughput", and make Logic duplication visible to the dataset owner.
How it works, step by step
Step 1 of 41. Compare retention
Finite history and replay capacity. Lambda architecture keeps a batch layer for complete/recomputed truth and a speed layer for low-latency views; Kappa replays one durable stream/log to rebuild state and avoids maintaining two logic paths.
- Replay time
- full retained history divided by rebuild throughput
- Kappa
- A stream/log-centric design in which historical replay rebuilds serving state instead of maintaining separate batch logic.
When to use it & trade-offs
What it is
Lambda architecture keeps a batch layer for complete/recomputed truth and a speed layer for low-latency views; Kappa replays one durable stream/log to rebuild state and avoids maintaining two logic paths. A dashboard receives approximate Flink revenue plus an hourly Spark truth job in Lambda; a Kappa design emits the same model from Kafka/Iceberg, replays a new consumer version, and swaps outputs after validation.
Why it matters: Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics. Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline.
When to reach for it
- Compare dual batch+speed (Lambda) vs stream-replay-centric (Kappa) platform designs.
- Choose Lambda because it provides this capability: A dual-path design with batch completeness plus stream speed layers merged at serving time.
- Keep evidence for Replay time at "full retained history divided by rebuild throughput" so the last production stage-Validate - shadow/rebuild, correction, and consumer switch-remains testable.
When to avoid or be careful
- Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
- Do not conflate Kappa with Lambda. The second concept contributes different behavior: A stream/log-centric design in which historical replay rebuilds serving state instead of maintaining separate batch logic.
- Release only after this guardrail is in place: Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline.
Lambda / Kappa / Replay - roles, limits, and operating cost
Strengths: A dual-path design with batch completeness plus stream speed layers merged at serving time. Lambda architecture keeps a batch layer for complete/recomputed truth and a speed layer for low-latency views.
Watch out: Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
Strengths: A stream/log-centric design in which historical replay rebuilds serving state instead of maintaining separate batch logic. In this workflow it supports: Choose consistency - approximate now, corrected later, or replay cutover.
Watch out: The operating cost is real: number of independently implemented KPI paths.
Strengths: Rerunning the immutable event history into a new versioned topology or table to correct state and code. Its output can be checked with Correction window.
Watch out: Operating guardrail: Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline.
Interview signals & numbers to know
When this topic comes up
- “Where is the failure boundary for Lambda, and how would Replay time reveal it?”
- “Why is Kappa distinct from this behavior: rerunning the immutable event history into a new versioned topology or table to correct state and code?”
- Production clue: Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
- Design probe: Choose Lambda only when batch correction and stream SLA require independently justified sources, or Kappa when the log retention/compaction and stream engine can replay all needed history with one versioned state pipeline.
Benchmarks & rules of thumb
- Replay time
- full retained history divided by rebuild throughput
- Logic duplication
- number of independently implemented KPI paths
- Correction window
- time from detected mismatch to canonical view swap
Common mistakes & follow-ups
Common interview mistakes
- Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
- Reporting success from a job exit code without checking Replay time and Logic duplication.
- Treating this example as complete without replay, rollback, or access boundaries: A dashboard receives approximate Flink revenue plus an hourly Spark truth job in Lambda; a Kappa design emits the same model from Kafka/Iceberg, replays a new consumer version, and swaps outputs after validation.
Likely interviewer follow-ups
- How would you prove this contract instead of only checking that the command ran: A dual-path design with batch completeness plus stream speed layers merged at serving time.
- What does the recovery plan do when this occurs? Lambda can implement different business rules twice, creating irreconcilable totals, while Kappa may retain an infeasible event log or struggle with full-history recompute and late correction semantics.
- When is Lambda insufficient for Logic duplication, and what does adding Kappa cost in Replay time?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply Lambda Architecture vs Kappa Architecture with data engineer interview Q&A and hands-on practice.