Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
You don't need (db) transactions (sage42.org)
3 points by corey_scott on April 1, 2016 | hide | past | favorite | 4 comments


Yes, you really do need transactions.

- 5-6% slower is a small price to pay for correctness. You should be able to "get back" that 5-6% somewhere else.

- This is an exceptionally simple example. What if there are multiple updates, conditionally executed?

- What if your cleanup code fails?

- What if you have a more complex example and your correspondingly more complex cleanup code fails?

- What if your cleanup code for failed cleanup code fails?

- How are you going to write more complex code, with multiple updates conditionally executed, if concurrent activity is changing some of the data you are relying on while you are working on it? In other words, if you bothered to write invariants, they might not hold, even if your code, running in isolation, maintains those invariants.

- Are you giving up on triggers? Triggers may generate updates that aren't even visible in your code. How are you going to back those out?


Certainly a well-played April Fool's joke, with a proper-sounding argument and code examples to boot. The scroll jacking on the site, however, is not funny.


This article was just an April Fool's, relax :)


OK, he got me. He just sounds too much like people who say similar things on days other than April 1.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: