Better understanding of how to work / balance transactional / ACID abilities of mnesia

I'm still trying to deeply understand what can be done with Mnesia, and the answers to these two questions will help a lot.

1) What happens if one process completes an atomic transaction with respect to record X, and in some other process a dirty transaction occurs with the same record. Are ACID properties of the first processes compromised?

2) Is there a way for the same process to store an unprotected (mnesia: transaction / 1) read lock on one row of the table while performing a dirty operation on another table?

+4
source share
1 answer

Isolation guarantees are lost in the database environment, which allows you to perform dirty operations like Mnesia does. Thus, the answer to question 1) yes, the correct transaction process is potentially compromised by a joint dirty operation, and vice versa - a dirty read, for example, can return "old" or even freshly used data, while the danger inherent in dirty records is obvious.

In your second scenario, the answer is yes for two reasons: only the data object that you are using is locked and only your local copy! This, as a rule, is a wonderful and useful thing, and allows simultaneous parallel transactions on other data objects (including other tables).

Documents Erlang Mnesia, Chapter 4

+1
source

Source: https://habr.com/ru/post/1444952/


All Articles