<s>
MapReduce	B-Operating_System
is	O
a	O
programming	O
model	O
and	O
an	O
associated	O
implementation	O
for	O
processing	O
and	O
generating	O
big	B-Application
data	I-Application
sets	O
with	O
a	O
parallel	B-Operating_System
,	O
distributed	B-Architecture
algorithm	O
on	O
a	O
cluster	B-Architecture
.	O
</s>
<s>
A	O
MapReduce	B-Operating_System
program	O
is	O
composed	O
of	O
a	O
map	O
procedure	O
,	O
which	O
performs	O
filtering	O
and	O
sorting	O
(	O
such	O
as	O
sorting	O
students	O
by	O
first	O
name	O
into	O
queues	O
,	O
one	O
queue	O
for	O
each	O
name	O
)	O
,	O
and	O
a	O
reduce	B-Application
method	O
,	O
which	O
performs	O
a	O
summary	O
operation	O
(	O
such	O
as	O
counting	O
the	O
number	O
of	O
students	O
in	O
each	O
queue	O
,	O
yielding	O
name	O
frequencies	O
)	O
.	O
</s>
<s>
The	O
"	O
MapReduce	B-Operating_System
System	O
"	O
(	O
also	O
called	O
"	O
infrastructure	O
"	O
or	O
"	O
framework	O
"	O
)	O
orchestrates	O
the	O
processing	O
by	O
marshalling	B-Application
the	O
distributed	B-Architecture
servers	O
,	O
running	O
the	O
various	O
tasks	O
in	O
parallel	B-Operating_System
,	O
managing	O
all	O
communications	O
and	O
data	O
transfers	O
between	O
the	O
various	O
parts	O
of	O
the	O
system	O
,	O
and	O
providing	O
for	O
redundancy	O
and	O
fault	B-General_Concept
tolerance	I-General_Concept
.	O
</s>
<s>
It	O
is	O
inspired	O
by	O
the	O
map	O
and	O
reduce	B-Application
functions	I-Application
commonly	O
used	O
in	O
functional	B-Language
programming	I-Language
,	O
although	O
their	O
purpose	O
in	O
the	O
MapReduce	B-Operating_System
framework	O
is	O
not	O
the	O
same	O
as	O
in	O
their	O
original	O
forms	O
.	O
</s>
<s>
The	O
key	O
contributions	O
of	O
the	O
MapReduce	B-Operating_System
framework	O
are	O
not	O
the	O
actual	O
map	O
and	O
reduce	B-Application
functions	I-Application
(	O
which	O
,	O
for	O
example	O
,	O
resemble	O
the	O
1995	O
Message	B-Application
Passing	I-Application
Interface	I-Application
standard	O
's	O
reduce	B-Application
and	O
scatter	O
operations	O
)	O
,	O
but	O
the	O
scalability	O
and	O
fault-tolerance	B-General_Concept
achieved	O
for	O
a	O
variety	O
of	O
applications	O
by	O
optimizing	O
the	O
execution	O
engine	O
.	O
</s>
<s>
As	O
such	O
,	O
a	O
single-threaded	B-Operating_System
implementation	O
of	O
MapReduce	B-Operating_System
is	O
usually	O
not	O
faster	O
than	O
a	O
traditional	O
(	O
non-MapReduce	O
)	O
implementation	O
;	O
any	O
gains	O
are	O
usually	O
only	O
seen	O
with	O
multi-threaded	B-Operating_System
implementations	O
on	O
multi-processor	O
hardware	O
.	O
</s>
<s>
The	O
use	O
of	O
this	O
model	O
is	O
beneficial	O
only	O
when	O
the	O
optimized	O
distributed	B-Architecture
shuffle	O
operation	O
(	O
which	O
reduces	O
network	O
communication	O
cost	O
)	O
and	O
fault	B-General_Concept
tolerance	I-General_Concept
features	O
of	O
the	O
MapReduce	B-Operating_System
framework	O
come	O
into	O
play	O
.	O
</s>
<s>
Optimizing	O
the	O
communication	O
cost	O
is	O
essential	O
to	O
a	O
good	O
MapReduce	B-Operating_System
algorithm	O
.	O
</s>
<s>
MapReduce	B-Operating_System
libraries	B-Library
have	O
been	O
written	O
in	O
many	O
programming	O
languages	O
,	O
with	O
different	O
levels	O
of	O
optimization	O
.	O
</s>
<s>
A	O
popular	O
open-source	B-Application
implementation	O
that	O
has	O
support	O
for	O
distributed	B-Architecture
shuffles	O
is	O
part	O
of	O
Apache	B-Application
Hadoop	I-Application
.	O
</s>
<s>
The	O
name	O
MapReduce	B-Operating_System
originally	O
referred	O
to	O
the	O
proprietary	O
Google	B-Application
technology	O
,	O
but	O
has	O
since	O
been	O
genericized	O
.	O
</s>
<s>
By	O
2014	O
,	O
Google	B-Application
was	O
no	O
longer	O
using	O
MapReduce	B-Operating_System
as	O
their	O
primary	O
big	B-Application
data	I-Application
processing	O
model	O
,	O
and	O
development	O
on	O
Apache	B-Application
Mahout	I-Application
had	O
moved	O
on	O
to	O
more	O
capable	O
and	O
less	O
disk-oriented	O
mechanisms	O
that	O
incorporated	O
full	O
map	O
and	O
reduce	B-Application
capabilities	O
.	O
</s>
<s>
MapReduce	B-Operating_System
is	O
a	O
framework	O
for	O
processing	O
parallelizable	B-Operating_System
problems	O
across	O
large	O
datasets	O
using	O
a	O
large	O
number	O
of	O
computers	O
(	O
nodes	O
)	O
,	O
collectively	O
referred	O
to	O
as	O
a	O
cluster	B-Architecture
(	O
if	O
all	O
nodes	O
are	O
on	O
the	O
same	O
local	O
network	O
and	O
use	O
similar	O
hardware	O
)	O
or	O
a	O
grid	B-Architecture
(	O
if	O
the	O
nodes	O
are	O
shared	O
across	O
geographically	O
and	O
administratively	O
distributed	B-Architecture
systems	I-Architecture
,	O
and	O
use	O
more	O
heterogeneous	O
hardware	O
)	O
.	O
</s>
<s>
Processing	O
can	O
occur	O
on	O
data	O
stored	O
either	O
in	O
a	O
filesystem	B-Application
(	O
unstructured	O
)	O
or	O
in	O
a	O
database	O
(	O
structured	O
)	O
.	O
</s>
<s>
MapReduce	B-Operating_System
can	O
take	O
advantage	O
of	O
the	O
locality	O
of	O
data	O
,	O
processing	O
it	O
near	O
the	O
place	O
it	O
is	O
stored	O
in	O
order	O
to	O
minimize	O
communication	O
overhead	O
.	O
</s>
<s>
A	O
MapReduce	B-Operating_System
framework	O
(	O
or	O
system	O
)	O
is	O
usually	O
composed	O
of	O
three	O
operations	O
(	O
or	O
steps	O
)	O
:	O
</s>
<s>
Reduce	B-Application
:	O
worker	O
nodes	O
now	O
process	O
each	O
group	O
of	O
output	O
data	O
,	O
per	O
key	O
,	O
in	O
parallel	B-Operating_System
.	O
</s>
<s>
MapReduce	B-Operating_System
allows	O
for	O
the	O
distributed	B-Architecture
processing	I-Architecture
of	O
the	O
map	O
and	O
reduction	O
operations	O
.	O
</s>
<s>
Maps	O
can	O
be	O
performed	O
in	O
parallel	B-Operating_System
,	O
provided	O
that	O
each	O
mapping	O
operation	O
is	O
independent	O
of	O
the	O
others	O
;	O
in	O
practice	O
,	O
this	O
is	O
limited	O
by	O
the	O
number	O
of	O
independent	O
data	O
sources	O
and/or	O
the	O
number	O
of	O
CPUs	O
near	O
each	O
source	O
.	O
</s>
<s>
While	O
this	O
process	O
often	O
appears	O
inefficient	O
compared	O
to	O
algorithms	O
that	O
are	O
more	O
sequential	O
(	O
because	O
multiple	O
instances	O
of	O
the	O
reduction	O
process	O
must	O
be	O
run	O
)	O
,	O
MapReduce	B-Operating_System
can	O
be	O
applied	O
to	O
significantly	O
larger	O
datasets	O
than	O
a	O
single	O
"	B-Device
commodity	I-Device
"	I-Device
server	I-Device
can	O
handle	O
a	O
large	O
server	B-Operating_System
farm	I-Operating_System
can	O
use	O
MapReduce	B-Operating_System
to	O
sort	O
a	O
petabyte	O
of	O
data	O
in	O
only	O
a	O
few	O
hours	O
.	O
</s>
<s>
The	O
parallelism	B-Operating_System
also	O
offers	O
some	O
possibility	O
of	O
recovering	O
from	O
partial	O
failure	O
of	O
servers	O
or	O
storage	O
during	O
the	O
operation	O
:	O
if	O
one	O
mapper	O
or	O
reducer	O
fails	O
,	O
the	O
work	O
can	O
be	O
rescheduled	O
assuming	O
the	O
input	O
data	O
are	O
still	O
available	O
.	O
</s>
<s>
Another	O
way	O
to	O
look	O
at	O
MapReduce	B-Operating_System
is	O
as	O
a	O
5-step	O
parallel	B-Operating_System
and	O
distributed	B-Architecture
computation	I-Architecture
:	O
</s>
<s>
Prepare	O
the	O
Map( )	O
input	O
–	O
the	O
"	O
MapReduce	B-Operating_System
system	O
"	O
designates	O
Map	O
processors	O
,	O
assigns	O
the	O
input	O
key	O
K1	O
that	O
each	O
processor	O
would	O
work	O
on	O
,	O
and	O
provides	O
that	O
processor	O
with	O
all	O
the	O
input	O
data	O
associated	O
with	O
that	O
key	O
.	O
</s>
<s>
"	O
Shuffle	O
"	O
the	O
Map	O
output	O
to	O
the	O
Reduce	B-Application
processors	O
–	O
the	O
MapReduce	B-Operating_System
system	O
designates	O
Reduce	B-Application
processors	O
,	O
assigns	O
the	O
K2	O
key	O
each	O
processor	O
should	O
work	O
on	O
,	O
and	O
provides	O
that	O
processor	O
with	O
all	O
the	O
Map-generated	O
data	O
associated	O
with	O
that	O
key	O
.	O
</s>
<s>
Run	O
the	O
user-provided	O
Reduce( )	O
code	O
–	O
Reduce( )	O
is	O
run	O
exactly	O
once	O
for	O
each	O
K2	O
key	O
produced	O
by	O
the	O
Map	O
step	O
.	O
</s>
<s>
Produce	O
the	O
final	O
output	O
–	O
the	O
MapReduce	B-Operating_System
system	O
collects	O
all	O
the	O
Reduce	B-Application
output	O
,	O
and	O
sorts	O
it	O
by	O
K2	O
to	O
produce	O
the	O
final	O
outcome	O
.	O
</s>
<s>
In	O
many	O
situations	O
,	O
the	O
input	O
data	O
might	O
have	O
already	O
been	O
distributed	B-Architecture
(	O
"	B-General_Concept
sharded	I-General_Concept
"	I-General_Concept
)	O
among	O
many	O
different	O
servers	O
,	O
in	O
which	O
case	O
step	O
1	O
could	O
sometimes	O
be	O
greatly	O
simplified	O
by	O
assigning	O
Map	O
servers	O
that	O
would	O
process	O
the	O
locally	O
present	O
input	O
data	O
.	O
</s>
<s>
Similarly	O
,	O
step	O
3	O
could	O
sometimes	O
be	O
sped	O
up	O
by	O
assigning	O
Reduce	B-Application
processors	O
that	O
are	O
as	O
close	O
as	O
possible	O
to	O
the	O
Map-generated	O
data	O
they	O
need	O
to	O
process	O
.	O
</s>
<s>
The	O
Map	O
and	O
Reduce	B-Application
functions	I-Application
of	O
MapReduce	B-Operating_System
are	O
both	O
defined	O
with	O
respect	O
to	O
data	O
structured	O
in	O
(	O
key	O
,	O
value	O
)	O
pairs	O
.	O
</s>
<s>
Map	O
takes	O
one	O
pair	O
of	O
data	O
with	O
a	O
type	O
in	O
one	O
data	B-Application
domain	I-Application
,	O
and	O
returns	O
a	O
list	O
of	O
pairs	O
in	O
a	O
different	O
domain	O
:	O
</s>
<s>
The	O
Map	O
function	O
is	O
applied	O
in	O
parallel	B-Operating_System
to	O
every	O
pair	O
(	O
keyed	O
by	O
k1	O
)	O
in	O
the	O
input	O
dataset	O
.	O
</s>
<s>
After	O
that	O
,	O
the	O
MapReduce	B-Operating_System
framework	O
collects	O
all	O
pairs	O
with	O
the	O
same	O
key	O
(	O
k2	O
)	O
from	O
all	O
lists	O
and	O
groups	O
them	O
together	O
,	O
creating	O
one	O
group	O
for	O
each	O
key	O
.	O
</s>
<s>
The	O
Reduce	B-Application
function	I-Application
is	O
then	O
applied	O
in	O
parallel	B-Operating_System
to	O
each	O
group	O
,	O
which	O
in	O
turn	O
produces	O
a	O
collection	O
of	O
values	O
in	O
the	O
same	O
domain	O
:	O
</s>
<s>
Each	O
Reduce	B-Application
call	O
typically	O
produces	O
either	O
one	O
key	O
value	O
pair	O
or	O
an	O
empty	O
return	O
,	O
though	O
one	O
call	O
is	O
allowed	O
to	O
return	O
more	O
than	O
one	O
key	O
value	O
pair	O
.	O
</s>
<s>
Thus	O
the	O
MapReduce	B-Operating_System
framework	O
transforms	O
a	O
list	O
of	O
(	O
key	O
,	O
value	O
)	O
pairs	O
into	O
another	O
list	O
of	O
(	O
key	O
,	O
value	O
)	O
pairs	O
.	O
</s>
<s>
This	O
behavior	O
is	O
different	O
from	O
the	O
typical	O
functional	B-Language
programming	I-Language
map	O
and	O
reduce	B-Application
combination	O
,	O
which	O
accepts	O
a	O
list	O
of	O
arbitrary	O
values	O
and	O
returns	O
one	O
single	O
value	O
that	O
combines	O
all	O
the	O
values	O
returned	O
by	O
map	O
.	O
</s>
<s>
It	O
is	O
necessary	O
but	O
not	O
sufficient	O
to	O
have	O
implementations	O
of	O
the	O
map	O
and	O
reduce	B-Application
abstractions	O
in	O
order	O
to	O
implement	O
MapReduce	B-Operating_System
.	O
</s>
<s>
Distributed	B-Architecture
implementations	O
of	O
MapReduce	B-Operating_System
require	O
a	O
means	O
of	O
connecting	O
the	O
processes	O
performing	O
the	O
Map	O
and	O
Reduce	B-Application
phases	O
.	O
</s>
<s>
This	O
may	O
be	O
a	O
distributed	B-Protocol
file	I-Protocol
system	I-Protocol
.	O
</s>
<s>
The	O
canonical	O
MapReduce	B-Operating_System
example	O
counts	O
the	O
appearance	O
of	O
each	O
word	O
in	O
a	O
set	O
of	O
documents	O
:	O
</s>
<s>
function	O
reduce(String word, Iterator partialCounts )	O
:	O
</s>
<s>
The	O
framework	O
puts	O
together	O
all	O
the	O
pairs	O
with	O
the	O
same	O
key	O
and	O
feeds	O
them	O
to	O
the	O
same	O
call	O
to	O
reduce	B-Application
.	O
</s>
<s>
In	O
SQL	B-Language
,	O
such	O
a	O
query	O
could	O
be	O
expressed	O
as	O
:	O
</s>
<s>
Using	O
MapReduce	B-Operating_System
,	O
the	O
key	O
values	O
could	O
be	O
the	O
integers	O
1	O
through	O
1100	O
,	O
each	O
representing	O
a	O
batch	O
of	O
1	O
million	O
records	O
,	O
the	O
key	O
value	O
could	O
be	O
a	O
person	O
's	O
age	O
in	O
years	O
,	O
and	O
this	O
computation	O
could	O
be	O
achieved	O
using	O
the	O
following	O
functions	O
:	O
</s>
<s>
The	O
MapReduce	B-Operating_System
system	O
would	O
line	O
up	O
the	O
1100	O
Map	O
processors	O
,	O
and	O
would	O
provide	O
each	O
with	O
its	O
corresponding	O
1	O
million	O
input	O
records	O
.	O
</s>
<s>
The	O
MapReduce	B-Operating_System
System	O
would	O
then	O
line	O
up	O
the	O
96	O
Reduce	B-Application
processors	O
by	O
performing	O
shuffling	O
operation	O
of	O
the	O
key/value	O
pairs	O
due	O
to	O
the	O
fact	O
that	O
we	O
need	O
average	O
per	O
age	O
,	O
and	O
provide	O
each	O
with	O
its	O
millions	O
of	O
corresponding	O
input	O
records	O
.	O
</s>
<s>
The	O
Reduce	B-Application
step	O
would	O
result	O
in	O
the	O
much	O
reduced	O
set	O
of	O
only	O
96	O
output	O
records	O
,	O
which	O
would	O
be	O
put	O
in	O
the	O
final	O
result	O
file	O
,	O
sorted	O
by	O
.	O
</s>
<s>
If	O
we	O
reduce	B-Application
files	O
and	O
,	O
we	O
will	O
have	O
a	O
new	O
file	O
with	O
an	O
average	O
of	O
9	O
contacts	O
for	O
a	O
10-year-old	O
person	O
( ( 	O
9+9+9+9+9	O
)	O
/5	O
)	O
:	O
</s>
<s>
If	O
we	O
reduce	B-Application
it	O
with	O
file	O
,	O
we	O
lose	O
the	O
count	O
of	O
how	O
many	O
records	O
we	O
've	O
already	O
seen	O
,	O
so	O
we	O
end	O
up	O
with	O
an	O
average	O
of	O
9.5	O
contacts	O
for	O
a	O
10-year-old	O
person	O
( ( 	O
9+10	O
)	O
/2	O
)	O
,	O
which	O
is	O
wrong	O
.	O
</s>
<s>
Software	O
framework	O
architecture	O
adheres	O
to	O
open-closed	O
principle	O
where	O
code	O
is	O
effectively	O
divided	O
into	O
unmodifiable	O
frozen	O
spots	O
and	O
extensible	B-Architecture
hot	O
spots	O
.	O
</s>
<s>
The	O
frozen	O
spot	O
of	O
the	O
MapReduce	B-Operating_System
framework	O
is	O
a	O
large	O
distributed	B-Architecture
sort	O
.	O
</s>
<s>
The	O
input	O
reader	O
reads	O
data	O
from	O
stable	O
storage	O
(	O
typically	O
,	O
a	O
distributed	B-Protocol
file	I-Protocol
system	I-Protocol
)	O
and	O
generates	O
key/value	O
pairs	O
.	O
</s>
<s>
Each	O
Map	O
function	O
output	O
is	O
allocated	O
to	O
a	O
particular	O
reducer	O
by	O
the	O
application	O
's	O
partition	B-General_Concept
function	O
for	O
sharding	B-General_Concept
purposes	O
.	O
</s>
<s>
The	O
partition	B-General_Concept
function	O
is	O
given	O
the	O
key	O
and	O
the	O
number	O
of	O
reducers	O
and	O
returns	O
the	O
index	O
of	O
the	O
desired	O
reducer	O
.	O
</s>
<s>
A	O
typical	O
default	O
is	O
to	O
hash	B-Error_Name
the	O
key	O
and	O
use	O
the	O
hash	B-Error_Name
value	I-Error_Name
modulo	O
the	O
number	O
of	O
reducers	O
.	O
</s>
<s>
Between	O
the	O
map	O
and	O
reduce	B-Application
stages	O
,	O
the	O
data	O
are	O
shuffled	O
(	O
parallel-sorted	O
/	O
exchanged	O
between	O
nodes	O
)	O
in	O
order	O
to	O
move	O
the	O
data	O
from	O
the	O
map	O
node	O
that	O
produced	O
them	O
to	O
the	O
shard	B-General_Concept
in	O
which	O
they	O
will	O
be	O
reduced	O
.	O
</s>
<s>
The	O
shuffle	O
can	O
sometimes	O
take	O
longer	O
than	O
the	O
computation	O
time	O
depending	O
on	O
network	O
bandwidth	O
,	O
CPU	O
speeds	O
,	O
data	O
produced	O
and	O
time	O
taken	O
by	O
map	O
and	O
reduce	B-Application
computations	O
.	O
</s>
<s>
The	O
input	O
for	O
each	O
Reduce	B-Application
is	O
pulled	O
from	O
the	O
machine	O
where	O
the	O
Map	O
ran	O
and	O
sorted	O
using	O
the	O
application	O
's	O
comparison	O
function	O
.	O
</s>
<s>
The	O
framework	O
calls	O
the	O
application	O
's	O
Reduce	B-Application
function	I-Application
once	O
for	O
each	O
unique	O
key	O
in	O
the	O
sorted	O
order	O
.	O
</s>
<s>
The	O
Reduce	B-Application
can	O
iterate	O
through	O
the	O
values	O
that	O
are	O
associated	O
with	O
that	O
key	O
and	O
produce	O
zero	O
or	O
more	O
outputs	O
.	O
</s>
<s>
In	O
the	O
word	O
count	O
example	O
,	O
the	O
Reduce	B-Application
function	I-Application
takes	O
the	O
input	O
values	O
,	O
sums	O
them	O
and	O
generates	O
a	O
single	O
output	O
of	O
the	O
word	O
and	O
the	O
final	O
sum	O
.	O
</s>
<s>
The	O
Output	O
Writer	O
writes	O
the	O
output	O
of	O
the	O
Reduce	B-Application
to	O
the	O
stable	O
storage	O
.	O
</s>
<s>
Properties	O
of	O
Monoid	O
are	O
the	O
basis	O
for	O
ensuring	O
the	O
validity	O
of	O
Map/Reduce	B-Operating_System
operations	O
.	O
</s>
<s>
The	O
operations	O
of	O
MapReduce	B-Operating_System
deal	O
with	O
two	O
types	O
:	O
the	O
type	O
A	O
of	O
input	O
data	O
being	O
mapped	O
,	O
and	O
the	O
type	O
B	O
of	O
output	O
data	O
being	O
reduced	O
.	O
</s>
<s>
Map	O
operation	O
takes	O
individual	O
values	O
of	O
type	O
A	O
and	O
produces	O
,	O
for	O
each	O
a:A	O
a	O
value	O
b:B	O
;	O
Reduce	B-Application
operation	O
requires	O
a	O
binary	O
operation	O
•	O
defined	O
on	O
values	O
of	O
type	O
B	O
;	O
it	O
consists	O
of	O
folding	O
all	O
available	O
b:B	O
to	O
a	O
single	O
value	O
.	O
</s>
<s>
From	O
basic	O
requirements	O
point	O
of	O
view	O
,	O
any	O
MapReduce	B-Operating_System
operation	O
must	O
involve	O
the	O
ability	O
to	O
arbitrarily	O
regroup	O
data	O
being	O
reduced	O
.	O
</s>
<s>
The	O
second	O
property	O
guarantees	O
that	O
,	O
when	O
parallelized	B-Operating_System
over	O
multiple	O
nodes	O
,	O
the	O
nodes	O
that	O
do	O
n't	O
have	O
any	O
data	O
to	O
process	O
would	O
have	O
no	O
impact	O
on	O
the	O
result	O
.	O
</s>
<s>
This	O
means	O
that	O
we	O
have	O
a	O
Catamorphism	B-Application
A*	O
(	O
B	O
,	O
•	O
,	O
e	O
)	O
.	O
</s>
<s>
Shuffle	O
operation	O
per	O
se	O
is	O
not	O
related	O
to	O
the	O
essence	O
of	O
MapReduce	B-Operating_System
;	O
it	O
's	O
needed	O
to	O
distribute	O
calculations	O
over	O
the	O
cloud	O
.	O
</s>
<s>
It	O
follows	O
from	O
the	O
above	O
that	O
not	O
every	O
binary	O
Reduce	B-Application
operation	O
will	O
work	O
in	O
MapReduce	B-Operating_System
.	O
</s>
<s>
MapReduce	B-Operating_System
programs	O
are	O
not	O
guaranteed	O
to	O
be	O
fast	O
.	O
</s>
<s>
The	O
main	O
benefit	O
of	O
this	O
programming	O
model	O
is	O
to	O
exploit	O
the	O
optimized	O
shuffle	O
operation	O
of	O
the	O
platform	O
,	O
and	O
only	O
having	O
to	O
write	O
the	O
Map	O
and	O
Reduce	B-Application
parts	O
of	O
the	O
program	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
author	O
of	O
a	O
MapReduce	B-Operating_System
program	O
however	O
has	O
to	O
take	O
the	O
shuffle	O
step	O
into	O
consideration	O
;	O
in	O
particular	O
the	O
partition	B-General_Concept
function	O
and	O
the	O
amount	O
of	O
data	O
written	O
by	O
the	O
Map	O
function	O
can	O
have	O
a	O
large	O
impact	O
on	O
the	O
performance	O
and	O
scalability	O
.	O
</s>
<s>
Additional	O
modules	O
such	O
as	O
the	O
Combiner	O
function	O
can	O
help	O
to	O
reduce	B-Application
the	O
amount	O
of	O
data	O
written	O
to	O
disk	B-Device
,	O
and	O
transmitted	O
over	O
the	O
network	O
.	O
</s>
<s>
MapReduce	B-Operating_System
applications	O
can	O
achieve	O
sub-linear	O
speedups	O
under	O
specific	O
circumstances	O
.	O
</s>
<s>
When	O
designing	O
a	O
MapReduce	B-Operating_System
algorithm	O
,	O
the	O
author	O
needs	O
to	O
choose	O
a	O
good	O
tradeoff	O
between	O
the	O
computation	O
and	O
the	O
communication	O
costs	O
.	O
</s>
<s>
Communication	O
cost	O
often	O
dominates	O
the	O
computation	O
cost	O
,	O
and	O
many	O
MapReduce	B-Operating_System
implementations	O
are	O
designed	O
to	O
write	O
all	O
communication	O
to	O
distributed	B-Architecture
storage	O
for	O
crash	O
recovery	O
.	O
</s>
<s>
In	O
tuning	O
performance	O
of	O
MapReduce	B-Operating_System
,	O
the	O
complexity	O
of	O
mapping	O
,	O
shuffle	O
,	O
sorting	O
(	O
grouping	O
by	O
the	O
key	O
)	O
,	O
and	O
reducing	O
has	O
to	O
be	O
taken	O
into	O
account	O
.	O
</s>
<s>
Hence	O
,	O
small	O
partition	B-General_Concept
sizes	O
reduce	B-Application
sorting	O
time	O
,	O
but	O
there	O
is	O
a	O
trade-off	O
because	O
having	O
a	O
large	O
number	O
of	O
reducers	O
may	O
be	O
impractical	O
.	O
</s>
<s>
For	O
processes	O
that	O
complete	O
quickly	O
,	O
and	O
where	O
the	O
data	O
fits	O
into	O
main	O
memory	O
of	O
a	O
single	O
machine	O
or	O
a	O
small	O
cluster	B-Architecture
,	O
using	O
a	O
MapReduce	B-Operating_System
framework	O
usually	O
is	O
not	O
effective	O
.	O
</s>
<s>
Since	O
these	O
frameworks	O
are	O
designed	O
to	O
recover	O
from	O
the	O
loss	O
of	O
whole	O
nodes	O
during	O
the	O
computation	O
,	O
they	O
write	O
interim	O
results	O
to	O
distributed	B-Architecture
storage	O
.	O
</s>
<s>
A	O
task	O
that	O
completes	O
in	O
seconds	O
can	O
just	O
be	O
restarted	O
in	O
the	O
case	O
of	O
an	O
error	O
,	O
and	O
the	O
likelihood	O
of	O
at	O
least	O
one	O
machine	O
failing	O
grows	O
quickly	O
with	O
the	O
cluster	B-Architecture
size	O
.	O
</s>
<s>
On	O
such	O
problems	O
,	O
implementations	O
keeping	O
all	O
data	O
in	O
memory	O
and	O
simply	O
restarting	O
a	O
computation	O
on	O
node	O
failures	O
or	O
—	O
when	O
the	O
data	O
is	O
small	O
enough	O
—	O
non-distributed	O
solutions	O
will	O
often	O
be	O
faster	O
than	O
a	O
MapReduce	B-Operating_System
system	O
.	O
</s>
<s>
MapReduce	B-Operating_System
achieves	O
reliability	O
by	O
parceling	O
out	O
a	O
number	O
of	O
operations	O
on	O
the	O
set	O
of	O
data	O
to	O
each	O
node	O
in	O
the	O
network	O
.	O
</s>
<s>
If	O
a	O
node	O
falls	O
silent	O
for	O
longer	O
than	O
that	O
interval	O
,	O
the	O
master	O
node	O
(	O
similar	O
to	O
the	O
master	O
server	O
in	O
the	B-Application
Google	I-Application
File	B-Application
System	I-Application
)	O
records	O
the	O
node	O
as	O
dead	O
and	O
sends	O
out	O
the	O
node	O
's	O
assigned	O
work	O
to	O
other	O
nodes	O
.	O
</s>
<s>
Individual	O
operations	O
use	O
atomic	B-General_Concept
operations	I-General_Concept
for	O
naming	O
file	O
outputs	O
as	O
a	O
check	O
to	O
ensure	O
that	O
there	O
are	O
not	O
parallel	B-Operating_System
conflicting	O
threads	B-Operating_System
running	O
.	O
</s>
<s>
The	O
reduce	B-Application
operations	O
operate	O
much	O
the	O
same	O
way	O
.	O
</s>
<s>
Because	O
of	O
their	O
inferior	O
properties	O
with	O
regard	O
to	O
parallel	B-Operating_System
operations	O
,	O
the	O
master	O
node	O
attempts	O
to	O
schedule	O
reduce	B-Application
operations	O
on	O
the	O
same	O
node	O
,	O
or	O
in	O
the	O
same	O
rack	O
as	O
the	O
node	O
holding	O
the	O
data	O
being	O
operated	O
on	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
older	O
versions	O
of	O
Hadoop	B-Application
the	O
NameNode	O
was	O
a	O
single	B-Architecture
point	I-Architecture
of	I-Architecture
failure	I-Architecture
for	O
the	O
distributed	B-Architecture
filesystem	B-Application
.	O
</s>
<s>
Later	O
versions	O
of	O
Hadoop	B-Application
have	O
high	O
availability	O
with	O
an	O
active/passive	O
failover	O
for	O
the	O
"	O
NameNode.	O
"	O
</s>
<s>
MapReduce	B-Operating_System
is	O
useful	O
in	O
a	O
wide	O
range	O
of	O
applications	O
,	O
including	O
distributed	B-Architecture
pattern-based	O
searching	O
,	O
distributed	B-Architecture
sorting	O
,	O
web	O
link-graph	O
reversal	O
,	O
Singular	O
Value	O
Decomposition	O
,	O
web	O
access	O
log	O
stats	O
,	O
inverted	B-Algorithm
index	I-Algorithm
construction	O
,	O
document	O
clustering	O
,	O
machine	O
learning	O
,	O
and	O
statistical	B-General_Concept
machine	I-General_Concept
translation	I-General_Concept
.	O
</s>
<s>
Moreover	O
,	O
the	O
MapReduce	B-Operating_System
model	O
has	O
been	O
adapted	O
to	O
several	O
computing	O
environments	O
like	O
multi-core	O
and	O
many-core	O
systems	O
,	O
desktop	O
grids	O
,	O
</s>
<s>
multi-cluster	O
,	O
volunteer	O
computing	O
environments	O
,	O
dynamic	O
cloud	O
environments	O
,	O
mobile	O
environments	O
,	O
and	O
high-performance	O
computing	O
environments	O
.	O
</s>
<s>
At	O
Google	B-Application
,	O
MapReduce	B-Operating_System
was	O
used	O
to	O
completely	O
regenerate	O
Google	B-Application
's	I-Application
index	O
of	O
the	O
World	O
Wide	O
Web	O
.	O
</s>
<s>
Development	O
at	O
Google	B-Application
has	O
since	O
moved	O
on	O
to	O
technologies	O
such	O
as	O
Percolator	O
,	O
FlumeJava	O
and	O
MillWheel	B-Application
that	O
offer	O
streaming	O
operation	O
and	O
updates	O
instead	O
of	O
batch	O
processing	O
,	O
to	O
allow	O
integrating	O
"	O
live	O
"	O
search	O
results	O
without	O
rebuilding	O
the	O
complete	O
index	O
.	O
</s>
<s>
MapReduce	B-Operating_System
's	O
stable	O
inputs	O
and	O
outputs	O
are	O
usually	O
stored	O
in	O
a	O
distributed	B-Protocol
file	I-Protocol
system	I-Protocol
.	O
</s>
<s>
The	O
transient	O
data	O
are	O
usually	O
stored	O
on	O
local	O
disk	B-Device
and	O
fetched	O
remotely	O
by	O
the	O
reducers	O
.	O
</s>
<s>
David	O
DeWitt	O
and	O
Michael	O
Stonebraker	O
,	O
computer	O
scientists	O
specializing	O
in	O
parallel	B-Operating_System
databases	O
and	O
shared-nothing	B-Operating_System
architectures	I-Operating_System
,	O
have	O
been	O
critical	O
of	O
the	O
breadth	O
of	O
problems	O
that	O
MapReduce	B-Operating_System
can	O
be	O
used	O
for	O
.	O
</s>
<s>
They	O
called	O
its	O
interface	O
too	O
low-level	B-Language
and	O
questioned	O
whether	O
it	O
really	O
represents	O
the	O
paradigm	O
shift	O
its	O
proponents	O
have	O
claimed	O
it	O
is	O
.	O
</s>
<s>
They	O
challenged	O
the	O
MapReduce	B-Operating_System
proponents	O
 '	O
