tezvyn:

Lambda Architecture: Batch and Stream for Big Data

AI-drafted, machine-checkedSource: Wikipedia: Lambda architectureintermediate
Lambda Architecture: Batch and Stream for Big Data

Lambda Architecture splits data into two paths: a slow, comprehensive batch layer and a fast, real-time stream layer. It's used in big data systems needing both historical accuracy and live views.

WHY IT EXISTS As datasets grew massive, traditional batch processing like MapReduce became too slow for real-time needs. Businesses needed both comprehensive historical accuracy and an immediate view of current data. Lambda Architecture was designed to solve this by getting the benefits of both batch and stream processing in one system.

THE MENTAL MODEL Think of it as a two-lane highway for your data. One lane is the batch layer: it’s slow, wide, and carries all historical traffic, eventually providing a perfectly accurate and complete record. The other lane is the stream layer: it’s fast, carrying only live traffic to give you a good-enough, up-to-the-minute view. Your final destination, the query result, merges the views from both lanes.

HOW IT WORKS All incoming data is dispatched to two layers simultaneously. First, the batch layer, which stores all the data and periodically runs batch jobs to compute a comprehensive, accurate view. Second, the speed layer (or stream layer), which processes data immediately to provide a real-time view, but only for recent data. A serving layer then combines results from both the batch view and the real-time view to answer queries, providing a complete picture.

WHEN TO USE IT Use Lambda Architecture for massive-scale systems where you cannot sacrifice either historical accuracy or real-time capabilities. It is ideal for applications like large-scale analytics dashboards, financial reporting systems, or social media trend analysis that need to balance latency, throughput, and fault tolerance.

WHEN NOT TO USE IT This architecture is complex. It's overkill for systems that do not have both massive scale and a hard real-time requirement. If your system can tolerate a few minutes of latency, a simpler batch-only system may suffice. If you only need real-time views and historical accuracy is secondary, a pure streaming architecture is less complex. The primary reason not to use it is the high operational cost of building and maintaining two separate data pipelines.

ONE CANONICAL EXAMPLE A system counting views on a popular website. The batch layer runs nightly to calculate the exact, canonical view count for all time up to yesterday. The stream layer continuously processes today's views in real-time. When a user requests the view count, the serving layer queries both systems and adds their results together, presenting a single, up-to-date number.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.