Concurrency Was HARD Until I Learned These 16 Concepts: From Hardware & Threads to Distributed Systems
Master engineering guide to the 16 core concurrency concepts: Processes vs Threads, Race Conditions, Mutexes, Deadlocks (Coffman), CAS, Thread Pools (Little's Law), Event Loops, Database Pessimistic/Optimistic Locks, Distributed Locks, and Fencing Tokens.
Debit Posting
Deep-dive into core banking debit posting — ledger mechanics, memo vs. hard post, balance contention, idempotency, locking strategies, saga compensation, and production Java/Spring implementation patterns.
Handling Contention
Strategies for dealing with race conditions, concurrent writes, hot spots, and lock contention in distributed systems including optimistic locking, MVCC, distributed locks, and queue-based serialization.
Optimistic vs Pessimistic Locking: Lock Lifespans & Why 'Retry on Conflict' Destroys Flash Sales
Exhaustive analysis of the 5 lock types: version column, SELECT FOR UPDATE, advisory locks, lock columns, and Redis locks; physical lifespans, failure modes, and why optimistic retry storms crush high-contention ticketing systems.
Transactions & Concurrency Control
ACID properties, isolation levels, locking mechanisms, MVCC, deadlocks, and optimistic vs pessimistic concurrency.
What PostgreSQL Locks on UPDATE: In-Place xmax, 4 Row Lock Modes, EvalPlanQual & SSI
Physical engine mechanics of PostgreSQL row locking: how xmax writes locks directly into tuple headers without a lock table, the 4 row lock modes matrix, foreign key collisions, EvalPlanQual rechecks, and why SSI serializable aborts are by design.