~/talk

Understanding and Reducing Application Contention

Talkat PGConf NYC 2021 · 2021-12-02..12-03· [databases, frontend-architecture]
slides:none on file

Explains what lock waits, deadlocks and serialization errors are, how to detect them with PG stat activity and pg_locks and by enabling log_lock_waits, and why long transactions and HA (prepared transactions, synchronous replication) enlarge contention windows. Recommends server‑side functions and batching tradeoffs, testing with realistic data and pgbench latency metrics, and highlights a performance comparison showing roughly 16000 vs 1600 transactions in the same 200ms bound for Postgres versus CockroachDB.

AI-written summary · about

  1. 0:00Intro
  2. 2:55How do I know waits are happening now?
  3. 5:01How do I know lock waits happened?
  4. 7:01Batching Transactions
  5. 7:28High Availability
  6. 9:03Frequency of Contention
  7. 13:23Conversational Transactions (with Front End)
  8. 14:07Conversational Transactions (with App Tier)
  9. 14:45Server-side Procedures
  10. 15:58Testing for concurrency
  11. 18:45Deadlock detector
  12. 20:37How do I know deadlocks happened?
  13. 21:29Avoiding deadlocks
  14. 22:21Application Design Anti-Patterns
  15. 25:24Application Design Pattern Tuning (1a)
  16. 27:34Default Transaction Isolation
  17. 29:12Impacts of SERIALIZABLE Transaction Isolation
  18. 30:01Impacts of SERIALIZABLE failures
  19. 31:00Correctness of SERIALIZABLE retry
  20. 32:47e.g. CockroachDB Problems
  21. 34:34Postgres-BDR approaches to xact contention
  22. 36:08CockroachDB vs PostgreSQL Performance
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.