...programming model for processing large data sets with a parallel, distributed algorithm on a cluster.
filtering and sorting
This distributes the set into smaller problems
collects all the answers to the sub problems
and combines them
rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']
Selectrainbow.select {|color| color.size >= 5}
# ['orange', 'yellow', 'green', 'purple']
rainbow.map {|color| color.upcase}
# ['RED', 'ORANGE', 'YELLOW', 'GREEN', 'BLUE', 'PURPLE'
# number of colors
rainbow.reduce(0) {|acc, n| acc += 1}
# 6
word_chunks.map do |chunk|
assign_to_server(count_words(chunk)) #[{"the" => 1}, {"cat" => 1}, {"the" => 1], {"dog" => 1}]
end