Database / Mnesia basics Interview questions
What is mnesia:dirty_read/1?
mnesia:dirty_read({Table, Key}) fetches matching records directly, without opening a
transaction or taking any lock — it's the fastest way to read a single record when you don't need the
consistency guarantees a transaction provides.
mnesia:dirty_read({person, 1}). %% -> [#person{id = 1, name = "Ada", age = 34}]
Unlike mnesia:read/1, it can be called directly from anywhere in your code without wrapping it
in mnesia:transaction/1 first, and it returns the raw list of matching records rather than an
{atomic, ...}-wrapped tuple. The tradeoff is that it can read a value mid-update on a replicated
table if another node is writing at the same instant, since there's no lock coordinating the two.
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...
