Quick revision
The short answer
The standard should change in two directions at once. Inside one database, stronger isolation has become cheap enough that the default should be the strongest level the workload tolerates, with documented exceptions; across services, where no database isolation applies at all, the standard should require sagas, the outbox pattern and idempotency instead of pretending to have transactions. We make sure it is followed by turning it into shared libraries, schema linting and test templates, by tracking incidents and abort rates, and by teaching people why it matters.
What to remember
In this answer, we saw that invariants now often span services, where no database isolation applies, while strong isolation inside one database has become cheap. The standard therefore defaults to the strongest tolerable level inside a database, with documented exceptions, and requires sagas, the outbox pattern and idempotency across services. It is made executable with shared libraries, schema linting and concurrency test templates, tracked through incidents, abort rates and reconciliation findings in architecture reviews, and supported by education, because these bugs rarely appear in tests.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The standard should change in two directions at once. Inside one database, stronger isolation has become cheap enough that the default should be the strongest level the workload tolerates, with documented exceptions; across services, where no database isolation applies at all, the standard should require sagas, the outbox pattern and idempotency instead of pretending to have transactions. We make sure it is followed by turning it into shared libraries, schema linting and test templates, by tracking incidents and abort rates, and by teaching people why it matters.
Why this question is asked
Twenty years ago a typical enterprise application ran on one big database, and the database's locks were the concurrency strategy, whether anyone said so or not. Today one business operation may cross five services, an ORM writes most of the SQL, and some data lives in a distributed database. A standard written for the old world either does nothing or does harm in the new one. Interviewers ask this of senior leaders because it tests whether they can update a technical standard and also get hundreds of engineers to follow it. In this answer, we will look at what changed, what the new standard says, how to make it executable, how to track it, and why education is part of it.
1What Changed in Twenty Years
Two shifts pull in opposite directions. The first is that invariants, the rules that must always hold, now often span services. An order service, a payment service and an inventory service each have their own database, so 'do not ship an order that was not paid' crosses three databases, and no isolation level of any one of them covers it. Engineers who learned that @Transactional makes things safe can be badly misled here.
The second is that inside a single database, strong isolation has become far cheaper. PostgreSQL's Serializable Snapshot Isolation gives true serializability without making readers wait, and distributed SQL databases offer serializable as their default. ORMs, meanwhile, hide the SQL, so developers often do not see the read-then-write patterns that cause anomalies. The old standard, READ COMMITTED plus careful locking, relied on people seeing exactly what they now cannot see.
2The Standard Inside One Database
Within one database, the standard is to use the strongest isolation level the workload tolerates, by default SERIALIZABLE on PostgreSQL for data with invariants, with any lower level written down as an exception that names the protection used instead, such as a constraint or a conditional update. Constraints remain the first line of defence because they hold for every writer. Every service also states, in its design document, which invariants it protects and how.
3The Standard Across Services
Across services, the standard says plainly that there is no transaction, and asks for patterns designed for that. A multi-step business process is a saga: a sequence of local transactions, each with a compensating action if a later step fails, for example refund the payment if the stock reservation fails. Messages are published with the outbox pattern, written to an outbox table in the same local transaction as the business change and relayed afterwards, so a change and its event cannot disagree. Every consumer and every API that can be retried is idempotent, using an idempotency key, so duplicates from retries do no harm. Distributed two-phase commit is discouraged except where a team proves it is needed.
- Across servicessagas, compensations, outbox, idempotency keys
- Service boundaryAPI contracts, retries with idempotency
- Inside one service's databaseSERIALIZABLE by default, documented exceptions
- Schemaunique, exclusion and foreign key constraints
4 layers, from the top down. Step through them one at a time.
Isolation levels only reach as far as one database.
4Making the Standard Executable
A standard that lives only in a wiki is followed by the people who already agree with it. So the platform turns it into code that teams get for free. A shared transaction library sets the isolation level, retries 40001 and 40P01 with backoff, and records metrics. A saga and outbox library provides the outbox table, the relay and idempotent consumer helpers. A schema linter in the migration pipeline flags tables with obvious missing constraints, such as an is_primary flag with no partial unique index. And concurrency test templates, two transactions synchronised with a latch against a real database in Testcontainers, let teams prove their invariants hold under interleaving.
5Tracking Compliance and Outcomes
We track two kinds of numbers. Compliance numbers say whether teams use the paved path: the share of services on the shared transaction library, the number of documented isolation exceptions, and services with concurrency tests for their key invariants. Outcome numbers say whether it works: incidents whose root cause was an anomaly or a lost message, retry and abort rates per service, and findings from reconciliation jobs that compare invariants across services, such as paid orders without a shipment. These are reviewed in the architecture forum each quarter, and a service with high findings gets help, not blame.
- Publish standard and paved pathlibraries, linter, test templates
- Teams adopt by defaultexceptions documented in design docs
- Measureincidents, abort rates, reconciliation findings
- Quarterly architecture reviewhelp the outliers, update the standard
- Standard still fits the workloads?YesKeep goingNoRevise and announce
5 steps in order. Play them, or step through them one at a time.
6Why Education Is Part of the Standard
Isolation bugs almost never appear in tests, because tests run one request at a time, and they appear in production only under load, often months after the code shipped. That means engineers rarely learn from their own mistakes in time. So we invest in teaching: a short internal course built on our own incident reviews, a reference page per database product on what its isolation levels really do, and pairing for teams adopting sagas for the first time. The goal is that engineers understand why the paved path exists, so they recognise the cases it does not cover.
7Follow-up questions
How would you handle a team that refuses for performance reasons?
I would take the concern seriously and ask for data. We would load test their hottest path at SERIALIZABLE with the shared retry library and measure abort rate and p99 latency against their budget. If it really does not fit, the standard already allows an exception: they document the lower isolation level and the specific protection that replaces it, such as conditional updates or a lock row, plus a concurrency test that proves the invariant holds. What I would not accept is a lower level with no stated protection, because that just moves the cost into future incidents.
Why discourage distributed two-phase commit?
It couples the availability of every participant: one slow or failed service blocks the others while locks are held. Sagas accept temporary inconsistency in exchange for independence, which suits most business processes.
How do you know the standard is working?
When anomaly-caused incidents and reconciliation findings fall over several quarters while delivery speed holds steady. If incidents fall but teams slow down a lot, the paved path is too heavy and needs work.
8Conclusion
In this answer, we saw that invariants now often span services, where no database isolation applies, while strong isolation inside one database has become cheap. The standard therefore defaults to the strongest tolerable level inside a database, with documented exceptions, and requires sagas, the outbox pattern and idempotency across services. It is made executable with shared libraries, schema linting and concurrency test templates, tracked through incidents, abort rates and reconciliation findings in architecture reviews, and supported by education, because these bugs rarely appear in tests.
Open with
I'd start by explaining the shift. Twenty years ago one database held the invariants, and its locks at READ COMMITTED were the strategy. Now an invariant like don't ship unpaid orders spans three services, and no isolation level covers that, while inside one database strong isolation got cheap thanks to SSI in PostgreSQL and serializable defaults in distributed SQL.
Then, if they want more
So the standard has two parts. Inside one database, default to the strongest level the workload tolerates, usually SERIALIZABLE for data with invariants, with constraints first and any lower level documented with the protection that replaces it. Across services, don't pretend there's a transaction: use sagas with compensations, the outbox pattern for events, and idempotency keys for anything retried.
To make it followed, I'd make it executable: a shared transaction library with retries and metrics, an outbox library, schema linting in the migration pipeline, and concurrency test templates with Testcontainers. Then I'd track compliance and outcomes, like adoption of the library, incidents caused by anomalies, abort rates and reconciliation findings, and review them quarterly in the architecture forum.
And I'd invest in education built on our own incidents, because isolation bugs rarely show up in tests and only appear under production load.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Twenty years ago most enterprise applications relied on database locks and READ...": https://scrivio-interview-library.netlify.app/databases/acid-and-isolation/89a5a9bd40/