MapReduce is used for massively parallel data processing. It consists of four phases, namely, mapper, shuffle-and-sort, reducer, and combiner. The mapper splits the input dataset and outputs key-value pairs where the key is the word/entity, and the value is the frequency. Shuffle-and-sort removes duplicates and sorts the key-value pairs by the key. Reducer is used to aggregate the key-value pairs obtained from the previous phase. Combiner is an optimisation technique in which reduction occurs at the node level. This is how MapReduce works.