Database / Mnesia intermediate to advanced Interview questions
When can sticky locks cause a problem in a distributed Mnesia cluster?
A sticky lock optimizes for the common case where the same node keeps writing to a table, but it means lock "ownership" has to be reclaimed if a different node suddenly needs to write — and if the node currently holding the sticky lock has become unreachable (crashed, network partition), reclaiming that lock can take noticeably longer than an ordinary non-sticky lock request would.
flowchart TD
A[NodeB wants to write, lock is sticky to NodeA] --> B{Is NodeA reachable?}
B -->|Yes| C[Lock ownership transferred to NodeB, then proceeds]
B -->|No, NodeA down/partitioned| D[Extra delay reclaiming lock ownership before NodeB can proceed]
This is why sticky locks are a good fit for workloads with a genuinely stable, dominant writer per table, but a poor fit for workloads where write ownership legitimately shifts between nodes frequently — in that case, the overhead of repeatedly reclaiming sticky ownership can end up costing more than the round-trips it was meant to save.
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...
