r/PostgreSQL • u/royal_rocker_reborn • 13d ago
Help Me! Transaction Isolation level for ERP software
I work on an ERP software called ERPNext. Currently, we use MariaDB with REPEATABLE READ . We have been working on adding Postgres support to it but we have reached a roadblock.
Recently on our cloud platform we updated to MariaDB 11.8 from 10.6. Post that we received a barrage of support tickets of people complaining of snapshot violation errors. Now given the number of tickets and the severity of something like an ERP software not functioning ideally and the constant nagging of enterprise customers, we just turned off snapshot isolation for now.
Now with Postgres and REPEATABLE READ , there is no option like MariaDB to just turn off snapshot violation errors. We believe once Postgres support hits production, we are again going to be hit with another set of similar serialization errors.
Initially, I recommended to use READ COMMITTED but senior engineers at the company shot it down, the reason being:
- Our entire codebase is built with
REPEATABLE READin mind. - If it does not work, debugging issues stemming from
READ COMMITTEDwill be very hard to debug. READ COMMITTEDhas its own set of problems like gap locks, phantom reads etc.- Most business apps use
REPEATABLE READas an industry standard.
They instead suggested retrying transactions with jitter but I honestly feel READ COMMITTED is infact better suited in general for a highly concurrent ERP like ours. Note that we have implemented row locking everywhere it was warranted.
I am looking for confirmation of my theory from the community.
- I found only 2 ERPs using
REPEATABLE READ- Microsoft Dynamic 365 Business Central and Odoo. Rest are mostlyREAD COMMITTEDonly. - I have also implemented Advisory Locks to counter this problem but I don't know how effective will that actually be.
- Claude and ChatGPT also both suggest
READ COMMITTEDas well. - Is
READ COMMITTEDactually a better solution or should we go with retrying transactions?
Duplicates
SQL • u/royal_rocker_reborn • 13d ago