4 ms·
I suggest people use "serializable" by default and relax it carefully on a as-needed basis.
by borplk 9y ago
I suggest people use "serializable" by default and relax it carefully on a as-needed basis.
- malisper 9y agoThat's reasonable. I usually avoid the higher isolation levels because they can cause queries to spontaneously fail. You need to be able to put in the extra work for handling the cases where they fail. If data correctness is an absolute must, you should go with serializable.
- stubish 8y agoI suggest read committed, and increase it to serializable only if necessary. serializable transaction isolation means your code is responsible for catching the serialization exceptions that will occur and handling them (retrying the transaction, generally). Devs just don't do that, and don't even know how to trigger the exceptions in most case. So you end up with apps that work fine during CI and staging, but start failing under load. And it might not be possible to retrofit the correct exception handling without a massive re-architecture.