Database / Mnesia intermediate to advanced Interview questions
How does Mnesia's schema interact with OTP release upgrades (appup/relup)?
A release upgrade's appup instructions describe how to hot-swap module code and transform
running gen_server state via code_change/3, but Mnesia's schema and table data live outside that
per-process state entirely — changing a Mnesia record's shape isn't something code_change/3
touches, since it's stored data, not process memory.
flowchart TD
A[Release upgrade begins] --> B[appup: hot-swap module code]
B --> C[code_change/3: transforms gen_server process state]
C --> D{Mnesia table shape also changing?}
D -->|Yes| E[Separate step: mnesia:transform_table/3 run explicitly]
D -->|No| F[Upgrade complete, no table changes needed]
If a release upgrade also needs to change a table's record shape, that has to be handled as an explicit,
separate step — typically calling mnesia:transform_table/3 as part of the upgrade
procedure (often triggered from an application's own upgrade callback) — rather than something the
standard relup/appup machinery does for you automatically.
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...
