Database / Mnesia basics Interview questions
What is disc_only_copies and when would you use it?
disc_only_copies keeps a table's data purely on disk (backed by DETS), with no full in-memory
copy the way ram_copies and disc_copies maintain — every read and write goes
through disk I/O rather than being served from RAM.
mnesia:create_table(archive_log, [{disc_only_copies, [node()]}, {attributes, [id, timestamp, payload]}]).
It's the right choice specifically when a table's data is too large to comfortably fit in the available
RAM across your nodes, and you're willing to accept slower access in exchange for not needing that much
memory. For most tables where the dataset is a reasonable size, disc_copies (memory-backed with
disk durability) gives better performance with the same durability guarantee, making
disc_only_copies a deliberate, size-driven tradeoff rather than a general-purpose default.
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...
