Lambda Architecture is a data processing architecture that combines a batch layer for comprehensive historical analysis with a speed layer for real-time stream processing, and a serving layer that merges the two outputs. This design pattern, first formalized by Nathan Marz, addresses the fundamental challenge of computing arbitrary functions on large datasets while maintaining low-latency query responses.
Glossary
Lambda Architecture

What is Lambda Architecture?
Lambda Architecture is a data processing design pattern that unifies batch and stream processing methods into a single framework, providing both comprehensive historical accuracy and low-latency real-time views.
The batch layer computes immutable, append-only master datasets using distributed processing frameworks, producing precomputed views with high accuracy but high latency. The speed layer compensates for the batch layer's latency by processing only recent data using incremental algorithms and stream processing engines, providing real-time but potentially less accurate results. The serving layer indexes batch views and merges them with speed layer outputs, enabling queries that are both timely and eventually consistent.
Key Characteristics of Lambda Architecture
Lambda Architecture addresses the challenge of computing arbitrary functions on massive datasets with low latency by decomposing the problem into three distinct layers: batch, speed, and serving.
Immutable Master Dataset
The foundational principle of Lambda Architecture is the append-only, immutable data store. Raw transaction events are never overwritten or deleted; new data is simply appended as it arrives. This guarantees an auditable system of record for financial fraud investigations.
- Event Sourcing: Every state change is captured as an event
- Temporal Querying: Enables point-in-time reconstruction of account states
- Correction by Addition: Errors are fixed by writing new compensating records, not altering history
Batch Layer (Cold Path)
The batch layer precomputes comprehensive views by periodically re-processing the entire master dataset using distributed processing frameworks. It prioritizes accuracy and completeness over latency, generating immutable, indexed batch views that serve as the ground truth for fraud models.
- Runs computationally intensive algorithms like graph neural network training on full transaction histories
- Corrects any errors introduced by the speed layer's approximations
- Typical latency: minutes to hours; output is written to a serving layer
Speed Layer (Hot Path)
The speed layer compensates for the high latency of batch updates by processing only the most recent data incrementally. It uses stream processing engines and approximate algorithms to generate real-time views, enabling sub-second fraud risk scoring on transactions that arrived after the last batch computation.
- Employs techniques like Count-Min Sketch and Bloom Filters for memory-efficient frequency estimation
- Sacrifices some accuracy for extreme speed; results are inherently temporary
- Continuously discards data once the batch layer catches up and computes the authoritative view
Serving Layer (Merged View)
The serving layer indexes the precomputed batch views and exposes them for low-latency random reads. A query for a complete result is satisfied by merging the stale-but-accurate batch view with the fresh-but-approximate real-time view. This provides a unified, queryable interface for the risk scoring engine.
- Stores indexed batch views in a distributed database optimized for random access
- Merges results from batch and speed layers transparently to the application
- Ensures the authorization flow receives a complete risk profile without coupling to the underlying complexity
Human Fault Tolerance
A core tenet of Lambda Architecture is that systems must be resilient to human error, which is considered more dangerous than machine failure. The immutable master dataset and recomputation-based batch layer ensure that catastrophic bugs in application logic or accidental data deletions are fully recoverable.
- Recomputation: If a fraud model is found to have a logic error, the batch layer can simply recompute all historical views from the raw, uncorrupted master data
- Eliminates the need for complex and risky rollback procedures in online databases
- Provides a robust safety net for iterative model development and debugging
Complexity of Dual Systems
The primary criticism of Lambda Architecture is the operational burden of maintaining two separate processing systems—batch and speed—that must produce logically equivalent results. This often requires maintaining two distinct codebases and merging their outputs, which can introduce subtle semantic inconsistencies.
- Code Duplication: Transformation logic must be written for both a batch framework (e.g., Apache Spark) and a stream processor (e.g., Apache Flink)
- Operational Overhead: Requires expertise in managing and tuning two distinct distributed systems
- This complexity motivated the evolution toward Kappa Architecture, which eliminates the batch layer entirely by treating all data as a stream
Lambda vs. Kappa Architecture
Comparison of the dual-path Lambda architecture with the single-path Kappa architecture for real-time and historical data processing
| Feature | Lambda Architecture | Kappa Architecture | Hybrid Approach |
|---|---|---|---|
Processing Paths | 2 (Batch + Speed) | 1 (Stream only) | 2 (with shared code) |
Data Reprocessing | Full batch recompute | Stream replay | Batch recompute + stream replay |
Codebase Complexity | High (dual logic) | Low (single logic) | Medium (shared abstractions) |
Latency Profile | < 10 ms (speed layer) | < 10 ms | < 10 ms |
Historical Accuracy | Eventual (batch-verified) | Approximate (stream-only) | Eventual (batch-verified) |
Operational Overhead | High (two systems) | Medium (one system) | High (two systems) |
Late Arrival Handling | Batch layer absorbs | Watermark-based | Batch layer absorbs |
Typical Use Case | Fraud scoring + reporting | Real-time dashboards | Fraud scoring + reporting |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Explore the core concepts, trade-offs, and implementation details of the Lambda Architecture for real-time fraud detection pipelines.
Lambda Architecture is a data processing design pattern that combines a speed layer for real-time stream processing and a batch layer for comprehensive historical analysis to provide both low-latency and accurate results. It works by ingesting immutable data into a central append-only log, such as Apache Kafka, and then forking the stream into two distinct processing paths. The speed layer uses stream processing engines like Apache Flink or Kafka Streams to compute incremental views with sub-second latency, enabling immediate fraud scoring on the hot path. Simultaneously, the batch layer processes the full historical dataset using distributed frameworks like Apache Spark to generate accurate, pre-computed batch views. A serving layer merges these outputs, allowing queries to combine real-time approximations with authoritative historical corrections, ensuring the system is both fast and eventually consistent.
Related Terms
Core building blocks and complementary patterns that constitute or interact with the Lambda Architecture in real-time fraud detection pipelines.
Batch Layer
The immutable, append-only historical data store responsible for computing accurate but high-latency views. In fraud detection, this layer processes terabytes of settled transactions using distributed processing frameworks like Apache Spark or Hadoop MapReduce to train models on complete datasets. It serves as the system of record, periodically recomputing batch views that correct approximations made by the speed layer. Key characteristics include:
- Stores the master dataset in a distributed file system
- Recomputes batch views on a scheduled cadence (e.g., hourly or nightly)
- Provides eventual accuracy by correcting real-time approximations
- Handles complex feature engineering that requires full historical context
Speed Layer
The real-time stream processing component that compensates for the batch layer's high latency. It ingests live transaction events and applies incremental algorithms to produce low-latency views within milliseconds. In fraud pipelines, this layer executes online inference against pre-trained models, performs sliding window aggregations for velocity checks, and scores transactions before authorization completes. Design considerations include:
- Uses stream processors like Apache Kafka Streams or Apache Flink
- Maintains state in-memory or in fast key-value stores for sub-millisecond access
- Handles out-of-order events using watermarks and allowed lateness
- Results are approximate and later reconciled against batch views
Serving Layer
The query-facing merge point that combines batch and real-time views into a unified response. It indexes batch-computed results and merges them with incremental speed layer updates to provide a complete, up-to-date picture for each transaction. In fraud systems, this layer enables the risk scoring engine to query enriched features—such as a cardholder's 30-day spending profile from the batch layer combined with the last 5 minutes of velocity from the speed layer—in a single call. Implementation patterns include:
- Read-optimized databases like Apache HBase or Cassandra for batch view serving
- Merge-on-read logic that combines batch and real-time results at query time
- Caching strategies to reduce latency on frequently accessed entity profiles
Kappa Architecture
An alternative to Lambda that eliminates the separate batch layer by treating all data as a stream. Instead of maintaining dual processing paths, Kappa uses a single stream processing engine to handle both real-time and historical computations by replaying events from a durable log like Apache Kafka. This simplifies operational complexity at the cost of requiring the stream processor to handle full historical reprocessing. Trade-offs for fraud detection include:
- Reduced code duplication—single codebase for all processing
- Simpler operations—no batch scheduling or dual-path maintenance
- Higher replay latency—reprocessing years of transactions through a stream is slower than batch
- Best suited when event sourcing is the primary data pattern and batch-specific optimizations are unnecessary
Hot Path vs. Cold Path
The conceptual division of data processing responsibilities within Lambda. The hot path (speed layer) handles time-critical data requiring sub-second latency—blocking a transaction, scoring risk, triggering alerts. The cold path (batch layer) processes data where accuracy matters more than speed—training models, generating regulatory reports, detecting slow-burn fraud patterns. This separation allows each path to be optimized independently:
- Hot path: In-memory state, approximate algorithms, strict latency SLAs with circuit breakers
- Cold path: Disk-based storage, exact computations, fault-tolerant with retry logic
- Reconciliation: Cold path results periodically overwrite hot path approximations
- In fraud systems, the hot path might use a Count-Min Sketch for approximate velocity while the cold path computes exact counts
Stream-Table Join
A critical enrichment operation where a live transaction event stream is joined against a reference table or materialized view. In Lambda, the batch layer maintains the ground-truth table (e.g., merchant risk profiles, cardholder behavioral segments) while the speed layer performs the join at inference time. This enables the risk scoring engine to combine real-time signals with historical context. Implementation considerations:
- Uses Change Data Capture to keep reference tables synchronized
- Employs state stores in stream processors for local, low-latency lookups
- Handles temporal joins where the reference data version at event time must be used
- Critical for data enrichment steps that add device fingerprints, geolocation, and watchlist status

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us