Skip to content

Comment on Show HN: My experimental take on a decentralized ledgerparent

Comments

In PostgreSQL, you can set the SERIALIZABLE isolation level for the whole database, put a retry loop around all database transactions and completely stop worrying about concurrency issues.

I think all database applications should be written like this at least until performance starts being an issue.

Entirely depends on the the type of workload / application architecture. In some cases the rollback ratios will be massive (I've seen 70%). In other cases adding such a retry loop is unattractive because the latency jitter. Or retaining all involved data for a retry is unattrictive.

Yet Another problem is that you need to enforce all sessions potentially involved in a data race need to use serializable; that can be easy or hard, depending on the scenario.

Use UPSERT, it's correct -and- fast rather than just correct.

Increasing the transaction isolation level shouldn't be done out of laziness.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.