Database / Mnesia basics Interview questions
What happens to a disc_copies table when its node restarts?
On restart, Mnesia reads the table's data back from the disk files in the Mnesia directory before the node rejoins the cluster and is considered ready — the in-memory copy is rebuilt from what was durably written to disk, plus replaying any transaction log entries recorded since the last full checkpoint.
sequenceDiagram
participant Node
participant Disk
Node->>Disk: read schema + table files
Disk-->>Node: table data loaded into memory
Node->>Node: replay transaction log since last checkpoint
Node-->>Node: table marked as loaded, ready for use
If this is the only node holding a copy of that table, code trying to use it must wait (typically via
mnesia:wait_for_tables/2) until loading finishes. If other nodes in the cluster already have the
table loaded and running, the restarting node can instead copy the current state from one of them, which is
often faster than reading its own potentially-stale disk copy from scratch.
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...
