Database / Mnesia basics Interview questions
How do you change a table's storage type at runtime?
mnesia:change_table_copy_type/3 converts a table's storage type on a given node while the
system stays live — for example, promoting a ram_copies table to disc_copies
once you decide it needs durability, without dropping and recreating it.
mnesia:change_table_copy_type(person, node(), disc_copies).
This is a schema-level operation, so it's typically run once, deliberately, rather than as part of regular
application logic. It doesn't move or duplicate data across nodes by itself — it changes how the copy on
the specified node is persisted; adding an entirely new node as a replica is a separate operation handled by
mnesia:add_table_copy/3.
More Related questions...