No privacy policy accessible from provided content; cannot evaluate on-domain.
Terms of Service
—
No terms of service accessible from provided content; cannot evaluate on-domain.
Accessibility
—
No accessibility statement or WCAG compliance information visible in provided content.
Mission
—
Mission statement not present in provided content; commercial SaaS provider focus visible but insufficient for modifier.
Editorial Code
—
No editorial code or standards statement visible in provided content.
Ownership
—
Commercial entity (PlanetScale); ownership structure not disclosed in provided content.
Access Model
0.00
Article 19
Content is publicly accessible without login or payment; blog article freely readable.
Ad/Tracking
-0.10
Article 12
Sentry DSN and IMG CDN configuration visible in window.ENV suggests analytics/monitoring; tracking infrastructure present but not intrusive in blog content itself.
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.
I think this is a great post to have but I'm going to make a critical usability suggestion:
* the videos should have "pause" and a "step at a time" control *
Even at the "half speed", without a deep knowledge of the context, the videos move way too fast for me to read the syntax that's invoking and line it up with the data on the left side. I (and im definitely not the only one) need to be able to sit on one step and stare at the whole thing without the latent anxiety of the state changing before I've had a chance to grok the whole thing.
this has nothing to do with familiarity with the concepts (read my profile). I literally need time to read all the words and connect them together mentally (ooh, just noticed this is pseudo-SQL syntax also, e.g. "select id=4", that probably added some load for me) without worrying they're going to change before watching things move.
A lot of database tools these days prioritize instant sharing of updates over transactions and ACID properties. Example: Airtable. As soon as you update a field the update shows up on your coworkers screen who also has the same table open. The downside of this is that Airtable doesn't do transactions. And the downside of not doing transactions is potentially dangerous data inconsistencies. More about that here: https://visualdb.com/blog/concurrencycontrol/
This actually used to be one of my favorite interview questions for backend engineers. Everyone has used transactions but depending on your seniority you'd understand it to different degrees.
And no I'd never expect people to know the isolation levels by heart, but if you know there are different ones and they behave differntly that's pretty good and tells me you are curious about how things work under the hood.
> At this stage, it has nothing to do with xmin and xmax, but rather because other transactions cannot see uncommitted data
Am I missing something or this statement is incomplete? Also I find the visualization of commit weird, it “points to” the header of the table, but then xmax gets updated “behind the scenes”? Isnt xmax/xmin “the mechanism behind how the database knows what is committed/not committed”? Also, there could be subtransactions, which make this statement even more contradictory?
I enjoyed the visualizations and explanations otherwise, thanks!
Seems like a frequent surprise is that Postgres and MySQL don't default to serializable (so not fully I in ACID). They do read-committed. I didn't see this article mention that, but maybe I missed it. The article says read-committed provides "slightly" better performance, but it's been way faster in my experience. Forget where, but I think they said they chose this default for that reason.
Using read-committed ofc means having to keep locking details in mind. Like, UNIQUE doesn't just guard against bad data entry, it can also be necessary for avoiding race conditions. But now that I know, I'd rather do that than take the serializable performance hit, and also have to retry xacts and deal with the other caveats at the bottom of https://www.postgresql.org/docs/current/transaction-iso.html
Have you ever seen anyone changing transaction isolation levels in code? I think pessimistic or optimistic locking is preferred way to handle transaction concurrency.
I thought this was pretty good, not least because it attempts to explain isolation levels, something I always found pretty tricky when teaching SQL. Mind you, I was only teaching SQL, and so isolation, as part of C and C++ courses so that our clients could do useful stuff, but explaining what levels to use was always tuff.
Is it just me, or are the final results of the deadlock visualisations incorrect? In both animations (mysql/pg), the final `SELECT balance from account...` queries appear to show the result of the two sessions, which have been terminated.
never used planetscale but I’ve always liked their blog, and other content. One of the founders interviewed on the software engineering daily podcast and it was super interesting
> A phantom read is one where a transaction runs the same SELECT multiple times, but sees different results the second time around
> Under the SQL standard, the repeatable read level allows phantom reads, though in Postgres they still aren't possible.
This is bad wording which could lead to an impression that a repeatable read may show different values. Values in rows will be the same but new rows may be added to the second result set. New rows is important as no previously read rows can be either changed or deleted — otherwise there will be no repetition for those rows second time around.
I like to think of transactions, in an MVCC system like Postgres, as being like snapshots in copy-on-write filesystems like btrfs or zfs. When you BEGIN a transaction, the DB takes a snapshot of your data, so now there are two versions of the data, the snapshot (visible to everyone else) and the "private" version visible only to your transaction. Then as you run UPDATEs, the new data is written to the private copy, but everyone else continues to work with the snapshot. (And might be creating their own private copies for other transactions).
If you do a ROLLBACK, then your private copy of the data is discarded, and its changes never make it into the official copy. But if you do a COMMIT, then your private snapshot is made public and is the new, official, copy for everyone else to read from. (Except those who started a transaction before you ran COMMIT: they made their private copies from the older snapshot and don't have a copy of your changes).
This is probably obvious to nearly everyone here, but I figured I'd write it anyway. You never know who might read an analogy like this and have that lightbulb moment where it suddenly makes sense.
P.S. Another analogy would be Git branches, but I'll write that in a different comment.
One way to think about transactions, as I wrote in an earlier comment, would be to think of them as being like snapshots in a copy-on-write filesystem like btrfs or zfs. But another way to think of them is being like Git branches.
When you BEGIN a transaction, you're creating a branch in Git. Everyone else continues to work on the master branch, perhaps making their own branches (transactions) off of it while you're working. Every UPDATE command you run inside the transaction is a commit pushed to your branch. If you do a ROLLBACK, then you're deleting the branch unmerged, and its changes will be discarded without ever ending up in the master branch. But if you instead do a COMMIT, then that's a `git merge` command, and your changes will be merged into the master branch. If they merge cleanly, then all is well. If they do NOT merge cleanly, because someone else merged their own branch (committed their own transaction) that touched the same files that you touched (updated rows in the same table), then the DB will go through the file line by line (go through the table row by row) to try to get a clean merge. If it can successfully merge both changes without conflict, great. If it can't, then what happens depends on the transaction settings you chose. You can, when you start the transaction, tell the DB "If this doesn't merge cleanly, roll it back". Or you can say "If this doesn't merge cleanly, I don't care, just make sure it gets merged and I don't care if the conflict resolution ends up picking the "wrong" value, because for my use case there is no wrong value." This is like using "READ UNCOMMITTED" vs "SERIALIZABLE" transaction settings (isolation levels): you would use "READ UNCOMMITTED" if you don't care about merge conflicts in this particular table, and just want a quick merge. You would use "SERIALIZABLE" for tables with data that must, MUST, be correct, e.g. account balances. And there are two more levels in between for subtle differences in your use case's requirements.
As with my previous comment, this is probably obvious to 98.5% of people here. But maybe it'll help someone get that "ah-ha!" moment and understand transactions better.
Score Breakdown
+0.10
PreamblePreamble
Low P:free_access
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
Preamble values (dignity, equality, peace) not directly addressed. Structural signal: publicly accessible educational content without paywalls supports information accessibility. Minor positive from open knowledge sharing.
+0.10
Article 1Freedom, Equality, Brotherhood
Low P:equal_access
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
No direct editorial treatment of equality/dignity. Structural: free public access to technical education is mild positive for equal information access.
+0.10
Article 2Non-Discrimination
Low P:non_discrimination
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
No discrimination addressed in content. Structural: publicly available educational content without access restrictions based on status, origin, or characteristics is mildly positive.
ND
Article 3Life, Liberty, Security
null
Right to life not addressed; technical database article does not engage with this article.
ND
Article 4No Slavery
null
Slavery and servitude not addressed; not applicable to technical content.
ND
Article 5No Torture
null
Torture and cruel treatment not addressed; not applicable to technical content.
ND
Article 6Legal Personhood
null
Right to recognition before law not addressed; technical article does not engage.
ND
Article 7Equality Before Law
null
Equal protection before law not addressed; not applicable to technical database documentation.
ND
Article 8Right to Remedy
null
Effective remedy for human rights violation not addressed; not applicable to technical content.
ND
Article 9No Arbitrary Detention
null
Arbitrary arrest and detention not addressed; not applicable.
ND
Article 10Fair Hearing
null
Fair and public hearing not addressed; not applicable to technical article.
ND
Article 11Presumption of Innocence
null
Presumption of innocence not addressed; not applicable to technical content.
-0.14
Article 12Privacy
Medium P:privacy_tracking
Editorial
0.00
Structural
-0.10
SETL
+0.10
Combined
ND
Context Modifier
ND
Editorial: no explicit privacy violations mentioned; standard educational content. Structural: Sentry DSN and image CDN tracking infrastructure present in page environment variables; analytics/monitoring systems in use reduce privacy protections. Context modifier: ad_tracking modifier applied. Article 12 right to privacy mildly undermined by observable tracking signals.
+0.16
Article 13Freedom of Movement
Medium A:freedom_of_movement P:no_restrictions
Editorial
+0.20
Structural
+0.10
SETL
+0.14
Combined
ND
Context Modifier
ND
Editorial: no restrictions on movement or residence mentioned; neutral. Structural: content freely accessible, no geographic blocking evident; open access infrastructure supports freedom of information movement. Mild positive from open architecture.
+0.10
Article 14Asylum
Low P:asylum_access
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
Article 14 not editorially addressed. Structural: freely accessible content without national/regional discrimination supports information asylum principle. Mild positive from non-restrictive access.
+0.10
Article 15Nationality
Low P:nationality_neutral
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
Nationality not addressed editorially. Structural: content accessible regardless of nationality supports non-discrimination on this axis.
ND
Article 16Marriage & Family
null
Marriage and family not addressed; not applicable to technical database article.
0.00
Article 17Property
Low P:property_neutral
Editorial
ND
Structural
0.00
SETL
ND
Combined
ND
Context Modifier
ND
Right to property not addressed in content. Structural: article discusses data integrity and ownership concepts abstractly; no editorial position on property rights. Neutral.
+0.10
Article 18Freedom of Thought
Low P:no_restriction
Editorial
ND
Structural
+0.10
SETL
ND
Combined
ND
Context Modifier
ND
Freedom of thought, conscience, religion not addressed editorially. Structural: content accessible to all beliefs/worldviews without filtering supports conscience freedom. Mild positive.
+0.26
Article 19Freedom of Expression
High A:information_sharing P:free_access F:educational
Editorial
+0.30
Structural
+0.20
SETL
+0.17
Combined
ND
Context Modifier
ND
Editorial: explicit educational mission to share knowledge about database concepts; article is structured as technical instruction freely shared. F: framing as accessible knowledge for 'thousands of applications.' Structural: publicly available, no paywall, no registration required, searchable/indexable content supports information freedom. Combined moderate-mild positive from knowledge dissemination.
+0.05
Article 20Assembly & Association
Low P:no_forced_association
Editorial
ND
Structural
+0.05
SETL
ND
Combined
ND
Context Modifier
ND
Freedom of association not explicitly addressed. Structural: content accessible without forced account creation, membership, or association requirement; no coercive structure. Very mild positive.
ND
Article 21Political Participation
null
Political participation not addressed; not applicable to technical blog article.
+0.05
Article 22Social Security
Low P:public_good
Editorial
ND
Structural
+0.05
SETL
ND
Combined
ND
Context Modifier
ND
Social security not directly addressed. Structural: free technical education supports social and economic development as public good. Minimal positive.
ND
Article 23Work & Equal Pay
null
Right to work and fair conditions not addressed in technical content.
ND
Article 24Rest & Leisure
null
Rest and leisure not addressed; not applicable to technical article.
ND
Article 25Standard of Living
null
Adequate standard of living not addressed; not applicable to database technical documentation.
+0.26
Article 26Education
High A:education P:accessible_learning F:technical_literacy
Editorial
+0.30
Structural
+0.20
SETL
+0.17
Combined
ND
Context Modifier
ND
Editorial: explicit educational intent; article designed to teach database fundamentals to developers; supports technical literacy and human development. F: framing as foundational knowledge 'fundamental to how SQL databases work.' Structured with progressive complexity (begin with basics, advance to isolation levels). Structural: free, no prerequisites or access barriers; publicly available educational resource. Combined moderate-mild positive from clear educational mission.
+0.16
Article 27Cultural Participation
Medium A:cultural_knowledge P:shared_culture
Editorial
+0.20
Structural
+0.10
SETL
+0.14
Combined
ND
Context Modifier
ND
Editorial: article shares technical/scientific culture freely; contributes to shared human knowledge base. F: positioned as part of broader database engineering culture. Structural: publicly available contribution to common technical culture. Mild positive from knowledge sharing and cultural participation.
+0.08
Article 28Social & International Order
Medium P:ordered_liberty A:knowledge_order
Editorial
+0.10
Structural
+0.05
SETL
+0.07
Combined
ND
Context Modifier
ND
Article 28 requires social and international order to realize UDHR rights. Editorial: educational content supports knowledge order and intellectual infrastructure. Structural: orderly, well-organized content accessible globally; supports knowledge infrastructure. Minimal positive from contribution to informed society.
+0.10
Article 29Duties to Community
Medium P:duty_community A:knowledge_sharing
Editorial
+0.10
Structural
+0.10
SETL
0.00
Combined
ND
Context Modifier
ND
Article 29 addresses duties to community. Editorial: sharing technical knowledge freely represents contribution to community good and human development. Structural: publicly accessible without extraction of payment/data premium; supports duty fulfillment rather than pure market extraction. Mild positive.
0.00
Article 30No Destruction of Rights
Low P:no_destruction
Editorial
ND
Structural
0.00
SETL
ND
Combined
ND
Context Modifier
ND
Article 30 prohibits using UDHR to destroy rights. No evidence of such destruction in technical blog. Content does not advocate for UDHR limitation. Neutral.