Mnesia
Mnesia is a database that comes bundled with Erlang/OTP. It doesn’t behave like your usual MySQL or PostgreSQL server — it was designed for telecom-grade systems where uptime and low latency matter more than fancy tooling. In short, it keeps data close to the Erlang app, syncs it between nodes, and survives crashes without too much drama.
Core Traits
Aspect | Details |
Platform | Part of Erlang/OTP, runs anywhere Erlang does |
Data model | Mix of relational tables and key/value storage |
Storage options | Memory-only, disk-based, or hybrid |
Features | Transactions, replication, distribution, fault tolerance |
Typical use | Telecom, messaging, real-time systems |
License | Apache 2.0 via Erlang/OTP |
How It’s Actually Used
Most teams don’t “choose” Mnesia in the same way they choose MySQL. It just comes with Erlang, and systems written in Erlang (switches, chat servers, monitoring tools) lean on it because it’s already there. Developers like that it can serve data in milliseconds straight from RAM. Admins appreciate that replication and failover aren’t bolted on later — they’re part of the design from the start.
Deployment Notes
– No installer, it’s already included in Erlang.
– Tables can live fully in RAM for speed, or persist to disk when needed.
– Replication between Erlang nodes is straightforward to configure.
Common Scenarios
– Telecom switches storing subscriber sessions across multiple nodes.
– Messaging apps where high availability is a must.
– Real-time monitoring services that can’t afford downtime.
Weak Spots
Mnesia isn’t a universal database. It doesn’t scale well once datasets get huge, and SQL support is minimal. Outside Erlang ecosystems, it feels out of place. For analytics or heavy reporting, other systems (PostgreSQL, Cassandra) are more suitable.
Quick Comparison
Tool | Distinctive Strength | Best Fit |
Mnesia | Distributed, built-in to Erlang, fast in-memory mode | Erlang-based, real-time systems |
PostgreSQL | General-purpose, feature-rich | Enterprises with varied workloads |
Redis | Ultra-fast key/value in memory | Caching, ephemeral state |
Cassandra | Distributed wide-column DB | Very large datasets across regions |