Database / Mnesia intermediate to advanced Interview questions
What is table fragmentation in Mnesia and why would you use it?
Fragmentation splits a single logical table into multiple physical fragments, each of which can live on a different node (or set of nodes), while application code still addresses it as one table name. It exists for tables whose size or write volume would overwhelm what a single, fully-replicated table (and its associated lock/transaction coordination) can comfortably handle.
flowchart LR
A[Logical table: sessions] --> B[Fragment 1 - nodeA]
A --> C[Fragment 2 - nodeB]
A --> D[Fragment 3 - nodeC]
Records are distributed across fragments based on a hash of the key, so reads/writes for a given key are routed to the fragment that owns it rather than every node needing a full copy of all the data. This trades some added routing complexity for horizontal scalability, letting a dataset (and its write throughput) grow beyond what a single-fragment replicated table could handle.
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...
