0% completed
Optimistic vs. Pessimistic Concurrency Control
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
- Transaction Execution: A transaction reads data and makes changes locally without acquiring locks.
- Validation Phase: Before committing, the database checks if any conflicts occurred (e.g., if another transaction modified the same data).
- Commit or Rollback:
- If no conflicts are detected, the transaction commits.
.....
.....
.....
Parth Sorathiya
· a year ago
Git (version control system) – allows concurrent edits to the same files and resolves conflicts when pushing changes. Git actually uses a form of optimistic concurrency control to manage changes from multiple developers working on the same repository. Developers don’t lock files when working on them, allowing them to freely commit changes. Only when they attempt to push their changes to a shared repository does Git check for potential conflicts.
Collaborative platforms like Google Docs – allow simultaneous document editing and resolve conflicts at synchronization.