ETS and DETS Flashcards

1
Q

describe the differences between ETS and DETS

A

Data stored in an ETS table is stored in RAM and is transient. The data will be deleted when the ETS table is disposed of or the owning Erlang process terminates. Data stored in DETS tables is persistent and should survive an entire system crash. When a DETS table is opened, it is checked for consis- tency. If it is found to be corrupt, then an attempt is made to repair the table (which can take a long time since all the data in the table is checked).

Because DETS uses disk storage, it is far slower than ETS but will have a much smaller memory footprint when running.

ETS tables are not garbage collected; this means there are no garbage collection penalties involved in using extremely large ETS tables

ETS tables are stored in a separate storage area that is not associated with normal process memory. An ETS table is said to be owned by the process that created it—when that process dies or when ets:delete is called, then the table is deleted. ETS tables are not garbage collected, which means that large amounts of data can be stored in the table without incurring garbage collection penalties.

DETS tables have different sharing properties from ETS tables. When a DETS table is opened, it must be given a global name. If two or more local processes open a DETS table with the same name and options, then they will share the table. The table will remain open until all processes have closed the table (or crashed).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly