I’ve found this article lacking. Like some other articles in this space, it introduces isolation levels through the lens of the phenomena described in the SQL standard, but I find that there’s a different, more intuitive approach.
I think it’s more tractable to define this problem space starting from the concept of (strict) serializability, which is really a generalization of the concept of thread safety. Every software engineer has an intuitive understanding of it. Lack of serializability can lead to execution-dependent behavior, which usually results in hard-to-diagnose bugs. Thus, all systems should strive towards serializability, and the database can be a tool in achieving it.
Various non-serializable levels of database transaction isolation are relaxations of the serializability guarantee, where the database no longer enforces the guarantee and it’s up to the database user to ensure it through other means.
The isolation phenomena are a useful tool for visualizing various corner cases of non-serializability, but they are not inherently tied to it. It's possible to achieve serializability while observing all of the SQL phenomena. For example, a Kubernetes cluster with carefully-written controllers can be serializable.
The combination of transactions, isolation levels, and MVCC is such a huge undertaking to cover all at once, specially when comparing how it's done across multiple DBs which I attempted here. Always a balance between technical depth, accessibility to people with less experience, and not letting it turn into an hour-long read.
I actually like this article a lot. I do a bit of teaching, and I imagined the ideal audience for this as a smart junior engineer who knows SQL and has encountered transactions but maybe doesn’t really understand them yet. I think introducing things via examples of isolation anomalies (which most engineers will have seen examples of in bugs, even if they didn’t fully understand them) gives the explanation a lot more concreteness than starting with serializability as a theoretical concept as GP is proposing. Sure, strict serializability is a powerful idea that ties all this together and is more satisfying for an expert who already knows this stuff. But for someone who is just learning, you have to motivate it first.
If anything, I’d say it might be better to start with the lower isolation levels first, highlight the concurrency problems that can arise with them, and gradually introduce higher isolation levels until you get to serializability. That feels a bit more intuitive rather than downward progression from serializability to read uncommitted as presented here.
It also might be nice to see a quick discussion of why people choose particular isolation levels in practice, e.g. why you might make a tradeoff under high concurrency and give up serializability to avoid waits and deadlocks.
But excellent article overall, and great visualizations.
Most RDBMSs offer serializable isolation if you need it. Often you don't need it. The downside of using serializable isolation unnecessarily is reduced concurrency and throughput due to increased coordination between transactions.
Still, I think it’s the right default to start with serializable. Then when you have performance issues you can think long and hard about whether relaxed isolation levels will work in a big free way. Better to start with a correct application.
Sybase SQLAnywhere implements (or at least did) strict serialization by taking an exclusive row lock on all rows... which you can imagine scales horribly for a table with a reasonable row count.
I found out the hard way at work. I had assumed it took an exclusive lock on the table level only, the documentation didn't really spell out the details of how it enforced the serialized access.
I changed it to a retry loop which worked fine and was fairly easy to implement all things considered. Not gonna reach for strict serialization again unless I have to.
> (...) separate from the package deliveries for which UPS is known, is primarily a business-to-business enterprise hauling large industrial cargo in big trucks.
"Unit of work performed" is one of those concepts that sounds great in business books or when dealing with repetitive mass-production tasks, but doesn't translate well to creative work like software development or engineering.
From the management side, it's common for teams to get into routines where Fridays are basically lost. It starts with getting into the habit of leaving a little bit early on Fridays. Then people realize that they only have a few hours between lunch and leaving early, so they start checking out right after lunch. Then people realize that if they get in after 9AM on Friday, they don't have many hours to get anything done before lunch, so they don't want to get started on anything that requires focus. Eventually, Fridays are a short, laid-back day at the office where they catch up on stray e-mails before going home.
For those teams, going to a 4x8 workweek has no productivity drop because they weren't doing much on Friday anyway. However, for teams that actually get things done on Friday, going to 4x8 or even 4x10 can start to decrease productivity.
Productivity and hours spent working aren't the only things that matter, though. Going to a 4-day workweek is an easy way to keep employees happy, which is valuable in itself.
Also keep in mind that we aren't great at judging our own productivity. We tend to perceive percentage of busy time as productivity, and a 4-day workweek will naturally have a higher percentage of time occupied by work than a 5-day workweek. This increase in percentage of busy time can mislead people into thinking they're being even more productive on more time-compressed schedules, even if they're putting out less work on an absolute scale.
Frankly, a lot of companies switch to 4-day workweeks because they can get 80-90% of the productivity while offering employees a perk they can't usually get at big companies that pay higher salaries.
And, in the current situation in particular, I'm seeing a lot of groups adopting "no meeting Fridays." Though my experience is that many people sort of hesitate to schedule Friday afternoon meetings in any case. So, yeah, as you say Fridays tend to turn mostly into a clean up any little tasks for this week, come up with a plan for next week, and call it a day. If I'm honest, this tends to describe what I do a lot of the time.
Realistically, all full time employees are paid per work unit. Those who don't deliver the required work units in that time period are eventually managed out.
One unit of work independent of time taken. When you say "no drop in productivity", do you mean you do the same amount of work in 4 days now instead of 5, or that you do 80% of the work you used to do?
If I have an extra-productive day, where I accomplish more in 8 hours than I normally do, I don't expect to get paid more. I'm paid a salary, not per line of code.
The Thread Parent has cut down the hours that they are working, and cut their pay accordingly. But they also happen to be consistently more productive in those hours than they used to be. It wasn't a condition of their cut hours that they are required to work more productively, they just happen to be.
(Yes, ideally a good organization would reward this with a higher monthly pay. But that's a separate issue. I get paid the same as another developer in my position, even if one of us tends to be slightly more productive.)
I agree with you that getting paid the same hourly rate, working less and still maintaining job stability is a win.
It just didn't initially sit right with me when I heard Look at me I'm winning! I used to do five days of work and get paid for five, now I do five days of work and get paid for four.
They were doing four days of work and getting paid for five, now they do four and get paid to do four :)
I also went from 8 hour day to 6 hour day with a cut in pay and no loss in productivity and I feel it was a win. I've enough money either way and a lot more time.
Well, it's obviously a baked in assumption that the employer wants to provide as little remuneration for value as possible without alienating the employee. In theory our compensation is based on some combination of the value we deliver and our negotiating strength. If we deliver the same value in 80% time and take home 80% of the compensation, we've fully left negotiating strength on the table.
Your assumption is that they were doing 5 days worth of work in 5 days, and now they're doing 5 days worth of work in 4. But they're just more productive, they're not busier. So it sounds like before they were doing 4 days worth of work in 5.
I think it really depends on what the work entails. When I’ve worked on some particularly complex problems it’s often the case that I get “zero” days’ work done for four days, then “dozens” of days’ work done in one. My assumption is that a person has a fairly fixed productivity capacity over a given stretch of time, that we as a society tend to organize that as a week of seven days, and that it’s highly likely most people (again depending on the work and the person) reach that capacity in less than five days.
It depends on how much your time is worth to you. If you’ve got nothing better to do than hang out at the office and take it easy on casual Fridays, then you might as well get paid for it.
If, on the other hand, you’d rather go home and put your 3 day weekends to better use taking care of your household, spending time with family, engaging in a hobby, travelling, or relaxing at the cottage (if you don’t own one, you might try renting one), then your Friday is more valuable to you than the money you lose from taking the day off.
This is why I cut out all the political BS and just became a consultant a decade ago. Then you can cut hours and increase your hourly rate to accommodate. Funny enough companies are just fine with paying it.
At a minimum, you need to be reachable and possibly attend meetings. Even if I'm taking a day somewhat easy and running some errands, I'm not going to head off for some 4 hour hike.
They don't want to bloat language with million of rarely used syntax and hard to read features, just as Go devs do. Not to repeat the failure of Scala (and I'm afraid Rust goes the same way).
This sounded too ridiculous to me, so I started digging. Lo and behold, [1]. Appendix 8, sections 2 and 3.
The entire thing is a fun read, with pearls such as:
in the case of an Intel CPU with either the Sandybridge or Ivybridge
chipset where the competitor chooses not to exploit the AVX feature; the
competitor must explicitly declare and be able to demonstrate that they are
not using the AVX feature in the CFD solve process. If the non‐usage of the
AVX feature is proven to the auditor, the Intel Sandybridge and Ivybridge
chipset cores can be rated as 4 FLOP/cycle/core rather than as 8
FLOP/cycle/core.
What stops them from just running simulations at CPUs outside the organization's control? It's not like an engineer can't go to their home computer, open a terminal and SSH to a server, which could be in the opposite corner of the world. Even if all official simulations must be logged, which I suppose will also appear in the rules, running a few rogue simulations and looking at the output will give big hints about which official simulations one should choose to run...
I have connected to supercomputers and ran expensive experiments (not for F1 :)) from all kinds of devices, from phones to borrowed crappy netbooks, and from all kinds of places, like bars, the beach, etc... so I don't understand how that kind of regulations could be enforced unless they physically lock the engineers up for the season.
If you think the level of detail is crazy you need to understand how crazily some teams will cheat.
The details still aren't out yet but Ferrari literally managed to cheat the fuel flow sensor last year - this is probably the most important rule in the sport, for the cars at least.
That would be more efficient, but GPUs were banned to level the playing field between extremely rich and slightly less extremely rich teams.
Of course, the people who made that rule probably just looked at the cost of a GPU vs the cost of a CPU without realizing that per operation GPUs are much cheaper to run.
EDIT: I originally heard this on Reddit and after looking I can't find any real sources, so this could be inaccurate.
You should have a quick read through the document, that's just one rule.
The rules seem mostly focused on computations rather than hardware.
I'm not that familiar with the hardware-level stuff they're talking about, but it seems likely that there are situations where a CPU is preferable to a GPU under these rules.
I think it’s more tractable to define this problem space starting from the concept of (strict) serializability, which is really a generalization of the concept of thread safety. Every software engineer has an intuitive understanding of it. Lack of serializability can lead to execution-dependent behavior, which usually results in hard-to-diagnose bugs. Thus, all systems should strive towards serializability, and the database can be a tool in achieving it.
Various non-serializable levels of database transaction isolation are relaxations of the serializability guarantee, where the database no longer enforces the guarantee and it’s up to the database user to ensure it through other means.
The isolation phenomena are a useful tool for visualizing various corner cases of non-serializability, but they are not inherently tied to it. It's possible to achieve serializability while observing all of the SQL phenomena. For example, a Kubernetes cluster with carefully-written controllers can be serializable.