News for hackers. Stuff that matters.
Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @11:45AM (#21621517)
You really don’t need to know transaction isolation to do the vast majority of work on a typical web app.
Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @11:59AM (#21621636)
It can seem that way, but the consequence of not knowing them is lots of subtle race conditions. Granted, most webapps probably don't have enough users to trigger them too often, and the impact is often limited e.g. because the kinds of inconsistencies you can introduce don't actually matter that much in many cases.

For the majority of webapps, I'm not sure the default isolation level of MySQL and Postgres is an appropriate tradeoff, since I'd rather have correctness by default than performance by default.

Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @12:13PM (#21621743)
The vast majority of work on web apps is probably writing CRUD controller methods, proxies to upstream services, or React components. It’s like saying CSS transitions are vital; they aren’t, but probably affect the user experience for the average Joe just as much if not more than a phantom read.

At that level of depth you just hand it over to the CSS champ or the DB champ.

Re:Today’s Top Tech Skills by vsareto on Sunday November 24, 2019 @12:20PM (#21621791)
>At that level of depth you just hand it over to the CSS champ or the DB champ.

Developers are blaming other developers for not knowing everything they do because businesses forced them to learn everything (Fullstack), but that's actually a bad arrangement and somehow the solution is to just punish the developers more rather than hiring DBAs.

Re:Today’s Top Tech Skills by vageli on Sunday November 24, 2019 @12:36PM (#21621907)
> >At that level of depth you just hand it over to the CSS champ or the DB champ.

> Developers are blaming other developers for not knowing everything they do because businesses forced them to learn everything (Fullstack), but that's actually a bad arrangement and somehow the solution is to just punish the developers more rather than hiring DBAs.

If the organization views developers as cogs or something like a software assembly line, the desire for interchangeable, unspecialized workers seems like a natural consequence.

Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @12:24PM (#21621825)
Sure, as long as the developer knows what they don't know. Race conditions usually don't fall into that category (and neither do potential UX improvements actually).
Re:Today’s Top Tech Skills by giornogiovanna on Sunday November 24, 2019 @11:58PM (#21625580)
The advice I've received is to just set the isolation level to serializable and stick with that until you get performance problems, which you likely won't. If you stick to that advice, I doubt you're going to get "lots of subtle race conditions".
Re:Today’s Top Tech Skills by mpartel on Monday November 25, 2019 @04:35AM (#21626646)
That is good advice that is unfortunately not widely followed in most of the apps I've seen. There's also the caveat that you should be prepared to retry transactions, but for small apps it's probably fine if you don't.
Re:Today’s Top Tech Skills by bradleyjg on Sunday November 24, 2019 @12:34PM (#21621892)
> Granted, most webapps probably don't have enough users to trigger them too often

It isn't purely a matter of number of users. You can have a billion users, but if your access pattern is embarrassingly isolated you are still probably okay. (And sharding is going to work great to boot.)

Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @12:48PM (#21622000)
True, though even a single user triggering two actions quickly can cause issues if unlucky.
Re:Today’s Top Tech Skills by taffer on Sunday November 24, 2019 @11:55AM (#21621599)
I wouldn't say so. Concurrency bugs, like lost updates, can be very subtle and hard to debug, and common databases don't prevent these kinds of bugs by default.
Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @12:00PM (#21621641)
If someone on my team was writing a web app and spending time meddling around with transactions outside of whatever abstraction layer we were using on top of the DB without an incredibly good reason, we'd definitely be having a coaching moment, and if it continued, I'd likely help them find a role with another org where they might be a better fit.

Any quality database abstraction provides fairly simple means to perform transactions.

Re:Today’s Top Tech Skills by coldtea on Sunday November 24, 2019 @12:48PM (#21621998)
>If someone on my team was writing a web app and spending time meddling around with transactions outside of whatever abstraction layer we were using on top of the DB without an incredibly good reason, we'd definitely be having a coaching moment, and if it continued, I'd likely help them find a role with another org where they might be a better fit.

And most people with knowledge of DBs should run, not walk, away from a team that operates like that...

Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @01:26PM (#21622259)
Because if you are writing a fairly standard web app, you don't need this. There isn't the scale to make it important. Software is a very large field, with a wide variety of use cases. Obviously an exchange trading platform is going to have much more focus on these DB issues than a SaaS web app for business that expects at most 5,000-10,000 users at a time. With very few of those user modifying the same records.
Re:Today’s Top Tech Skills by coldtea on Sunday November 24, 2019 @04:18PM (#21623491)
>Because if you are writing a fairly standard web app, you don't need this.

Does the app handle user accounts? Payments? Data editing? Multiple logins into the same account? Then it should handle races and transaction properly...

That said, it's true that they can be rare, and might be less worth it (engineering or time wise) than just letting it go.

For an app with like a few thousands users or internal use, the odds might be small.

But a fairly standard web app might serve 1M, or 10M or 100s of millions of people, and they deserve better.

Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @06:02PM (#21624118)
> deserve better

So less features and slower performance to account for the hypothetical case where someone tries to edit their user account from 50 devices at once over and over again?

> But a fairly standard web app might serve 1M, or 10M or 100s of millions of people

You are talking about less than 0.5% of revenue generating SaaS apps.

Re:Today’s Top Tech Skills by vbezhenar on Sunday November 24, 2019 @12:14PM (#21621754)
Transactions are hard. You can't just abstract it. Those different isolation levels are there for a reason.
Re:Today’s Top Tech Skills by vsareto on Sunday November 24, 2019 @01:18PM (#21622212)
Just slap READ UNCOMMITTED on everything to get your speed back

/s

Re:Today’s Top Tech Skills by ownagefool on Sunday November 24, 2019 @12:16PM (#21621769)
I'd argue you should be aware of the transactions and isolations levels exist, like many things, but having to recite them in an interview situation is a different ballgame.

Otherwise, you end up in the situation where every second person has a different set of pet skills and you can't hire anyone because they need to know all the skills perfectly.

But it depends on what you're doing and your market. I've worked with people who took a pay cuts to go work for FAANG, after several interviews which they've studied for but I've decided it's not really needed when you're just writing a little in house CRUD webapp.