Erlang / Erlang Basics Interview questions
When would you choose Mnesia over ETS?
Reach for Mnesia when data needs to survive beyond a single node, or beyond a single BEAM restart, or must be updated as part of a transaction spanning multiple tables. Reach for plain ETS when the data is node-local, disposable if the node restarts, and speed matters more than durability or cross-node consistency.
| ETS | Mnesia |
| In-memory only, single node. | Optional disk persistence, replicated across cluster nodes. |
| No built-in transactions across keys/tables. | ACID-style transactions across multiple tables. |
| Slightly lower overhead per operation. | Extra overhead for transaction coordination and replication. |
A common pattern is actually using both: ETS as a fast local cache in front of Mnesia's authoritative, replicated copy, refreshing the cache when the underlying data changes.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
