SQL & Relational Databases (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is the difference between Optimistic Concurrency Control (OCC) and Multi-Version Concurrency Control (MVCC)?
senior Levelsql-databasesAdvanced Internals
In Simple Words:
- MVCC: Database engine architecture where updates create new versions of rows, allowing concurrent readers to read consistent snapshots without locking writers.
- OCC: Application-level design pattern using version numbers or timestamps to detect conflicts before committing updates without holding locks during user think-time.