4 ms·
I’m not really familiar with the trade offs of modes with Postgres but why isn’t Serializable necessary?
by emptysea 3y ago
I’m not really familiar with the trade offs of modes with Postgres but why isn’t Serializable necessary?
- hot_gril 3y agoThe default read-committed is good enough for most use cases, explained in https://www.postgresql.org/docs/current/transaction-iso.html https://www.postgresql.org/docs/current/transaction-iso.html (search "it is just right for simpler cases"). If somehow you've designed a schema that causes race conditions in the default mode, you're probably better off changing your design than you are switching modes. Serializable mode uses some kind of optimistic concurrency, where your transaction might get halfway through then fail because of a conflict with another one, which also fails. Then you have to do retry + random backoff on the client side. Spanner does something similar. Problem with Postgres serializable mode is it's slow and won't scale well if many readers/writers are touching the same data. I get it if this answer isn't satisfying. Partial ACID is worrisome, and full ACID is expensive.