Database / Mnesia intermediate to advanced Interview questions
What complications arise when merging schemas from two independently-created Mnesia databases?
The core problem is that each database's schema and table content evolved independently, with no shared history — so there's no inherent way for Mnesia to know how to reconcile them. Concretely:
- Key collisions — the same primary key value may exist in both databases referring to completely different logical entities.
- Conflicting table definitions — a table with the same name might have different attributes, storage types, or table types on each side.
- Node name collisions — if both clusters happen to use overlapping node names, they can't simply be connected together without renaming.
- No transactional atomicity across the merge — unlike a normal Mnesia transaction, the merge itself isn't an atomic operation Mnesia coordinates for you.
This is why merges are typically planned as an application-level data migration exercise — exporting, transforming, and importing data deliberately — rather than treated as a database-level operation Mnesia handles automatically.
More Related questions...