Locking waits on conflicts while MVCC reads choose versions.

highlighted = computed this step

Locks vs versions

Locking and versioning are different concurrency-control mechanisms. A conflicting lock request can wait; an MVCC read chooses a committed version from its snapshot. Note: this lesson compares mechanism only.

mechanism contrast\text{mechanism contrast}

Blocking versus snapshot choice

The lock example has 1 wait-for edge, while the MVCC example has 2 snapshot reads. Note: the two renders show mechanism only.

edges=1,reads=2\text{edges}=1,\quad \text{reads}=2

2PL and MVCC are exact protocol traces on tiny schedules; real lock managers, deadlock avoidance/timeouts, version garbage-collection, and isolation-level tuning are beyond these traces - no product claims.

Lock waititemmodeholderswaitersAST1T2:X deadlock: noT1T2
MVCC snapshotsitemversionvaluewritercommitTsAv11T110Av22T220 snapshot readsreaderitemstartTsseesvalueR15A15v11R25A25v22

Summary

Both mechanisms preserve consistency by applying exact rules to tiny traces. Note: 2PL and MVCC are exact protocol traces here; real lock managers, timeouts, garbage collection, and isolation tuning are beyond these traces.

mechanism contrast\text{mechanism contrast}