tezvyn:

Hadoop: Processing Big Data on Cheap Hardware

AI-drafted, machine-checkedSource: Wikipedia: Apache Hadoopbeginner

Hadoop processes massive datasets by distributing work across many cheap computers, assuming some will fail. It's used for large-scale batch processing, not real-time queries. The footgun is treating it like a database instead of a batch processing framework.

WHY IT EXISTS: Storing and analyzing datasets that are too large for a single server is a fundamental challenge. Buying a single, massive supercomputer is prohibitively expensive. Hadoop was created to solve this problem by distributing both the data and the computation across a cluster of inexpensive, commodity machines.

THE MENTAL MODEL: Hadoop's philosophy is to move computation to the data, not the other way around, and to expect failure. Imagine you have a library of a million books to search. Instead of bringing all the books to one master reader, Hadoop sends a hundred readers into the stacks, each searching a small section. If a reader gets sick (hardware failure), a manager sends another to take their place. This is more scalable and resilient.

HOW IT WORKS: The core Hadoop ecosystem consists of two main parts. First, the Hadoop Distributed File System (HDFS) handles storage. It splits huge files into smaller blocks and replicates them across multiple machines, ensuring data isn't lost if a single machine dies. Second, the MapReduce programming model handles processing. A 'Map' job runs in parallel on each machine, processing its local data block. A 'Reduce' job then aggregates the results from all the mappers to produce the final output. The framework automatically manages scheduling tasks and recovering from failures.

WHEN TO USE IT: Use Hadoop for batch processing of very large datasets (terabytes or petabytes). It excels at Extract, Transform, Load (ETL) jobs, large-scale log analysis, and data warehousing tasks where throughput is more important than latency. If your job can run for minutes or hours to generate a report, Hadoop is a good fit.

WHEN NOT TO USE IT: Hadoop is not a real-time database. Its high overhead for starting jobs makes it extremely inefficient for low-latency queries, like fetching a user's profile to render a webpage. It is also overkill for datasets that can comfortably fit and be processed on a single machine. Using it for small data is a common anti-pattern.

ONE CANONICAL EXAMPLE: The classic 'word count' program demonstrates MapReduce. To count words across petabytes of documents, the Map tasks run on each machine, reading their local data and outputting pairs like ('hello', 1). The framework then shuffles these pairs so that a single Reduce task receives all counts for 'hello' and can sum them up to get the final total for that word.

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.