4 ms·
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 trigg
by mpartel 7y ago
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.
- jackcodes 7y agoThe 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.
- vsareto 7y ago>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.
- vageli 7y ago> >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.
- mpartel 7y agoSure, 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).
- bradleyjg 7y ago> 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.)
- mpartel 7y agoTrue, though even a single user triggering two actions quickly can cause issues if unlucky.
- giornogiovanna 7y agoThe 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".
- mpartel 7y agoThat 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.