claims	O
of	O
novelty	O
,	O
citing	O
Teradata	O
as	O
an	O
example	O
of	O
prior	O
art	O
that	O
has	O
existed	O
for	O
over	O
two	O
decades	O
.	O
</s>
<s>
They	O
also	O
compared	O
MapReduce	B-Operating_System
programmers	O
to	O
CODASYL	B-Language
programmers	O
,	O
noting	O
both	O
are	O
"	O
writing	O
in	O
a	O
low-level	B-Language
language	I-Language
performing	O
low-level	B-Language
record	O
manipulation.	O
"	O
</s>
<s>
MapReduce	B-Operating_System
's	O
use	O
of	O
input	O
files	O
and	O
lack	O
of	O
schema	B-Application
support	O
prevents	O
the	O
performance	O
improvements	O
enabled	O
by	O
common	O
database	O
system	O
features	O
such	O
as	O
B-trees	B-Architecture
and	O
hash	B-General_Concept
partitioning	I-General_Concept
,	O
though	O
projects	O
such	O
as	O
Pig	B-Language
(	O
or	O
PigLatin	O
)	O
,	O
Sawzall	B-Application
,	O
Apache	B-General_Concept
Hive	I-General_Concept
,	O
HBase	B-Language
and	O
Bigtable	B-Application
are	O
addressing	O
some	O
of	O
these	O
problems	O
.	O
</s>
<s>
Jorgensen	O
asserts	O
that	O
DeWitt	O
and	O
Stonebraker	O
's	O
entire	O
analysis	O
is	O
groundless	O
as	O
MapReduce	B-Operating_System
was	O
never	O
designed	O
nor	O
intended	O
to	O
be	O
used	O
as	O
a	O
database	O
.	O
</s>
<s>
DeWitt	O
and	O
Stonebraker	O
have	O
subsequently	O
published	O
a	O
detailed	O
benchmark	O
study	O
in	O
2009	O
comparing	O
performance	O
of	O
Hadoop	B-Application
's	I-Application
MapReduce	B-Operating_System
and	O
RDBMS	O
approaches	O
on	O
several	O
specific	O
problems	O
.	O
</s>
<s>
They	O
concluded	O
that	O
relational	O
databases	O
offer	O
real	O
advantages	O
for	O
many	O
kinds	O
of	O
data	O
use	O
,	O
especially	O
on	O
complex	O
processing	O
or	O
where	O
the	O
data	O
is	O
used	O
across	O
an	O
enterprise	O
,	O
but	O
that	O
MapReduce	B-Operating_System
may	O
be	O
easier	O
for	O
users	O
to	O
adopt	O
for	O
simple	O
or	O
one-time	O
processing	O
tasks	O
.	O
</s>
<s>
The	O
MapReduce	B-Operating_System
programming	O
paradigm	O
was	O
also	O
described	O
in	O
Danny	O
Hillis	O
's	O
1985	O
thesis	O
intended	O
for	O
use	O
on	O
the	B-Device
Connection	I-Device
Machine	I-Device
,	O
where	O
it	O
was	O
called	O
"	O
xapping/reduction	O
"	O
and	O
relied	O
upon	O
that	O
machine	O
's	O
special	O
hardware	O
to	O
accelerate	O
both	O
map	O
and	O
reduce	B-Application
.	O
</s>
<s>
The	O
dialect	O
ultimately	O
used	O
for	O
the	B-Device
Connection	I-Device
Machine	I-Device
,	O
the	O
1986	O
StarLisp	B-Language
,	O
had	O
parallel	B-Operating_System
*	O
map	O
and	O
reduce	B-Application
!	O
</s>
<s>
!,	O
which	O
in	O
turn	O
was	O
based	O
on	O
the	O
1984	O
Common	B-Language
Lisp	I-Language
,	O
which	O
had	O
non-parallel	O
map	O
and	O
reduce	B-Application
built	O
in	O
.	O
</s>
<s>
The	O
tree-like	O
approach	O
that	O
the	B-Device
Connection	I-Device
Machine	I-Device
's	O
hypercube	B-Architecture
architecture	I-Architecture
uses	O
to	O
execute	O
reduce	B-Application
in	O
time	O
is	O
effectively	O
the	O
same	O
as	O
the	O
approach	O
referred	O
to	O
within	O
the	B-Application
Google	I-Application
paper	O
as	O
prior	O
work	O
.	O
</s>
<s>
In	O
2010	O
Google	B-Application
was	O
granted	O
what	O
is	O
described	O
as	O
a	O
patent	O
on	O
MapReduce	B-Operating_System
.	O
</s>
<s>
The	O
patent	O
,	O
filed	O
in	O
2004	O
,	O
may	O
cover	O
use	O
of	O
MapReduce	B-Operating_System
by	O
open	B-Application
source	I-Application
software	I-Application
such	O
as	O
Hadoop	B-Application
,	O
CouchDB	B-Application
,	O
and	O
others	O
.	O
</s>
<s>
In	O
Ars	O
Technica	O
,	O
an	O
editor	O
acknowledged	O
Google	B-Application
's	I-Application
role	O
in	O
popularizing	O
the	O
MapReduce	B-Operating_System
concept	O
,	O
but	O
questioned	O
whether	O
the	O
patent	O
was	O
valid	O
or	O
novel	O
.	O
</s>
<s>
In	O
2013	O
,	O
as	O
part	O
of	O
its	O
"	O
Open	O
Patent	O
Non-Assertion	O
(	O
OPN	O
)	O
Pledge	O
"	O
,	O
Google	B-Application
pledged	O
to	O
only	O
use	O
the	O
patent	O
defensively	O
.	O
</s>
<s>
MapReduce	B-Operating_System
tasks	O
must	O
be	O
written	O
as	O
acyclic	O
dataflow	O
programs	O
,	O
i.e.	O
</s>
<s>
This	O
paradigm	O
makes	O
repeated	O
querying	O
of	O
datasets	O
difficult	O
and	O
imposes	O
limitations	O
that	O
are	O
felt	O
in	O
fields	O
such	O
as	O
graph	B-Application
processing	O
where	O
iterative	O
algorithms	O
that	O
revisit	O
a	O
single	O
working	B-General_Concept
set	I-General_Concept
multiple	O
times	O
are	O
the	O
norm	O
,	O
as	O
well	O
as	O
,	O
in	O
the	O
presence	O
of	O
disk-based	O
data	O
with	O
high	O
latency	O
,	O
even	O
the	O
field	O
of	O
machine	O
learning	O
where	O
multiple	O
passes	O
through	O
the	O
data	O
are	O
required	O
even	O
though	O
algorithms	O
can	O
tolerate	O
serial	O
access	O
to	O
the	O
data	O
each	O
pass	O
.	O
</s>
