Skip to content

Map-reduce

Category: Parallelism · Status: stub · Lessons: chapter 07, Parallelism

One line: Apply a function to every item independently, then combine the results with an associative operation, so that both halves can be split across workers.

Also called: MapReduce.

How it connects

flowchart LR
  n_data_parallelism["Data parallelism"]
  n_map_reduce["Map-reduce"]
  n_map_reduce -->|is a| n_data_parallelism
  classDef center stroke-width:3px
  class n_map_reduce center
  classDef outside stroke-dasharray: 4 3
  class n_data_parallelism outside

In each language

Rust Rayon's reduce takes an identity value as well as the combining operation
C++ std::transform_reduce; with a non-associative or non-commutative operation the result is non-deterministic
Java Stream.reduce requires an associative accumulator, so that a parallel stream can split the work
Elsewhere Hadoop MapReduce ↗ runs the same split across a cluster

Where to read more