Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This article mostly addresses transaction isolation from the correctness point of view, rather than the tradeoff between semantics and performance.

Higher isolation levels add read locks that can block concurrent transactions. That's the biggest practical reason everyone doesn't use serializable, but this practical guide doesn't really address it. There's not much discussion of the gotchas whereby you can accidentally break concurrency in an application.

For example there are somewhat surprising sources of contention, e.g. adding rows with foreign keys adds locks to the rows being referenced in foreign table, to stop them getting deleted. Or consider gap locks in queries with range predicates.

IMO the guide is mostly theoretical / introductory rather than practical. It's an OK starting point for someone who knows almost nothing about databases that are being used as shared state for a concurrent application.



> Higher isolation levels add read locks that can block concurrent transactions.

Not in postgres. REPEATABLE READ doesn't add any locks, and SERIALIZABLE adds locks, but they're optimistic. So blocking isn't something you're going to see - the relevant thing to measure is going to be the rate of transactions being rolled back due to serialization failures.


Sure, but the article isn't about postgres.


> Sure, but the article isn't about postgres.

Indeed. But your point was:

> Higher isolation levels add read locks that can block concurrent transactions.

Which isn't generally true, given the example of postgres.


> Higher isolation levels add read locks that can block concurrent transactions.

Not in Oracle they don't. Reads in Oracle never block. You could argue that what Oracle calls serializable is in fact only snapshot isolation.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: