Lambda and Kappa Architectures
Lambda runs a batch pipeline and a streaming pipeline side by side and merges their answers; Kappa keeps one streaming pipeline and reprocesses by replaying the log.
Overview
The problem: fresh or correct
Analytics systems want two things at once. They want results that are fresh, covering events from the last few seconds. They also want results that are correct and complete, and that can be recomputed when the code had a bug. Early stream processors were fast but hard to trust; batch jobs were trustworthy but hours behind.
There are two classic designs for this. Lambda runs both kinds of pipeline and combines them. Kappa runs only a streaming pipeline and treats reprocessing as replaying its input.
The difference shows up everywhere. Lambda runs batch and streaming pipelines side by side, so it has two code bases, which must agree; to reprocess, you rerun the batch job over all raw data. Kappa runs streaming only, with one code base; to reprocess, you replay the retained log through a new job. Lambda was described by Nathan Marz in a 2011 post, and the name came later. Kappa was named by Jay Kreps in a 2014 article.
Key concepts
- Lambda architecture
- Batch layer
- Speed layer
- Serving layer
- Kappa architecture
- Event time
- Processing time
- Bounded and unbounded input
Interview questions
- Why did many teams move from Lambda to Kappa?
- In Kappa, how do you reprocess after fixing a bug?
- What does event time versus processing time mean, and why does it matter here?
Sign up free to read the full topic
More DDIA topics
Start free on Cariara · Coding problems · System design studio