Multiversion concurrency control
My simple understanding of MvCC.
as the names says, it’s for multi concurrency request handling.
it’s the mechanism for handling concurrency on same record(s).
when talking concurrency, lost update always needs to be considered.
Locking: Pessmistic and Optimistic Locking
Pessmistic: avoid race conditions.
Optimistic: allow conflicts happen.
MVCC is kind of Optimistic mechanism.
MVCC provide multi version of data(snapshot) for multi transactions.
in transaction, the visibility of the version-data is depending on the isolation level.
the higher isolation level is, the lower performance.
deadlock cases:
transaction A holds record A waiting record B, transaction B holds record B waiting record A.
make multi records update in same order.
make transaction small, avoid external call. (Transactional-Outbox-Pattern)
Title: Multiversion concurrency control
Author: mjd507
Date: 2024-09-15
Last Update: 2024-09-14
Blog Link: https://mjd507.github.io/2024/09/15/multiversion-concurrency-control/
Copyright Declaration: This station is mainly used to sort out incomprehensible knowledge. I have not fully mastered most of the content. Please refer carefully.