Quick revision
The short answer
Kafka's durability comes from replication, not from fsync: with acks=all and min.insync.replicas=2, an acknowledged write is already on at least two brokers, and with replicas spread across zones the remaining risk is a correlated failure of all of them before the operating system flushes. I would not mandate flush.messages=1 platform-wide, because per-message fsync cuts throughput by large factors for a risk that zone placement already covers. Instead I would set durability classes per data type with recovery point objectives, allow stricter flushing only for a few small critical topics if the analysis supports it, pair Kafka with source-side recovery and cross-region copies, and prove the policy with failure drills and monitoring.
What to remember
In this answer, we saw that Kafka acknowledges acks=all writes once they are in the memory of at least min.insync.replicas brokers, so durability comes from replication, and with replicas across zones the remaining risk is a rare correlated failure within the flush window. Mandating flush.messages=1 everywhere would cost large factors of throughput for little extra protection. A better policy defines durability classes with recovery point objectives, uses targeted flushing only where it is cheap, adds outbox and cross-region recovery for critical data, and proves itself with drills and monitoring.
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.
Kafka's durability comes from replication, not from fsync: with acks=all and min.insync.replicas=2, an acknowledged write is already on at least two brokers, and with replicas spread across zones the remaining risk is a correlated failure of all of them before the operating system flushes. I would not mandate flush.messages=1 platform-wide, because per-message fsync cuts throughput by large factors for a risk that zone placement already covers. Instead I would set durability classes per data type with recovery point objectives, allow stricter flushing only for a few small critical topics if the analysis supports it, pair Kafka with source-side recovery and cross-region copies, and prove the policy with failure drills and monitoring.
Why this question is asked
A risk committee is right to ask how durable the platform is, and the observation is correct: Kafka acknowledges before data is on disk. A platform leader's job is to answer the real concern, losing data the business relies on, without accepting a fix that costs far more than the risk it removes. Interviewers ask this to see whether we can translate a technical mechanism into risk language, quantify trade-offs, and build trust with evidence. In this answer, we will recap how Kafka makes writes durable, quantify what the proposed setting costs, identify what risk actually remains, design durability classes, and plan how to explain and prove the policy to the committee.
1A Quick Recap of How Kafka Makes Writes Durable
When a producer writes with acks=all, the leader appends the record to its log, which puts it in the operating system's page cache, and waits until every in-sync follower has fetched it into its own page cache. min.insync.replicas=2 makes sure that set is at least two brokers. Only then does the producer get its acknowledgement. The data reaches the physical disk later, when the kernel flushes dirty pages, usually within seconds.
So 'acknowledged before fsync' is true, but 'acknowledged while existing in one place' is not. The record exists in the memory of at least two separate machines. To lose it, both must lose power or crash before their caches flush, and the replicas that were not yet caught up must also not have it. The committee's concern is therefore about correlated failures, not about a single broker crash, which replication already handles.
2What flush.messages=1 Would Cost
flush.messages=1 tells the broker to fsync the log after every message. On a busy partition that turns a stream of cheap sequential page-cache writes into a stream of synchronous disk flushes, each waiting for the device to confirm. Even on fast SSDs that adds latency to every produce request and limits each partition to the number of flushes the disk can do per second. In practice throughput can fall by large factors, and the cluster would need several times more brokers to carry the same load, a cost the committee should see in money.
It also gives less protection than it seems. An fsync on one broker does not help if that broker's disk is destroyed. Durability in a distributed system comes from copies in independent places; flushing one copy faster does not add a copy.
| Measure | Covers | Cost |
|---|---|---|
acks=all, min.insync.replicas=2 | any single broker failure | small latency |
| Replicas across three zones | rack, power feed or zone loss | cross-zone traffic |
flush.messages=1 on a topic | all replicas losing power at once | large throughput loss |
| Outbox and reconciliation at source | any loss in Kafka, bugs included | engineering effort |
| Cross-region copy | regional disaster | second cluster, lag of seconds |
3Quantifying the Risk That Remains
With replicas in three zones, the scenario that loses acknowledged data is every replica holding a record failing within the few seconds before its cache flushes, and in a way that loses memory: simultaneous power loss across independent zones, or a correlated software fault that crashes all of them. Zones are designed with separate power and networking precisely so that this is rare, and a kernel crash on one machine does not affect another.
We should present that remaining risk honestly, with the window (seconds of unflushed data) and the conditions. For most data the expected loss is tiny compared with other risks the business already accepts. For a few small, critical topics, such as a ledger of financial postings with low throughput, a tighter flush policy may be affordable and reasonable, because low volume means the throughput cost hardly matters. That is a targeted decision, not a platform mandate.
4Designing Durability Classes
The policy should be expressed as classes tied to the business impact of loss, each with a recovery point objective, the amount of data we can afford to lose. A critical class for payments and ledgers: replication factor 3 across zones, min.insync.replicas=2, acks=all, idempotence, unclean election off, source-side outbox so every event can be re-sent, and a cross-region copy. A standard class for most business events: the same replication settings without the cross-region requirement. A best-effort class for metrics and logs: lower settings acceptable.
Kafka is one layer of the defence. For critical data the source system keeps an outbox table, the event written in the same database transaction as the business change, and a reconciliation job compares the source with what consumers processed. That covers losses from any cause, including bugs and misconfiguration, which are far more common than simultaneous zone power loss. Regional disasters are covered by asynchronous copies to another region, for example with MirrorMaker 2.
5Explaining It to the Committee and Proving It
I would start by agreeing with the observation and restating the real goal: no loss of data the business depends on. Then I would show where each risk is covered, with the table of measures and costs, and the residual risk with its conditions. I would offer the targeted option for critical low-volume topics and show the cost of the platform-wide mandate in brokers and latency.
Most importantly, I would back the policy with evidence rather than configuration claims. Regular drills, killing brokers and simulating a zone loss in a staging or even production cluster during a quiet period, measure whether acknowledged writes survive and how long recovery takes. Monitoring of under-min-ISR partitions and of topics that do not meet their class's settings shows the policy is actually in force. A quarterly report of drill results and exceptions gives the committee something to review instead of something to trust.
6Follow-up questions
What if the committee insists on fsync anyway?
Then I would propose it as a scoped experiment: enable it on the critical low-volume topics, measure latency and throughput, and report the results alongside the risk it removes. If the committee still wants it platform-wide after seeing the cost, that becomes an informed business decision, budgeted and recorded.
Does the hardware matter here?
Yes. Disks with power-loss protection, which flush their own write cache on power failure, and servers on separate power feeds reduce the correlated failure risk further. They are part of the evidence that the residual risk is small, and cheaper than per-message fsync.
How does an outbox help if Kafka itself loses data?
The outbox row is written in the same transaction as the business change, and a relay publishes it to Kafka and marks it sent only after an acks=all acknowledgement. If a later reconciliation finds an event missing downstream, it can be re-sent from the outbox, so the source database, not Kafka, is the final record.
7Conclusion
In this answer, we saw that Kafka acknowledges acks=all writes once they are in the memory of at least min.insync.replicas brokers, so durability comes from replication, and with replicas across zones the remaining risk is a rare correlated failure within the flush window. Mandating flush.messages=1 everywhere would cost large factors of throughput for little extra protection. A better policy defines durability classes with recovery point objectives, uses targeted flushing only where it is cheap, adds outbox and cross-region recovery for critical data, and proves itself with drills and monitoring.
Open with
I would start by agreeing that the observation is correct: Kafka acknowledges before fsync. But durability in Kafka comes from replication. With acks=all and min.insync.replicas of 2, a write is acknowledged only once it is on at least two brokers, and we place replicas in three different zones.
Then, if they want more
So losing an acknowledged record needs all the brokers holding it to lose power or crash within the few seconds before the kernel flushes, which zone separation makes rare. flush.messages=1 would fsync every message, which cuts throughput by large factors and would mean many more brokers, while not adding a single extra copy. So I would not mandate it platform-wide.
Instead I would set durability classes with recovery point objectives. Critical data like payments gets replication factor 3 across zones, min ISR 2, acks=all, idempotence, no unclean election, an outbox at the source and a cross-region copy. Standard business events get the same replication without the cross-region copy, and logs and metrics can be looser.
For a few small, critical, low-volume topics a stricter flush policy may be affordable, and I would offer that as a measured experiment. Finally, I would give the committee evidence instead of claims: broker and zone failure drills, monitoring of under-min-ISR partitions and topics out of policy, and a regular report on both.
About this answer
- Last updated
- 13 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
- Apache Kafka documentation
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 "How do you decide the durability policy for the platform and explain it to the committee?": https://scrivio-interview-library.netlify.app/spring-boot/kafka-internals/1b0aa85eed/