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

Serializable mode is only useful in low throughput cases. You take a big performance hit and can easily have a bunch of queries waiting one each other until the queue fills up. I haven't used it in forever, I just make sure my stuff works with the default isolation mode. You also can't slap it on like a band-aid for unsure users. The DB client has to implement retry logic, which most Postgres libs don't seem to have, and the code has to careful not to cause side effects inside the retriable area.

Spanner and some other DBMSs are fully serializable always. They do a better job of that than Postgres, I guess cause they focus on it, but they're still a lot slower in the end.

What would be cool is some extension to watch your non-serializable transactions for concurrency anomalies like 1% of the time and use that tiny sample to alert you of race conditions. Like a thread sanitizer does for code. Does that exist??



Yes you take the performance hit, but many workloads are low enough throughput for it to be completely fine.

I’m not sure how you could detect such anomalies though without running the same serialization checking logic within postgres


Actually I agree. There are probably lots of low-throughput, high-consequence things like that.

For the sampling, you'd have to run the same logic. The idea is just to do it infrequently as to not totally ruin your overall performance. Idk if this would work.


It’s definitely an interesting idea, I wonder if it’s easy to implement such a thing.




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

Search: