Quick revision
The short answer
I would set a strategy of fewer, deliberate coordination services: Kubernetes primitives (Lease, ConfigMaps, Services) for workloads on Kubernetes, one platform-run strongly consistent store for needs outside it, and no new team-owned ZooKeeper ensembles. Migrations go in order of necessity and risk, starting with Kafka's move to KRaft that 4.x requires, then in-house election and configuration with fencing and failure tests, and each ensemble is retired only when measured usage reaches zero.
What to remember
In this answer, we set a five-year coordination strategy. We inventoried every ZooKeeper use, chose Kubernetes primitives for Kubernetes workloads and one platform-run consistent store for everything else, and ordered migrations with Kafka's required move to KRaft first, then in-house election with fencing, then locks and configuration. Ensembles are retired only when their usage is measurably zero, expertise is kept until then, and coordination dependencies become part of every architecture review.
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 set a strategy of fewer, deliberate coordination services: Kubernetes primitives (Lease, ConfigMaps, Services) for workloads on Kubernetes, one platform-run strongly consistent store for needs outside it, and no new team-owned ZooKeeper ensembles. Migrations go in order of necessity and risk, starting with Kafka's move to KRaft that 4.x requires, then in-house election and configuration with fencing and failure tests, and each ensemble is retired only when measured usage reaches zero.
Why this question is asked
Coordination services rarely appear on roadmaps because they work quietly for years, and then a version change such as Kafka 4.0 dropping ZooKeeper forces a decision. Interviewers ask senior leaders this to see whether they can turn a forced migration into a coherent direction, rather than either rewriting everything or keeping old systems forever. In this answer, we will look at why ZooKeeper is in the estate and what has changed, take an inventory, set the target state, order the migrations, and define how and when an ensemble may be retired.
1What ZooKeeper Does for Us and What Has Changed
ZooKeeper is a strongly consistent coordination service: a small replicated tree of nodes where every write is agreed by a majority, with sessions, ephemeral nodes and watches. Companies adopted it for three kinds of work: storing metadata for other products (older Kafka kept its cluster metadata there), electing leaders and holding locks for in-house services, and storing shared configuration.
Two things changed. Kafka 4.x runs only in KRaft mode, where Kafka's own controller quorum stores metadata, so ZooKeeper-based clusters must migrate to KRaft on a 3.x bridge release before upgrading to 4.x (check the exact supported upgrade path for your version). And most new services run on Kubernetes, which already contains a consistent store, etcd, and exposes coordination primitives on top of it. So the question is no longer how to run ZooKeeper well, but which coordination needs remain and where each should live.
2Start With an Inventory
A strategy built on assumptions fails during migration, so the first step is evidence. For every ensemble we list its clients, which we can find from connection logs and the znode tree itself, and classify each use: Kafka metadata, other products that still depend on ZooKeeper (some older Hadoop, HBase or Solr setups do), in-house leader election, in-house locks, and configuration. For each use we record the owning team, how critical it is, and what would happen if ZooKeeper were unavailable for an hour.
The inventory usually surprises people. There is often a forgotten service that writes feature flags into a path nobody documented, or a batch job that takes a lock every minute. Those surprises are exactly what blocks a retirement two years later, so we want them now.
3The Target State
The direction I would set has three layers, chosen so that each team uses the simplest tool that is safe for its need.
- Kubernetes primitivesLease objects for leader election, ConfigMaps or a config service, Service discovery
- One platform coordination serviceetcd, ZooKeeper or a managed equivalent, run by the platform team
- Product-embedded quorumsKafka KRaft controllers, managed by the Kafka platform
- No team-owned ensemblesnew requests go through architecture review
4 layers, from the top down. Step through them one at a time.
Teams start at the top and move down only when the layer above cannot meet the need.
For services on Kubernetes, the Lease object handles leader election and is backed by the cluster's etcd, so there is nothing extra to operate. Configuration lives in ConfigMaps or a configuration service with local caching. Discovery uses the cluster's Services and DNS. For needs outside Kubernetes, such as services on virtual machines or cross-cluster coordination, we keep one supported strongly consistent service, run by a platform team with proper monitoring and on-call, instead of several small ensembles owned by teams that touch them once a year. Notice that whichever store holds a lease, correctness still needs fencing: Kubernetes Leases are time-based, so work done under them must be idempotent or guarded.
4Ordering the Migrations
Not everything should move at once, and not everything should move at all. I would order the work by necessity first and risk second.
- Kafka clusters to KRaftrequired before 4.x upgrades
- Other products on ZooKeeperfollow each vendor's supported path
- In-house leader electionto Lease or the platform service, with fencing
- In-house locksreview each: often replaced by database constraints
- Configurationto ConfigMaps or a config service with caching
- Usage at zero for 30 days?YesRetire the ensembleNoKeep it supported
6 steps in order. Play them, or step through them one at a time.
Kafka comes first because the upgrade forces it and because KRaft migration has a well-defined, tested procedure; we rehearse it on a staging cluster, migrate one low-risk production cluster, and then the rest. The in-house election code is next because it is the riskiest to get wrong: for each service we add a fencing token or idempotent writes, then test failover by partitioning the old leader and pausing it, before switching the backend. Locks get special scrutiny, because many of them can be removed entirely by letting the database enforce the rule.
5Retiring an Ensemble, or Deciding to Keep It
An ensemble is retired only when measured usage is zero: no client connections and no reads or writes for an agreed period, such as 30 days, confirmed by its metrics. Until then it stays fully supported, and we keep the people who know how to run it, because the worst time to lose ZooKeeper expertise is during the last, hardest migration. If one product still needs ZooKeeper in five years, keeping a single well-run ensemble is a perfectly good outcome; the strategy is about deliberate choices, not about zero at any cost.
To keep the estate from growing back, coordination dependencies become part of the architecture review checklist. A design that needs election, locks or shared configuration must say which layer it uses and how it behaves when that layer is down. A simple dashboard of ensembles, clients and migration status, reviewed quarterly, keeps the plan honest over five years.
6Follow-up questions
Why not make every team move to etcd directly?
Running etcd well is as much work as running ZooKeeper well, and most teams on Kubernetes already have etcd behind the Lease and ConfigMap APIs without operating it. Teams should use the platform's primitives, and only the platform team should operate a raw coordination store for the cases Kubernetes cannot serve.
How do you convince teams to spend time on migrations that bring no features?
By making the cost visible and the path cheap. The inventory shows each team its risk and the date when its dependency stops being supported, the platform team provides a library or example for Lease-based election and configuration, and the work is scheduled with product leaders as risk reduction, with Kafka's required upgrade as the natural first milestone.
What does fencing mean for leader election on Kubernetes?
It means the resources the leader writes to can reject a stale leader. A Lease cannot do that by itself, so we pass a token or epoch with each write, or make every action idempotent, so that an old leader that keeps running for a few seconds cannot cause harm.
7Conclusion
In this answer, we set a five-year coordination strategy. We inventoried every ZooKeeper use, chose Kubernetes primitives for Kubernetes workloads and one platform-run consistent store for everything else, and ordered migrations with Kafka's required move to KRaft first, then in-house election with fencing, then locks and configuration. Ensembles are retired only when their usage is measurably zero, expertise is kept until then, and coordination dependencies become part of every architecture review.
Open with
My goal would be fewer coordination systems, each chosen on purpose. First I would build an inventory of every ZooKeeper use: Kafka metadata, other products that still depend on it, in-house elections, locks and configuration, with owners and criticality, because the forgotten users are what block retirements later.
Then, if they want more
Then I would set the target state. Services on Kubernetes use the platform's primitives: Lease objects for leader election, which are backed by the cluster's etcd, ConfigMaps or a config service for configuration, and Kubernetes Services for discovery.
For needs outside Kubernetes we keep exactly one strongly consistent coordination service, etcd, ZooKeeper or a managed equivalent, run by the platform team rather than many small team-owned ensembles. The order of migration follows necessity and risk.
Kafka goes first, because 4.x only runs in KRaft mode, so clusters have to migrate to KRaft on a 3.x bridge release before upgrading; we rehearse it and do the low-risk clusters first.
Then in-house election and configuration, each with fencing or idempotent writes and failure testing, and I would review every lock to see whether a database constraint can replace it. An ensemble is retired only when its measured usage is zero for a month, and we keep the expertise until then.
Finally, coordination dependencies become part of the architecture review checklist so the estate does not grow back.
About this answer
- Last updated
- 13 November 2026
- Versions it names
- Kafka 4.0
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
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 "As the senior technical leader, what coordination strategy do you set for the next five...": https://scrivio-interview-library.netlify.app/architecture/distributed-systems/849dd33c8a/