# Erlang Level 9: State & Storage

> Level 9: State & Storage of the LoWisa Erlang course: ETS, DETS and Mnesia Concepts, Concurrent State Design. 3 lessons and 9 ideas, each explained in one line.

State & Storage is level 9 of 17 of the [LoWisa Erlang course](/courses/erlang/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## ETS

- **ETS tables.** **ETS** is in-memory term storage: millions of reads per second, owned by a process, surviving it optionally.
- **Table types.** Tables come as set, ordered_set and **bag**: key semantics chosen per table.
- **Concurrent access.** ETS reads run **concurrently** across schedulers: the shared-data escape hatch that stays safe.

## DETS and Mnesia Concepts

- **DETS.** **DETS** persists ETS-style tables to disk: bounded, simple, honest about its limits.
- **Mnesia.** **Mnesia** is Erlang’s built-in distributed database: transactions and replication over Erlang terms.
- **Choosing storage.** Choose by need: ETS for speed, DETS for simple persistence, Mnesia for **replicated** state: externals beyond.

## Concurrent State Design

- **Process-owned state.** Default design: state lives **inside** a process: serialised access by mailbox, no locks.
- **ETS for hot reads.** When thousands read one dataset, a process bottlenecks: **ETS** serves hot reads beside an owning writer.
- **Ownership and heirs.** ETS tables die with their owner unless an **heir** is named: state lifetime designed, not assumed.

## Before and after this level

- **Before:** [Level 8: OTP Applications](/courses/erlang/level-8-otp-applications/): Applications, Configuration, Dependencies and Releases.
- **Next:** [Level 10: Distributed Erlang](/courses/erlang/level-10-distributed-erlang/): Nodes, Distributed Messaging, Clustering and Network Failure.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Erlang Level 9: State & Storage cover?

ETS, DETS and Mnesia Concepts, Concurrent State Design: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 8: OTP Applications, which covers Applications, Configuration, Dependencies and Releases.

## Learn Erlang on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/erlang/level-9-state-and-storage/ · Updated 2026-11-25
