<s>
Mnesia	B-General_Concept
is	O
a	O
distributed	B-Architecture
,	O
soft	B-General_Concept
real-time	I-General_Concept
database	B-Application
management	I-Application
system	I-Application
written	O
in	O
the	O
Erlang	B-Operating_System
programming	I-Operating_System
language	I-Operating_System
.	O
</s>
<s>
It	O
is	O
distributed	B-Architecture
as	O
part	O
of	O
the	O
Open	B-Language
Telecom	I-Language
Platform	I-Language
.	O
</s>
<s>
As	O
with	O
Erlang	B-Operating_System
,	O
Mnesia	B-General_Concept
was	O
developed	O
by	O
Ericsson	O
for	O
soft	B-General_Concept
real-time	I-General_Concept
distributed	B-Architecture
and	O
high-availability	B-General_Concept
computing	O
work	O
related	O
to	O
telecoms	O
.	O
</s>
<s>
It	O
was	O
not	O
intended	O
as	O
a	O
general	O
office-based	O
data	B-General_Concept
processing	I-General_Concept
database	B-Application
management	I-Application
system	I-Application
,	O
nor	O
to	O
replace	O
SQL-based	O
systems	O
.	O
</s>
<s>
Instead	O
Mnesia	B-General_Concept
exists	O
to	O
support	O
Erlang	B-Operating_System
,	O
where	O
DBMS-like	O
persistence	B-Application
is	O
required	O
.	O
</s>
<s>
It	O
has	O
more	O
in	O
common	O
with	O
embeddable	O
DBMS	O
such	O
as	O
Berkeley	B-Language
DB	I-Language
than	O
with	O
any	O
SQL	B-Language
database	I-Language
server	O
.	O
</s>
<s>
This	O
data	O
field	O
may	O
in	O
turn	O
be	O
a	O
tuple	B-Application
containing	O
an	O
Erlang	B-Operating_System
data	O
structure	O
of	O
any	O
complexity	O
.	O
</s>
<s>
Mnesia	B-General_Concept
has	O
three	O
inbuilt	O
table	O
types	O
:	O
ram_copies	O
,	O
disc_copies	O
and	O
disc_only_copies	O
.	O
</s>
<s>
Data	O
resides	O
in	O
memory	O
and	O
table	O
size	O
is	O
limited	O
by	O
available	O
memory	O
and	O
are	O
backed	O
by	O
(	O
erlang	B-Operating_System
term	O
storage	O
)	O
table	O
.	O
</s>
<s>
Disc_copies	O
were	O
backed	O
by	O
tables	O
until	O
30th	O
September	O
2001	O
with	O
the	O
release	O
of	O
Erlang	B-Operating_System
R7B-4	O
.	O
</s>
<s>
Due	O
to	O
limits	O
imposed	O
by	O
,	O
support	O
for	O
other	O
backend	O
plugins	O
was	O
suggested	O
by	O
and	O
these	O
were	O
added	O
to	O
Mnesia	B-General_Concept
.	O
</s>
<s>
Klarna	O
added	O
the	O
LevelDB	B-Language
backend	O
plugin	O
while	O
added	O
the	O
RocksDB	B-Language
backend	O
plugin	O
.	O
</s>
<s>
The	O
database	O
model	O
is	O
relational	B-Architecture
,	O
but	O
is	O
n't	O
what	O
someone	O
familiar	O
with	O
SQL	B-Language
might	O
expect	O
.	O
</s>
<s>
A	O
key	O
feature	O
of	O
Mnesia	B-General_Concept
's	O
high-availability	B-General_Concept
approach	O
is	O
that	O
tables	O
can	O
be	O
reconfigured	O
within	O
a	O
schema	O
and	O
relocated	O
between	O
nodes	O
,	O
not	O
only	O
while	O
the	O
database	O
is	O
still	O
running	O
,	O
but	O
even	O
while	O
write	O
operations	O
are	O
still	O
going	O
on	O
.	O
</s>
<s>
The	O
query	B-Language
language	I-Language
of	O
Mnesia	B-General_Concept
is	O
Erlang	B-Operating_System
itself	O
,	O
rather	O
than	O
SQL	B-Language
.	O
</s>
<s>
It	O
permits	O
easy	O
representation	O
of	O
transactions	O
as	O
a	O
natural	O
feature	O
of	O
Erlang	B-Operating_System
by	O
allowing	O
developers	O
to	O
utilize	O
a	O
single	O
language	O
throughout	O
an	O
application	O
.	O
</s>
<s>
Erlang	B-Operating_System
is	O
a	O
functional	B-Language
language	I-Language
.	O
</s>
<s>
Mnesia	B-General_Concept
builds	O
on	O
this	O
to	O
obtain	O
ACID	O
transaction	B-General_Concept
support	O
.	O
</s>
<s>
The	O
functional	O
block	O
which	O
is	O
run	O
as	O
a	O
transaction	B-General_Concept
is	O
a	O
commonplace	O
Erlang	B-Operating_System
construct	O
called	O
a	O
Functional	O
Object	O
(	O
or	O
Fun	O
)	O
and	O
is	O
called	O
by	O
the	O
single	O
Mnesia	B-General_Concept
statement	O
mnesia:transaction(F )	O
.	O
</s>
<s>
This	O
can	O
lead	O
to	O
clearer	O
source	O
code	O
than	O
the	O
paired	O
BEGIN	O
/	O
COMMIT	O
syntax	O
of	O
SQL	B-Language
,	O
and	O
so	O
avoids	O
its	O
problem	O
of	O
unclosed	O
transactions	O
within	O
a	O
procedure	O
.	O
</s>
<s>
Again	O
as	O
a	O
result	O
of	O
the	O
functional	O
nature	O
of	O
Erlang	B-Operating_System
,	O
nesting	O
transactions	O
is	O
simple	O
.	O
</s>
<s>
General	O
coding	O
style	O
for	O
Mnesia	B-General_Concept
will	O
always	O
use	O
transactions	O
.	O
</s>
<s>
Mnesia	B-General_Concept
forms	O
part	O
of	O
the	O
LYME	B-Application
web	O
application	O
stack	O
.	O
</s>
<s>
This	O
is	O
akin	O
to	O
LAMP	B-Application
,	O
but	O
based	O
on	O
Erlang	B-Operating_System
.	O
</s>
<s>
Implementation	O
in	O
Erlang	B-Operating_System
confers	O
an	O
efficiency	O
benefit	O
because	O
of	O
the	O
use	O
of	O
a	O
single	O
virtual	B-Architecture
machine	I-Architecture
throughout	O
an	O
application	O
.	O
</s>
<s>
LYME	B-Application
makes	O
use	O
of	O
this	O
,	O
since	O
the	O
Yaws	B-Application
web	O
server	O
is	O
also	O
implemented	O
in	O
Erlang	B-Operating_System
.	O
</s>
<s>
Address	B-General_Concept
space	I-General_Concept
is	O
shared	O
(	O
although	O
safely	O
so	O
,	O
under	O
Erlang	B-Operating_System
)	O
between	O
code	O
and	O
data	O
,	O
including	O
Mnesia	B-General_Concept
's	O
table	O
data	O
.	O
</s>
<s>
Mnesia	B-General_Concept
and	O
Erlang	B-Operating_System
were	O
developed	O
by	O
the	O
Ericsson	O
Computer	O
Science	O
Laboratory	O
.	O
</s>
<s>
They	O
have	O
been	O
released	O
as	O
open	B-Application
source	I-Application
software	I-Application
.	O
</s>
<s>
Mnesia	B-General_Concept
is	O
released	O
under	O
a	O
derivative	O
of	O
the	O
Mozilla	B-License
Public	I-License
License	I-License
.	O
</s>
<s>
Since	O
OTP	O
18.0	O
they	O
are	O
published	O
according	O
to	O
the	O
open	O
source	O
Apache	B-Application
License	I-Application
2.0	I-Application
.	O
</s>
<s>
Versions	O
before	O
OTP	O
18.0	O
were	O
published	O
under	O
the	O
open	O
source	O
Erlang	B-Operating_System
Public	O
License	O
.	O
</s>
<s>
Mnesia	B-General_Concept
is	O
also	O
an	O
option	O
embedded	O
within	O
the	O
Erlang-based	O
Jabber	B-Protocol
daemon	O
,	O
ejabberd	B-Protocol
.	O
</s>
