Database Concurrency & Scaling interview question · Most asked

What's the difference between Read Committed and Repeatable Read in practice?

Summary

Read Committed gives each statement a fresh view of committed data; Repeatable Read gives the whole transaction one snapshot. Multi-statement reports can see inconsistent data under Read Committed.

Longer Answer

  • Postgres defaults to Read Committed; its Repeatable Read is snapshot isolation and raises serialization errors when a concurrently updated row is written.
  • MySQL InnoDB defaults to Repeatable Read; plain reads use a snapshot, but locking reads and UPDATEs see the latest data — so read-modify-write can still lose updates.
  • Neither prevents write skew; that needs locks, constraints or SERIALIZABLE.

Use Repeatable Read (read-only) for consistent reports; set isolation explicitly when correctness depends on it.

Key Points

  • RC: per-statement snapshot
  • RR: per-transaction snapshot
  • Different defaults in Postgres and MySQL
  • Neither stops write skew

Deep dive: Isolation Levels in Postgres vs MySQL

More most-asked Database Concurrency & Scaling questions

← All Database Concurrency & Scaling questions