<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
an	O
associative	B-Application
array	I-Application
,	O
map	O
,	O
symbol	O
table	O
,	O
or	O
dictionary	B-Application
is	O
an	O
abstract	O
data	O
type	O
that	O
stores	O
a	O
collection	B-Application
of	O
(	O
key	O
,	O
value	O
)	O
pairs	O
,	O
such	O
that	O
each	O
possible	O
key	O
appears	O
at	O
most	O
once	O
in	O
the	O
collection	B-Application
.	O
</s>
<s>
In	O
mathematical	O
terms	O
,	O
an	O
associative	B-Application
array	I-Application
is	O
a	O
function	O
with	O
finite	O
domain	B-Algorithm
.	O
</s>
<s>
The	O
dictionary	B-Application
problem	O
is	O
the	O
classic	O
problem	O
of	O
designing	O
efficient	O
data	B-General_Concept
structures	I-General_Concept
that	O
implement	O
associative	B-Application
arrays	I-Application
.	O
</s>
<s>
The	O
two	O
major	O
solutions	O
to	O
the	O
dictionary	B-Application
problem	O
are	O
hash	B-Algorithm
tables	I-Algorithm
and	O
search	B-Data_Structure
trees	I-Data_Structure
.	O
</s>
<s>
In	O
some	O
cases	O
it	O
is	O
also	O
possible	O
to	O
solve	O
the	O
problem	O
using	O
directly	O
addressed	O
arrays	O
,	O
binary	B-Language
search	I-Language
trees	I-Language
,	O
or	O
other	O
more	O
specialized	O
structures	O
.	O
</s>
<s>
Many	O
programming	O
languages	O
include	O
associative	B-Application
arrays	I-Application
as	O
primitive	O
data	O
types	O
,	O
and	O
they	O
are	O
available	O
in	O
software	B-Library
libraries	I-Library
for	O
many	O
others	O
.	O
</s>
<s>
Content-addressable	B-Data_Structure
memory	I-Data_Structure
is	O
a	O
form	O
of	O
direct	O
hardware-level	O
support	O
for	O
associative	B-Application
arrays	I-Application
.	O
</s>
<s>
Associative	B-Application
arrays	I-Application
have	O
many	O
applications	O
including	O
such	O
fundamental	O
programming	O
patterns	O
as	O
memoization	O
and	O
the	O
decorator	O
pattern	O
.	O
</s>
<s>
In	O
an	O
associative	B-Application
array	I-Application
,	O
the	O
association	O
between	O
a	B-Application
key	I-Application
and	I-Application
a	I-Application
value	I-Application
is	O
often	O
known	O
as	O
a	O
"	O
mapping	O
"	O
,	O
and	O
the	O
same	O
word	O
mapping	O
may	O
also	O
be	O
used	O
to	O
refer	O
to	O
the	O
process	O
of	O
creating	O
a	O
new	O
association	O
.	O
</s>
<s>
The	O
operations	O
that	O
are	O
usually	O
defined	O
for	O
an	O
associative	B-Application
array	I-Application
are	O
:	O
</s>
<s>
Insert	O
or	O
put	O
:	O
add	O
a	O
new	O
pair	O
to	O
the	O
collection	B-Application
,	O
mapping	O
the	O
key	O
to	O
its	O
new	O
value	O
.	O
</s>
<s>
Remove	O
or	O
delete	O
:	O
remove	O
a	O
pair	O
from	O
the	O
collection	B-Application
,	O
unmapping	O
a	O
given	O
key	O
from	O
its	O
value	O
.	O
</s>
<s>
If	O
no	O
value	O
is	O
found	O
,	O
some	O
lookup	O
functions	O
raise	O
an	O
exception	B-General_Concept
,	O
while	O
others	O
return	O
a	O
default	O
value	O
(	O
zero	O
,	O
null	O
,	O
specific	O
value	O
passed	O
to	O
the	O
constructor	O
,	O
...	O
)	O
.	O
</s>
<s>
In	O
addition	O
,	O
associative	B-Application
arrays	I-Application
may	O
also	O
include	O
other	O
operations	O
such	O
as	O
determining	O
the	O
number	O
of	O
mappings	O
or	O
constructing	O
an	O
iterator	O
to	O
loop	O
over	O
all	O
the	O
mappings	O
.	O
</s>
<s>
A	O
multimap	B-Language
generalizes	O
an	O
associative	B-Application
array	I-Application
by	O
allowing	O
multiple	O
values	O
to	O
be	O
associated	O
with	O
a	O
single	O
key	O
.	O
</s>
<s>
A	O
bidirectional	B-Data_Structure
map	I-Data_Structure
is	O
a	O
related	O
abstract	O
data	O
type	O
in	O
which	O
the	O
mappings	O
operate	O
in	O
both	O
directions	O
:	O
each	O
value	O
must	O
be	O
associated	O
with	O
a	O
unique	O
key	O
,	O
and	O
a	O
second	O
lookup	O
operation	O
takes	O
a	O
value	O
as	O
an	O
argument	O
and	O
looks	O
up	O
the	O
key	O
associated	O
with	O
that	O
value	O
.	O
</s>
<s>
The	O
operations	O
of	O
the	O
associative	B-Application
array	I-Application
should	O
satisfy	O
various	O
properties	O
:	O
</s>
<s>
where	O
k	O
and	O
j	O
are	O
keys	O
,	O
v	O
is	O
a	O
value	O
,	O
D	B-Application
is	O
an	O
associative	B-Application
array	I-Application
,	O
and	O
new( )	O
creates	O
a	O
new	O
,	O
empty	O
associative	B-Application
array	I-Application
.	O
</s>
<s>
Suppose	O
that	O
the	O
set	O
of	O
loans	O
made	O
by	O
a	O
library	O
is	O
represented	O
in	O
a	O
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
Therefore	O
,	O
the	O
information	O
about	O
which	O
books	O
are	O
checked	O
out	O
to	O
which	O
patrons	O
may	O
be	O
represented	O
by	O
an	O
associative	B-Application
array	I-Application
,	O
in	O
which	O
the	O
books	O
are	O
the	O
keys	O
and	O
the	O
patrons	O
are	O
the	O
values	O
.	O
</s>
<s>
Using	O
notation	O
from	O
Python	B-Language
or	O
JSON	B-General_Concept
,	O
the	O
data	B-General_Concept
structure	I-General_Concept
would	O
be	O
:	O
</s>
<s>
For	O
dictionaries	B-Application
with	O
very	O
small	O
numbers	O
of	O
mappings	O
,	O
it	O
may	O
make	O
sense	O
to	O
implement	O
the	O
dictionary	B-Application
using	O
an	O
association	B-Data_Structure
list	I-Data_Structure
,	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
of	O
mappings	O
.	O
</s>
<s>
With	O
this	O
implementation	O
,	O
the	O
time	O
to	O
perform	O
the	O
basic	O
dictionary	B-Application
operations	O
is	O
linear	O
in	O
the	O
total	O
number	O
of	O
mappings	O
;	O
however	O
,	O
it	O
is	O
easy	O
to	O
implement	O
and	O
the	O
constant	O
factors	O
in	O
its	O
running	O
time	O
are	O
small	O
.	O
</s>
<s>
Another	O
very	O
simple	O
implementation	O
technique	O
,	O
usable	O
when	O
the	O
keys	O
are	O
restricted	O
to	O
a	O
narrow	O
range	O
,	O
is	O
direct	O
addressing	O
into	O
an	O
array	B-Data_Structure
:	O
the	O
value	O
for	O
a	O
given	O
key	O
k	O
is	O
stored	O
at	O
the	O
array	B-Data_Structure
cell	O
A[k],	O
or	O
if	O
there	O
is	O
no	O
mapping	O
for	O
k	O
then	O
the	O
cell	O
stores	O
a	O
special	O
sentinel	B-Data_Structure
value	I-Data_Structure
that	O
indicates	O
the	O
absence	O
of	O
a	O
mapping	O
.	O
</s>
<s>
As	O
well	O
as	O
being	O
simple	O
,	O
this	O
technique	O
is	O
fast	O
:	O
each	O
dictionary	B-Application
operation	O
takes	O
constant	O
time	O
.	O
</s>
<s>
The	O
two	O
major	O
approaches	O
to	O
implementing	O
dictionaries	B-Application
are	O
a	O
hash	B-Algorithm
table	I-Algorithm
or	O
a	O
search	B-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
The	O
most	O
frequently	O
used	O
general-purpose	O
implementation	O
of	O
an	O
associative	B-Application
array	I-Application
is	O
with	O
a	O
hash	B-Algorithm
table	I-Algorithm
:	O
an	O
array	B-Data_Structure
combined	O
with	O
a	O
hash	B-Error_Name
function	I-Error_Name
that	O
separates	O
each	O
key	O
into	O
a	O
separate	O
"	O
bucket	O
"	O
of	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
The	O
basic	O
idea	O
behind	O
a	O
hash	B-Algorithm
table	I-Algorithm
is	O
that	O
accessing	O
an	O
element	O
of	O
an	O
array	B-Data_Structure
via	O
its	O
index	O
is	O
a	O
simple	O
,	O
constant-time	O
operation	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
average	O
overhead	O
of	O
an	O
operation	O
for	O
a	O
hash	B-Algorithm
table	I-Algorithm
is	O
only	O
the	O
computation	O
of	O
the	O
key	O
's	O
hash	B-Error_Name
,	O
combined	O
with	O
accessing	O
the	O
corresponding	O
bucket	O
within	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
As	O
such	O
,	O
hash	B-Algorithm
tables	I-Algorithm
usually	O
perform	O
in	O
O(1 )	O
time	O
,	O
and	O
outperform	O
alternatives	O
in	O
most	O
situations	O
.	O
</s>
<s>
Hash	B-Algorithm
tables	I-Algorithm
need	O
to	O
be	O
able	O
to	O
handle	O
collisions	B-Algorithm
:	O
when	O
the	O
hash	B-Error_Name
function	I-Error_Name
maps	O
two	O
different	O
keys	O
to	O
the	O
same	O
bucket	O
of	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
The	O
two	O
most	O
widespread	O
approaches	O
to	O
this	O
problem	O
are	O
separate	O
chaining	O
and	O
open	B-Algorithm
addressing	I-Algorithm
.	O
</s>
<s>
In	O
separate	O
chaining	O
,	O
the	O
array	B-Data_Structure
does	O
not	O
store	O
the	O
value	O
itself	O
but	O
stores	O
a	O
pointer	O
to	O
another	O
container	B-Application
,	O
usually	O
an	O
association	B-Data_Structure
list	I-Data_Structure
,	O
that	O
stores	O
all	O
of	O
the	O
values	O
matching	O
the	O
hash	B-Error_Name
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
in	O
open	B-Algorithm
addressing	I-Algorithm
,	O
if	O
a	O
hash	B-Algorithm
collision	I-Algorithm
is	O
found	O
,	O
then	O
the	O
table	O
seeks	O
an	O
empty	O
spot	O
in	O
an	O
array	B-Data_Structure
to	O
store	O
the	O
value	O
in	O
a	O
deterministic	O
manner	O
,	O
usually	O
by	O
looking	O
at	O
the	O
next	O
immediate	O
position	O
in	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
Open	B-Algorithm
addressing	I-Algorithm
has	O
a	O
lower	O
cache	O
miss	O
ratio	O
than	O
separate	O
chaining	O
when	O
the	O
table	O
is	O
mostly	O
empty	O
.	O
</s>
<s>
However	O
,	O
as	O
the	O
table	O
becomes	O
filled	O
with	O
more	O
elements	O
,	O
open	B-Algorithm
addressing	I-Algorithm
's	O
performance	O
degrades	O
exponentially	O
.	O
</s>
<s>
Another	O
common	O
approach	O
is	O
to	O
implement	O
an	O
associative	B-Application
array	I-Application
with	O
a	O
self-balancing	B-Data_Structure
binary	I-Data_Structure
search	I-Data_Structure
tree	I-Data_Structure
,	O
such	O
as	O
an	O
AVL	O
tree	O
or	O
a	O
red	O
–	O
black	O
tree	O
.	O
</s>
<s>
Compared	O
to	O
hash	B-Algorithm
tables	I-Algorithm
,	O
these	O
structures	O
have	O
both	O
advantages	O
and	O
weaknesses	O
.	O
</s>
<s>
The	O
worst-case	O
performance	O
of	O
self-balancing	B-Data_Structure
binary	I-Data_Structure
search	I-Data_Structure
trees	I-Data_Structure
is	O
significantly	O
better	O
than	O
that	O
of	O
a	O
hash	B-Algorithm
table	I-Algorithm
,	O
with	O
a	O
time	O
complexity	O
in	O
big	O
O	O
notation	O
of	O
O(log n )	O
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
hash	B-Algorithm
tables	I-Algorithm
,	O
whose	O
worst-case	O
performance	O
involves	O
all	O
elements	O
sharing	O
a	O
single	O
bucket	O
,	O
resulting	O
in	O
O(n )	O
time	O
complexity	O
.	O
</s>
<s>
In	O
addition	O
,	O
and	O
like	O
all	O
binary	B-Language
search	I-Language
trees	I-Language
,	O
self-balancing	B-Data_Structure
binary	I-Data_Structure
search	I-Data_Structure
trees	I-Data_Structure
keep	O
their	O
elements	O
in	O
order	O
.	O
</s>
<s>
Thus	O
,	O
traversing	O
its	O
elements	O
follows	O
a	O
least-to-greatest	O
pattern	O
,	O
whereas	O
traversing	O
a	O
hash	B-Algorithm
table	I-Algorithm
can	O
result	O
in	O
elements	O
being	O
in	O
seemingly	O
random	O
order	O
.	O
</s>
<s>
Because	O
they	O
are	O
in-order	O
,	O
tree-based	O
maps	O
can	O
also	O
satisfy	O
range	O
queries	O
(	O
find	O
all	O
values	O
between	O
two	O
bounds	O
)	O
whereas	O
a	O
hashmap	B-Algorithm
can	O
only	O
find	O
exact	O
values	O
.	O
</s>
<s>
However	O
,	O
hash	B-Algorithm
tables	I-Algorithm
have	O
a	O
much	O
better	O
average-case	O
time	O
complexity	O
than	O
self-balancing	B-Data_Structure
binary	I-Data_Structure
search	I-Data_Structure
trees	I-Data_Structure
of	O
O(1 )	O
,	O
and	O
their	O
worst-case	O
performance	O
is	O
highly	O
unlikely	O
when	O
a	O
good	O
hash	B-Error_Name
function	I-Error_Name
is	O
used	O
.	O
</s>
<s>
It	O
is	O
worth	O
noting	O
that	O
a	O
self-balancing	B-Data_Structure
binary	I-Data_Structure
search	I-Data_Structure
tree	I-Data_Structure
can	O
be	O
used	O
to	O
implement	O
the	O
buckets	O
for	O
a	O
hash	B-Algorithm
table	I-Algorithm
that	O
uses	O
separate	O
chaining	O
.	O
</s>
<s>
However	O
,	O
this	O
introduces	O
extra	O
complexity	O
into	O
the	O
implementation	O
and	O
may	O
cause	O
even	O
worse	O
performance	O
for	O
smaller	O
hash	B-Algorithm
tables	I-Algorithm
,	O
where	O
the	O
time	O
spent	O
inserting	O
into	O
and	O
balancing	O
the	O
tree	O
is	O
greater	O
than	O
the	O
time	O
needed	O
to	O
perform	O
a	O
linear	B-Algorithm
search	I-Algorithm
on	O
all	O
of	O
the	O
elements	O
of	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
or	O
similar	O
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
Associative	B-Application
arrays	I-Application
may	O
also	O
be	O
stored	O
in	O
unbalanced	O
binary	B-Language
search	I-Language
trees	I-Language
or	O
in	O
data	B-General_Concept
structures	I-General_Concept
specialized	O
to	O
a	O
particular	O
type	O
of	O
keys	O
such	O
as	O
radix	B-Data_Structure
trees	I-Data_Structure
,	O
tries	B-General_Concept
,	O
Judy	B-Data_Structure
arrays	I-Data_Structure
,	O
or	O
van	B-Application
Emde	I-Application
Boas	I-Application
trees	I-Application
,	O
though	O
the	O
ability	O
of	O
these	O
implementation	O
methods	O
within	O
comparison	O
to	O
hash	B-Algorithm
tables	I-Algorithm
varies	O
;	O
for	O
instance	O
,	O
Judy	B-Data_Structure
trees	I-Data_Structure
remain	O
indicated	O
to	O
perform	O
with	O
a	O
smaller	O
quantity	O
of	O
efficiency	O
than	O
hash	B-Algorithm
tables	I-Algorithm
,	O
while	O
carefully	O
selected	O
hash	B-Algorithm
tables	I-Algorithm
generally	O
perform	O
with	O
increased	O
efficiency	O
in	O
comparison	O
to	O
adaptive	O
radix	B-Data_Structure
trees	I-Data_Structure
,	O
with	O
potentially	O
greater	O
restrictions	O
on	O
the	O
types	O
of	O
data	O
that	O
they	O
can	O
handle	O
.	O
</s>
<s>
The	O
advantages	O
of	O
these	O
alternative	O
structures	O
come	O
from	O
their	O
ability	O
to	O
handle	O
operations	O
beyond	O
the	O
basic	O
ones	O
of	O
an	O
associative	B-Application
array	I-Application
,	O
such	O
as	O
finding	O
the	O
mapping	O
whose	O
key	O
is	O
the	O
closest	O
to	O
a	O
queried	O
key	O
,	O
when	O
the	O
query	O
is	O
not	O
itself	O
present	O
in	O
the	O
set	O
of	O
mappings	O
.	O
</s>
<s>
Underlying	O
data	B-General_Concept
structure	I-General_Concept
Lookup	O
or	O
Removal	O
Insertion	O
Ordered	O
average	O
worst	O
case	O
average	O
worst	O
case	O
Hash	B-Error_Name
tableO(1 )	O
O(n )	O
O(1 )	O
O(n )	O
Self-balancing	O
binary	O
search	O
treeO(log n )	O
O(log n )	O
O(log n )	O
O(log n )	O
unbalanced	O
binary	O
search	O
treeO(log n )	O
O(n )	O
O(log n )	O
O(n )	O
Sequential	O
container	B-Application
of	O
key	O
–	O
value	O
pairs( 	O
e.g.	O
</s>
<s>
The	O
basic	O
definition	O
of	O
the	O
dictionary	B-Application
does	O
not	O
mandate	O
an	O
order	O
.	O
</s>
<s>
To	O
guarantee	O
a	O
fixed	O
order	O
of	O
enumeration	O
,	O
ordered	O
versions	O
of	O
the	O
associative	B-Application
array	I-Application
are	O
often	O
used	O
.	O
</s>
<s>
There	O
are	O
two	O
senses	O
of	O
an	O
ordered	O
dictionary	B-Application
:	O
</s>
<s>
This	O
is	O
the	O
case	O
for	O
tree-based	O
implementations	O
,	O
one	O
representative	O
being	O
the	O
container	B-Application
of	O
C++	B-Language
.	O
</s>
<s>
This	O
is	O
the	O
case	O
for	O
the	O
"	O
ordered	O
dictionary	B-Application
"	O
in	O
.NET	B-Application
Framework	I-Application
,	O
the	O
LinkedHashMap	O
of	O
Java	B-Language
and	O
Python	B-Language
.	O
</s>
<s>
The	O
latter	O
sense	O
of	O
ordered	O
dictionaries	B-Application
is	O
more	O
commonly	O
encountered	O
.	O
</s>
<s>
They	O
can	O
be	O
implemented	O
using	O
an	O
association	B-Data_Structure
list	I-Data_Structure
,	O
by	O
overlaying	O
a	O
doubly	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
on	O
top	O
of	O
a	O
normal	O
dictionary	B-Application
,	O
or	O
by	O
moving	O
the	O
actual	O
data	O
out	O
of	O
the	O
sparse	O
(	O
unordered	O
)	O
array	B-Data_Structure
and	O
into	O
a	O
dense	O
insertion-ordered	O
one	O
.	O
</s>
<s>
Associative	B-Application
arrays	I-Application
can	O
be	O
implemented	O
in	O
any	O
programming	O
language	O
as	O
a	O
package	O
and	O
many	O
language	O
systems	O
provide	O
them	O
as	O
part	O
of	O
their	O
standard	O
library	O
.	O
</s>
<s>
In	O
some	O
languages	O
,	O
they	O
are	O
not	O
only	O
built	O
into	O
the	O
standard	O
system	O
,	O
but	O
have	O
special	O
syntax	O
,	O
often	O
using	O
array-like	O
subscripting	O
.	O
</s>
<s>
Built-in	O
syntactic	O
support	O
for	O
associative	B-Application
arrays	I-Application
was	O
introduced	O
in	O
1969	O
by	O
SNOBOL4	B-Application
,	O
under	O
the	O
name	O
"	O
table	O
"	O
.	O
</s>
<s>
TMG	B-Application
offered	O
tables	O
with	O
string	O
keys	O
and	O
integer	O
values	O
.	O
</s>
<s>
MUMPS	B-Language
made	O
multi-dimensional	O
associative	B-Application
arrays	I-Application
,	O
optionally	O
persistent	O
,	O
its	O
key	O
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
SETL	B-Language
supported	O
them	O
as	O
one	O
possible	O
implementation	O
of	O
sets	O
and	O
maps	O
.	O
</s>
<s>
Most	O
modern	O
scripting	O
languages	O
,	O
starting	O
with	O
AWK	B-Application
and	O
including	O
Rexx	B-Language
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Tcl	B-Operating_System
,	O
JavaScript	B-Language
,	O
Maple	B-Language
,	O
Python	B-Language
,	O
Ruby	B-Language
,	O
Wolfram	B-Language
Language	I-Language
,	O
Go	B-Application
,	O
and	O
Lua	B-Language
,	O
support	O
associative	B-Application
arrays	I-Application
as	O
a	O
primary	O
container	B-Application
type	O
.	O
</s>
<s>
In	O
many	O
more	O
languages	O
,	O
they	O
are	O
available	O
as	O
library	B-Library
functions	I-Library
without	O
special	O
syntax	O
.	O
</s>
<s>
In	O
Smalltalk	B-Application
,	O
Objective-C	B-Language
,	O
.NET	B-Application
,	O
Python	B-Language
,	O
REALbasic	B-Application
,	O
Swift	B-Application
,	O
VBA	B-Language
and	O
Delphi	B-Language
they	O
are	O
called	O
dictionaries	B-Application
;	O
in	O
Perl	B-Language
,	O
Ruby	B-Language
and	O
Seed7	B-Language
they	O
are	O
called	O
hashes	B-Error_Name
;	O
in	O
C++	B-Language
,	O
Java	B-Language
,	O
Go	B-Application
,	O
Clojure	B-Language
,	O
Scala	B-Application
,	O
OCaml	B-Language
,	O
Haskell	B-Language
they	O
are	O
called	O
maps	O
(	O
see	O
map	O
(	O
C++	B-Language
)	O
,	O
unordered_map	O
(	O
C++	B-Language
)	O
,	O
and	O
)	O
;	O
in	O
Common	B-Language
Lisp	I-Language
and	O
Windows	B-Application
PowerShell	I-Application
,	O
they	O
are	O
called	O
hash	B-Algorithm
tables	I-Algorithm
(	O
since	O
both	O
typically	O
use	O
this	O
implementation	O
)	O
;	O
in	O
Maple	B-Language
and	O
Lua	B-Language
,	O
they	O
are	O
called	O
tables	O
.	O
</s>
<s>
In	O
PHP	B-Application
,	O
all	O
arrays	O
can	O
be	O
associative	O
,	O
except	O
that	O
the	O
keys	O
are	O
limited	O
to	O
integers	O
and	O
strings	O
.	O
</s>
<s>
In	O
JavaScript	B-Language
(	O
see	O
also	O
JSON	B-General_Concept
)	O
,	O
all	O
objects	O
behave	O
as	O
associative	B-Application
arrays	I-Application
with	O
string-valued	O
keys	O
,	O
while	O
the	O
Map	O
and	O
WeakMap	O
types	O
take	O
arbitrary	O
objects	O
as	O
keys	O
.	O
</s>
<s>
In	O
Lua	B-Language
,	O
they	O
are	O
used	O
as	O
the	O
primitive	O
building	O
block	O
for	O
all	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
In	O
Visual	B-Application
FoxPro	I-Application
,	O
they	O
are	O
called	O
Collections	O
.	O
</s>
<s>
The	O
D	B-Application
language	I-Application
also	O
has	O
support	O
for	O
associative	B-Application
arrays	I-Application
.	O
</s>
<s>
Many	O
programs	O
using	O
associative	B-Application
arrays	I-Application
will	O
at	O
some	O
point	O
need	O
to	O
store	O
that	O
data	O
in	O
a	O
more	O
permanent	O
form	O
,	O
like	O
in	O
a	O
computer	B-Operating_System
file	I-Operating_System
.	O
</s>
<s>
A	O
common	O
solution	O
to	O
this	O
problem	O
is	O
a	O
generalized	O
concept	O
known	O
as	O
archiving	O
or	O
serialization	B-Application
,	O
which	O
produces	O
a	O
text	O
or	O
binary	O
representation	O
of	O
the	O
original	O
objects	O
that	O
can	O
be	O
written	O
directly	O
to	O
a	O
file	O
.	O
</s>
<s>
This	O
is	O
most	O
commonly	O
implemented	O
in	O
the	O
underlying	O
object	O
model	O
,	O
like	O
.Net	B-Application
or	O
Cocoa	O
,	O
which	O
includes	O
standard	O
functions	O
that	O
convert	O
the	O
internal	O
data	O
into	O
text	O
form	O
.	O
</s>
<s>
The	O
program	O
can	O
create	O
a	O
complete	O
text	O
representation	O
of	O
any	O
group	O
of	O
objects	O
by	O
calling	O
these	O
methods	O
,	O
which	O
are	O
almost	O
always	O
already	O
implemented	O
in	O
the	O
base	O
associative	B-Application
array	I-Application
class	O
.	O
</s>
<s>
For	O
programs	O
that	O
use	O
very	O
large	O
data	O
sets	O
,	O
this	O
sort	O
of	O
individual	O
file	O
storage	O
is	O
not	O
appropriate	O
,	O
and	O
a	O
database	B-Application
management	I-Application
system	I-Application
(	O
DB	O
)	O
is	O
required	O
.	O
</s>
<s>
Some	O
DB	O
systems	O
natively	O
store	O
associative	B-Application
arrays	I-Application
by	O
serializing	B-Application
the	O
data	O
and	O
then	O
storing	O
that	O
serialized	O
data	O
and	O
the	O
key	O
.	O
</s>
<s>
These	O
key	B-Data_Structure
–	I-Data_Structure
value	I-Data_Structure
stores	I-Data_Structure
have	O
been	O
used	O
for	O
many	O
years	O
and	O
have	O
a	O
history	O
as	O
long	O
as	O
that	O
as	O
the	O
more	O
common	O
relational	B-Application
database	I-Application
(	O
RDBs	O
)	O
,	O
but	O
a	O
lack	O
of	O
standardization	O
,	O
among	O
other	O
reasons	O
,	O
limited	O
their	O
use	O
to	O
certain	O
niche	O
roles	O
.	O
</s>
<s>
RDBs	O
were	O
used	O
for	O
these	O
roles	O
in	O
most	O
cases	O
,	O
although	O
saving	O
objects	O
to	O
a	O
RDB	O
can	O
be	O
complicated	O
,	O
a	O
problem	O
known	O
as	O
object-relational	B-Architecture
impedance	I-Architecture
mismatch	I-Architecture
.	O
</s>
<s>
After	O
,	O
the	O
need	O
for	O
high-performance	O
databases	B-Application
suitable	O
for	O
cloud	B-Architecture
computing	I-Architecture
and	O
more	O
closely	O
matching	O
the	O
internal	O
structure	O
of	O
the	O
programs	O
using	O
them	O
led	O
to	O
a	O
renaissance	O
in	O
the	O
key	B-Data_Structure
–	I-Data_Structure
value	I-Data_Structure
store	I-Data_Structure
market	O
.	O
</s>
<s>
These	O
systems	O
can	O
store	O
and	O
retrieve	O
associative	B-Application
arrays	I-Application
in	O
a	O
native	O
fashion	O
,	O
which	O
can	O
greatly	O
improve	O
performance	O
in	O
common	O
web-related	O
workflows	O
.	O
</s>
