Database / Mnesia basics Interview questions
What are dirty operations in Mnesia?
Dirty operations (mnesia:dirty_read/1, mnesia:dirty_write/1,
mnesia:dirty_delete/1, and similar) perform a single read or write directly against the table,
bypassing transaction locking and the coordination needed to keep replicated copies perfectly in sync during
the operation.
mnesia:dirty_write(#person{id = 1, name = "Ada", age = 34}), mnesia:dirty_read({person, 1}).
They're significantly faster than their transactional counterparts precisely because they skip that coordination, which makes them a reasonable choice for high-throughput, low-consistency-requirement workloads (a hit counter, a cache-like table) where an occasional inconsistency during a concurrent update or a node failure mid-write is tolerable. They're the wrong choice whenever an operation depends on multiple related writes succeeding together, since dirty operations offer no atomicity across more than one call.
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...
