Database / Mnesia intermediate to advanced Interview questions
Why does tuning the transaction log dump frequency matter for write-heavy Mnesia workloads?
Every write to a disc_copies table involves appending to a log file, which is cheap, versus
periodically folding that log into the actual on-disk table representation, which is comparatively expensive
(it involves more disk I/O restructuring the actual data file). Dumping too frequently adds overhead directly
in the write path; dumping too rarely means a much larger log to replay if the node crashes or restarts before
the next scheduled dump.
flowchart LR
A[Write] --> B[Append to transaction log - cheap]
B --> C{Log size exceeds dc_dump_limit?}
C -->|Yes| D[Dump log into table data file - expensive]
C -->|No| E[Continue appending]
For genuinely write-heavy systems, this tuning knob is one of the more impactful (and easy to overlook) levers for sustained throughput — getting it wrong in either direction either taxes every write with frequent dumps, or risks a long, disruptive replay window on the next restart if the log has been allowed to grow very large.
More Related questions...