Grokking Database Fundamentals for Tech Interviews
Ask Author
Back to course home

0% completed

Optimistic vs. Pessimistic Concurrency Control
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Optimistic Concurrency Control (OCC)

OCC assumes that conflicts are rare and allows transactions to execute without restrictions until they are ready to commit. At the commit stage, the system checks for conflicts.

How OCC Works

  1. Transaction Execution: A transaction reads data and makes changes locally without acquiring locks.
  2. Validation Phase: Before committing, the database checks if any conflicts occurred (e.g., if another transaction modified the same data).
  3. Commit or Rollback:
    • If no conflicts are detected, the transaction commits.

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible