SystemDesign Pro
ProjectsPathsKnowledgebaseAbout
PrivacyTermsRefundsCookiesContact
© 2026 SystemDesign Pro. All rights reserved.
consistencyapi-designconflictsdata-integrity

Optimistic Concurrency Control (OCC)

Detect write conflicts at commit time using versions instead of locking everything up front.

Definition

OCC allows concurrent updates and rejects stale writes when version checks fail.

When To Use
  • High-read, moderate-write workloads with low conflict probability.
  • Collaborative systems where lock contention harms UX.
  • APIs that can return conflict errors and retry safely.
When Not To Use
  • Hot-row workloads with frequent conflicting updates.
  • Flows where retries are expensive or not user-safe.
  • Without explicit versioning (ETag/row version) in write APIs.
Tradeoffs
  • Avoids lock contention, but introduces retry and conflict handling complexity.
  • Higher parallelism under low contention, worse behavior on hotspots.
  • Improves responsiveness, while shifting correctness burden to conflict resolution.
Common Failure Modes
  • Conflict storm under hotspots degrades throughput.
  • Client ignores version mismatch and overwrites newer state.
  • Retry loops amplify load during incidents.
Interview Framing
Use this structure when the interviewer asks for this pattern explicitly.

Explain version field design, 409 conflict semantics, and fallback path for sustained high contention.

Related Project Deep Dives

Collaborative Document Branching System
Design a branching and merging system for real-time collaborative documents with CRDT sync, conflict resolution, and full audit history.
advancedPremium
Feature Flag Evaluation Engine at Scale
Design a low-latency feature flag evaluation system with targeting rules, percentage rollouts, A/B testing integration, kill switches, and multi-region consistency.
intermediateFree
Ticket Booking & Seat Reservation System
Design a high-concurrency ticketing system with seat holds, anti-oversell guarantees, payment flows, and event surge handling.
advancedPremium

Related Concepts

Idempotency Keys
Guarantee repeated client retries do not create duplicate side effects.
Quorum Consistency
Use read/write quorum sizes to balance consistency, availability, and latency in replicated stores.
Saga Pattern
Coordinate multi-service workflows with local transactions and compensating actions.