Quick revision
The short answer
I would define durability tiers instead of one setting for everyone: the financial tier runs innodb_flush_log_at_trx_commit=1 and sync_binlog=1 with semi-synchronous replication or Group Replication, and lower tiers may relax settings only with a written, signed risk acceptance. Each tier is explained in plain terms, such as up to about a second of commits lost on a host crash, so business owners make the call. We measure the real latency cost on our storage, prove each tier with failure tests, and audit configurations automatically so instances do not drift.
What to remember
In this answer, we turned a conflict between finance and product into a standard: durability tiers with exact settings and plain-language promises, double one plus semi-sync or Group Replication for financial data, and relaxed tiers only with signed risk acceptance. We explained loss windows in business terms, measured the real latency cost on our storage, proved each tier with failure tests that count lost commits, and audited live configurations nightly so no instance drifts from its tier.
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.
I would define durability tiers instead of one setting for everyone: the financial tier runs innodb_flush_log_at_trx_commit=1 and sync_binlog=1 with semi-synchronous replication or Group Replication, and lower tiers may relax settings only with a written, signed risk acceptance. Each tier is explained in plain terms, such as up to about a second of commits lost on a host crash, so business owners make the call. We measure the real latency cost on our storage, prove each tier with failure tests, and audit configurations automatically so instances do not drift.
Why this question is asked
Finance and product are both right here. Finance needs a ledger that never forgets a payment it confirmed, and product needs pages that respond quickly. The mistake is to settle the argument once, for everybody, in a meeting. Interviewers ask this at the most senior level because the answer is less about one MySQL variable and more about turning a technical trade-off into a decision the business can own, and then making sure the platform actually behaves as promised. In this answer, we will recap where commits can be lost, define the tiers, look at how we explain the risk and measure the cost, and then see how failure tests and audits keep the promise true.
1Where a Committed Transaction Can Be Lost
A commit can disappear in two places. On a single server, it can be lost if the redo log or the binary log had not reached disk when the host crashed. innodb_flush_log_at_trx_commit=1 makes InnoDB fsync its redo at every commit, and sync_binlog=1 does the same for the binlog; with both at 1, a commit acknowledged to the client survives a crash of the host.
Across servers, it can be lost on failover. With ordinary asynchronous replication, the primary acknowledges the commit before any replica has received it. If the primary dies for good and we promote a replica, the transactions that had not yet been shipped are gone. Semi-synchronous replication with rpl_semi_sync_source_wait_point=AFTER_SYNC waits until at least one replica has written the transaction to its relay log before acknowledging, and Group Replication certifies each transaction across a majority of members. So no loss at all needs protection in both places.
2Defining Durability Tiers
A tier is a named set of settings plus a promise in business language. Three tiers are usually enough. Each service declares its tier in its service catalogue entry, and the platform team provisions the database to match.
| Tier | Settings | Promise in plain words |
|---|---|---|
| 1 Financial | trx_commit=1, sync_binlog=1, semi-sync AFTER_SYNC or GR | no acknowledged commit lost on host or primary loss |
| 2 Standard | trx_commit=1, sync_binlog=1, async replicas | survives a host crash; failover may lose seconds |
| 3 Rebuildable | trx_commit=2, sync_binlog=1, async replicas | host crash may lose about 1 second of commits |
Notice that tier 3 still keeps sync_binlog=1 in this example. Relaxing the binlog breaks point-in-time recovery and replica consistency in ways that surprise people, so even the fast tier relaxes only the InnoDB setting. Any relaxation is a choice someone signs: the product owner of the service accepts the stated loss window in writing, and the acceptance is reviewed once a year.
3Explaining the Risk So the Business Can Decide
Business owners cannot weigh innodb_flush_log_at_trx_commit=2, but they can weigh this sentence: if the database host loses power, the last second of orders may disappear, which at our peak of 300 orders per second is up to 300 orders the customer saw confirmed. Each tier document states the loss window, the rough frequency of the failure that triggers it (host crashes and primary losses happen a few times a year in a large fleet), and what customers would experience.
It also states the cost in latency. A product team that hears 'full durability adds 0.3 ms to a commit' decides very differently from one that hears 'durability is slow'. That is why the next step is to measure.
4Measuring the Real Latency Cost
The cost of fsync depends entirely on the storage. On local NVMe drives an fsync can take tens of microseconds; on network block storage it may be closer to a millisecond. Group commit then spreads one fsync over all transactions committing at the same moment, so under real concurrency the per-transaction cost is often much smaller than the single-thread benchmark suggests. Semi-sync adds one network round trip to the nearest replica, typically under a millisecond within a region and much more across regions.
These numbers are an illustration of what we publish, not a promise for every platform; the point is that we publish our own, measured on the volumes we actually use. In many fleets the gap turns out small enough that most teams choose tier 2, and the argument largely disappears.
5Proving Each Tier With Failure Tests
A setting in a document is a hope; a failure test is evidence. For each tier we run a test in a staging environment that writes numbered transactions, records every acknowledged one in the client, and then injects failures: kill -9 of mysqld, a hard power-off of the host, a network cut between primary and replicas, and a failover. After recovery, we count which acknowledged transaction ids are missing. Tier 1 must lose zero. Tier 3 must lose no more than its stated window. We repeat the tests after major upgrades and storage changes, because both can change the result.
- Service owner picks a tierfrom the plain-language tier sheet
- Relaxed tier chosen?YesSigned risk acceptance, yearly reviewNoDefault tier 1 or 2
- Platform provisions settingsfrom code, per tier
- Failure tests per tiercount lost acknowledged commits
- Nightly configuration auditcompare live variables to the tier
- Drift found?YesAlert and fix automaticallyNoReport clean
6 steps in order. Play them, or step through them one at a time.
6Auditing Configuration So It Does Not Drift
The last risk is silent drift: someone sets innodb_flush_log_at_trx_commit=2 during an incident to get through a load spike and never sets it back. We prevent this in two ways. Configuration is applied from code per tier, so a rebuild always restores it, and a nightly job reads performance_schema.global_variables on every instance, compares the values with the tier declared for that database, and opens an alert for each difference. The dashboard shows each tier's instances and their status, which is also the evidence finance and auditors ask for.
7Follow-up questions
Is semi-synchronous replication a guarantee of zero loss?
Not by itself. If the replica does not answer within rpl_semi_sync_source_timeout, the primary falls back to asynchronous replication and carries on, so for a while commits are not protected. Tier 1 therefore alerts on that fallback, or uses Group Replication, where a transaction cannot commit without a majority.
Why not put every database on tier 1 and stop debating?
For many companies that is a reasonable default, and measurement often shows the cost is small. Tiers still help, because they make the exceptions explicit and owned, and they stop people from relaxing settings informally when they need speed.
Who owns the decision for a given service?
The business owner of the service owns the acceptable loss, the platform team owns the settings and the evidence, and finance or risk sets the minimum tier for regulated data. The tier sheet makes that split clear.
8Conclusion
In this answer, we turned a conflict between finance and product into a standard: durability tiers with exact settings and plain-language promises, double one plus semi-sync or Group Replication for financial data, and relaxed tiers only with signed risk acceptance. We explained loss windows in business terms, measured the real latency cost on our storage, proved each tier with failure tests that count lost commits, and audited live configurations nightly so no instance drifts from its tier.
Open with
I would not pick one setting for the whole company. I would define durability tiers. Tier one, for financial data, uses innodb_flush_log_at_trx_commit equal to 1 and sync_binlog equal to 1, so a host crash loses nothing, plus semi-synchronous replication with AFTER_SYNC or Group Replication, so a failover loses nothing either.
Then, if they want more
Lower tiers can relax settings, for example trx_commit at 2, but only with a written risk acceptance from the service owner. The key is explaining the risk in plain terms: on a host crash, up to about one second of commits may be lost, which at our peak is so many orders.
Then I would measure the real latency cost on our actual storage, because with group commit and modern SSD or cloud volumes it is often a fraction of a millisecond, and that usually settles the argument.
I would prove each tier with failure tests: kill mysqld, power off the host, cut the network, fail over, and count acknowledged transactions that went missing. Tier one must lose zero. Finally, configuration is applied from code and a nightly audit compares live variables to each database's tier, so nobody's emergency change during an incident quietly becomes permanent.
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
- 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 "Your finance team asks for a guarantee that no committed transaction is ever lost, while...": https://scrivio-interview-library.netlify.app/databases/mysql/e6b9be8cb3/