Replies: 2 comments 7 replies
-
Do you have concrete data to show it's actually true? To quote Kevin Grittner (Postgres core dev):
This was back when SSI was first implemented in Postgres, and the overhead has only been reduced since then. Likewise, we did not observe a noticeable difference from
EdgeDB clients are designed to automatically retry transaction conflicts. No action on your part is usually needed. Lastly, serializable isolation is actually required by EdgeDB to fix certain anomalies exhibited by complex mutations running concurrently, see #2875 and #2876. |
Beta Was this translation helpful? Give feedback.
-
I have not collected my own data on this; and neither am I an expert on Postgres. The "common knowledge" (take that with a grain of salt) is that SERIALIZABLE requires a lot more locking than READ COMMITTED or SNAPSHOT. The main point of the previous paragraph: dip in performance here is supposed to mean "in concurrent sessions" not "single query execution time".
Benchmarking this kind of stuff is super hard. I don't have hard number that prove the opposite but I also don't think this is a very conclusive benchmark either.
What % of serializable failure did the benchmark get? If that number is low that might indicate it is not representative of the use cases that would be most impacted by SERIALIZABLE. An anecdote: I was working on a kind of busy work dispatching system with Oracle. I had a few transactions that would call for SERIALIZABLE isolation to be correct. When testing, in this scenario transactions would fail with a really high failure rate and needed to be retried. So much that I ended up working around the need for SERIALIZABLE as much as possible and only kept the transactions that were just too annoying to do another way. Final food for thoughts on this topic:
This is a nice feature. It's also a little error-prone because it's easy to miss when devs read the docs too quickly or not at all. Note that "no action required" is nice but the perf hit is there if those happen frequently in your workloads (see my anecdote above).
Absolutely, SERIALIZABLE exists because it's sometimes required. Interestingly #2875 is a consequence of the chosen inheritance strategy and could be avoided by modeling inheritance differently. |
Beta Was this translation helpful? Give feedback.
-
I was going through the docs on the website and read that EdgeDB uses isolation level SERIALIZABLE only.
I was quite surprised:
Given that EdgeDB also prides itself in performance / scalability, this struck me as an odd choice.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions