Home

dets

DETS, short for Disk Erlang Term Storage, is a simple on-disk storage facility shipped with the Erlang runtime. It provides persistent storage for Erlang terms by exposing a table-like API similar to ETS, but backed by a file on disk.

A DETS table stores records as key-value pairs (key, value). You open a file to hold the

DETS is intended for lightweight persistence and small datasets. It is not designed for high-concurrency workloads

DETS is commonly used for simple configuration data, caches, or temporary persistence in small applications or

See also Mnesia, ETS, Erlang, OTP.

table
with
dets:open/2,
and
then
perform
operations
such
as
dets:insert/2,
dets:lookup/2,
and
dets:delete/2.
The
API
is
designed
to
be
straightforward
and
conceptually
similar
to
ETS,
enabling
familiar
patterns
while
persisting
data
between
runs.
or
large-scale
deployments.
It
lacks
the
richer
transactional
options
of
Mnesia
and
is
generally
slower
than
in-memory
ETS
for
frequent
reads.
Because
the
table
is
persisted
on
disk,
proper
file
open/close
handling
is
required
to
ensure
data
integrity;
abrupt
termination
can
leave
the
file
in
an
inconsistent
state
unless
the
table
is
closed
properly.
during
prototyping.
For
robust,
multi-node
or
high-volume
storage,
Erlang's
Mnesia
or
external
databases
are
recommended.