~/talk

Django Transactions: Past, Present, and Future

Talkat DjangoCon AU 2014 · on Friday, 2014-08-01· [databases]
slides:none on file

Advocates switching Django apps to PostgreSQL and using the built-in atomic blocks for per-view commits, warns that long transactions hold locks and that PG restore runs inside a single transaction so Postgres has no rollback buffer, recommends enabling serializable (Postgres 9.1+) as a default to catch subtle races and to handle serialization failures by retrying the transaction, describes Xact and savepoint quirks, and says avoid leaving transactions open or calling external services inside them.

AI-written summary · about

  1. 0:00Start
  2. 2:35What is a transaction?
  3. 4:06The good news...
  4. 5:00Sessions and transactions.
  5. 5:43A brief history of Django transactions.
  6. 6:49Transaction Middleware!
  7. 8:38Break out the decorators!
  8. 13:38Batch the writes together.
  9. 14:19Keep transactions short.
  10. 16:02Feeling isolated?
  11. 16:34Isolation Modes.
  12. 18:38READ COMMITTED, redux.
  13. 19:10REPEATABLE READ
  14. 20:53What happens?
  15. 21:25What do we do then?
  16. 23:41SERIALIZABLE.
  17. 25:07Example of write skew.
  18. 25:36Oops.
  19. 26:11SERIALIZABLE prevents this
  20. 27:08My advice? Use it.
  21. 27:49Accept or reject?
  22. 28:35Setting by default.
  23. 28:52Some exceptions.
  24. 30:47PostgreSQL detects deadlocks.
  25. 31:26Avoiding deadlocks.
  26. 31:57INSERT over UPDATE.
~/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.