Table of contents

mnesia

%3 cluster_e2465496_3f87_4d55_80b2_1c6284aab7c3 mnesia cluster_893e5a6c_8e10_4006_8f6e_41ec90929fae Reference manual cluster_65b35210_e667_4245_a932_f6b5dabd9a5a Chapter 4 :: Transactions and contexts _8e8926e8_4967_4d12_b0c8_c9885ca38396 Mnesia consumption _d9f56aff_16cb_4a32_a62b_f5fff78b97bc Implementation details _9635d238_ffb7_4d53_8703_2838111ea62a Dirty operations _87b0bc4c_2a97_43a8_ae41_e2db587f01f1 async_dirty vs sync_dirty _d542f0ab_2ba6_4be5_99ca_4511c8fd4c34 WhatsApp Scaling _f0dec2bf_20ec_4970_9f30_45f85d18ab6a Erlang _9f749a2d_475b_47b4_99c9_5df96496057d Databases __0:cluster_e2465496_3f87_4d55_80b2_1c6284aab7c3->_f0dec2bf_20ec_4970_9f30_45f85d18ab6a __1:cluster_e2465496_3f87_4d55_80b2_1c6284aab7c3->_9f749a2d_475b_47b4_99c9_5df96496057d

Reference manual

Chapter 4 :: Transactions and contexts

Dirty operations

Contrast with ACID

  • The atomicity and the isolation properties of Mnesia are lost.

  • The isolation property is compromised, because other Erlang processes, which use transaction to manipulate the data, do not get the benefit of isolation if dirty operations simultaneously are used to read and write records from the same table.

async_dirty vs sync_dirty

The difference is that (in sync_dirty) the operations are performed synchronously. The caller waits for the updates to be performed on all active replicas. Using mnesia:sync_dirty/1,2 is useful in the following cases:

  • When an application executes on several nodes and wants to be sure that the update is performed on the remote nodes before a remote process is spawned or a message is sent to a remote process.

  • When an application performs frequent or voluminous updates that can overload Mnesia on the nodes.

So, async_dirty for pure reads, synd_dirty for frequent, but fast writes? Not sure...

DONE

Mnesia consumption

webarchived

A table may have indices. Each index is represented as a table itself. In an
index table, tuples of {Attribute, PrimaryKey} are stored.
  • Disk consumption

If the same disk resident record is updated over and over again it becomes
really important to configure Mnesia to dump the transaction log rather
frequently, in order to reduce the disk consumption.