databases
9 minMySQL InnoDB: Transactions, Indexes, and Reading EXPLAIN
Understand InnoDB's clustered primary key, secondary-index lookups, transaction behavior, and practical query-plan analysis.
Loading page...
databases
9 minUnderstand InnoDB's clustered primary key, secondary-index lookups, transaction behavior, and practical query-plan analysis.
Q&A
Q&AAn old transaction snapshot may still need row versions that newer transactions have replaced.
PostgreSQL MVCC keeps row versions visible to active snapshots. A long-running transaction can hold an old snapshot open, so vacuum cannot yet remove some dead versions. Bound transaction lifetimes and investigate idle-in-transaction sessions when table bloat grows.
databases
10 minLearn tables, keys, constraints, joins, transactions, and query shape before choosing a specific database engine.
Q&A
Q&ATwo transactions can read the same invariant and update disjoint rows, so row-level conflicts do not detect the violation.
If each transaction sees a snapshot where another row satisfies a rule, they may update different rows and both commit, leaving the combined invariant false. Use a constraint, lock a shared coordination row, or use serializable isolation with whole-transaction retry. Exact Repeatable Read semantics differ by engine.
java
9 minA transaction is only as good as the boundary you choose. Learn how service-layer design, isolation levels, and idempotent writes affect correctness in Java systems.
Q&A
Q&ARetry the whole idempotent transaction within a bounded policy, not just an arbitrary statement.
A deadlock detector aborts one transaction so another can progress. Capture lock and query evidence, then retry the whole business transaction only if its effects are safe to repeat. Use bounded attempts with jitter, consistent resource ordering, and idempotency for any external side effects.
databases
10 minConnect PostgreSQL's multi-version concurrency control to transaction visibility, vacuum work, index choice, and EXPLAIN output.
distributed systems
9 minLearn why network retries create duplicate effects and how idempotency keys and an outbox close common reliability gaps.