Quick revision
The short answer
I would allow application-level clustering only where its benefit is measured, latency or cost that an external store cannot meet, and where the in-memory data can be rebuilt or is stored durably elsewhere. Teams that use it must provide an explicit split-brain strategy with partition tests, graceful shutdown that hands over state, rolling-upgrade compatibility, membership metrics and a full-cluster recovery runbook, while the platform offers managed stateful services so fewer teams need to carry this risk, and licensing is part of the decision.
What to remember
In this answer, we set a bar for application-level clustering. Teams take on membership, split brain, rebalancing, multi-node data loss and upgrade compatibility, so clustering is allowed only where its benefit is measured and the data can be rebuilt or is stored durably elsewhere. Teams that use it must provide a tested split-brain strategy, graceful handover on shutdown, rolling-upgrade compatibility, membership metrics and a full-recovery runbook, while the platform offers managed stateful services so fewer teams need it, and licensing, such as Akka's move to a business source licence and the Apache Pekko fork, is part of the decision.
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 allow application-level clustering only where its benefit is measured, latency or cost that an external store cannot meet, and where the in-memory data can be rebuilt or is stored durably elsewhere. Teams that use it must provide an explicit split-brain strategy with partition tests, graceful shutdown that hands over state, rolling-upgrade compatibility, membership metrics and a full-cluster recovery runbook, while the platform offers managed stateful services so fewer teams need to carry this risk, and licensing is part of the decision.
Why this question is asked
Embedding a data grid or actor cluster in a Java service is attractive: data in memory, microsecond reads and no extra infrastructure to request. But every team that does it quietly becomes a distributed database team, with membership, split brain and rolling upgrades to get right. Interviewers ask senior leaders this to see whether they can set a clear bar that neither bans a useful technique nor lets risk spread unnoticed. In this answer, we will look at what teams take on, decide when clustering is worth it, list the requirements, describe what the platform should offer instead, and cover licensing.
1What a Team Takes On With Embedded Clustering
The platform standard is stateless services backed by external stores. A stateless instance can be killed, scaled or redeployed at any time, because all state lives in a database or cache run by people who specialise in it. An embedded cluster reverses that. The service instances form a cluster through a membership protocol, own pieces of the data and replicate it to each other.
That brings real benefits, low latency and state kept close to the code, but it also hands the team a set of distributed systems problems: membership and failure detection, split brain during network partitions, rebalancing data on every deploy, data loss when several nodes restart together, and version compatibility when old and new instances must talk during a rolling upgrade. These problems appear rarely, which means teams meet them for the first time during an incident.
2When I Would Allow It
I would set two conditions, and both must hold. First, the benefit is measured, not assumed. The team shows that the latency, throughput or cost it needs cannot be reached with an external store such as a managed Redis or database, for example a pricing engine needing sub-millisecond reads of 2 GB of reference data at 50,000 requests per second. Second, the data is safe to lose from the cluster: it can be rebuilt from a durable source, or every write is also stored durably elsewhere. Losing the cluster must mean slower recovery, never lost business data.
- Can an external store meet the need?YesUse the external storeNoContinue
- Is the benefit measured?YesContinueNoMeasure first, then return
- Can the data be rebuilt or is it durable elsewhere?YesContinueNoNot allowed: use a database
- Approve with the requirementssplit brain, upgrades, shutdown, metrics, runbook
4 steps in order. Play them, or step through them one at a time.
3What I Would Require From Teams That Use It
Approval comes with obligations, written as a checklist that design review uses. Each one exists because of a failure mode that teams usually discover the hard way.
| Requirement | Failure it prevents |
|---|---|
| Explicit split-brain strategy, tested with partitions | two clusters writing different data |
| Graceful shutdown that hands over state | data loss or long rebalancing on deploys |
| Rolling-upgrade compatibility across versions | cluster failing mid-deploy |
| Metrics on membership changes and rebalancing | silent flapping and partitions |
| Runbook for full-cluster recovery | panic when every node restarts at once |
| Named owners with cluster expertise | nobody able to debug it at 3 a.m. |
The split-brain strategy must be chosen, such as keep majority or a lease, and proven by partitioning the network in staging. Graceful shutdown means an instance leaving during a deploy migrates its data or ensures backups are promoted before it exits, and the deployment must replace instances slowly enough for rebalancing to finish. Rolling-upgrade compatibility means the serialisation format and protocol work between version N and N+1, tested before each release. And the runbook covers the day every node restarts together, for example after a zone outage: how the cluster re-forms and how data is rebuilt.
4What the Platform Should Offer Instead
Most teams reach for embedded clustering because the alternative is slow or hard to get. If requesting a managed cache takes three weeks, an embedded grid looks attractive. So the platform should offer stateful services that cover the common needs: managed Redis or Valkey for caching and fast shared state, managed databases, and managed Kafka for streams, with sensible defaults and fast provisioning. Each team that uses these instead of embedding a cluster is one fewer team carrying split-brain risk.
For teams that do need embedded clustering, the platform can still help by providing a blessed library version with tested configuration and examples, so the hard parts are solved once.
5Licensing and Support Belong in the Decision
Cluster libraries are long-lived dependencies, so their licences and support matter. Several have changed terms in recent years. Akka moved to a Business Source Licence in 2022, which requires a commercial licence for many production uses, and Apache Pekko was forked from the last Apache-licensed Akka version as an open-source alternative. Other data grids split features between open-source and enterprise editions. Before approving a library, we check the licence of the exact version, the cost of support if we need it, and the migration path if the terms change again.
6Follow-up questions
Isn't this too restrictive for teams that know what they are doing?
The conditions are about evidence, not permission by seniority. A team that can show a measured benefit and meets the requirements is approved. The checklist mostly protects the future: the people who built the cluster may move on, and the requirements make sure the next owners can run it.
How do you handle existing clusters that do not meet the requirements?
Inventory them, rank them by the business impact of a failure, and work through the gaps with each team, starting with split-brain strategy and the recovery runbook. Some will move to a managed store instead, which is often cheaper than closing every gap.
What metrics show that a cluster is unhealthy?
Frequent membership changes, members marked unreachable and then reachable again, long or repeated rebalancing, rising heap and GC pauses, and partition ownership that stays uneven after deploys. Alerting on these catches most problems before users notice.
7Conclusion
In this answer, we set a bar for application-level clustering. Teams take on membership, split brain, rebalancing, multi-node data loss and upgrade compatibility, so clustering is allowed only where its benefit is measured and the data can be rebuilt or is stored durably elsewhere. Teams that use it must provide a tested split-brain strategy, graceful handover on shutdown, rolling-upgrade compatibility, membership metrics and a full-recovery runbook, while the platform offers managed stateful services so fewer teams need it, and licensing, such as Akka's move to a business source licence and the Apache Pekko fork, is part of the decision.
Open with
I'd start by being clear about what teams take on. An embedded data grid or actor cluster gives low latency and in-memory state, but the team now owns distributed systems problems: membership, split brain, rebalancing on every deploy, data loss when several nodes restart together, and version compatibility during rolling upgrades.
Then, if they want more
So I'd allow it under two conditions. The benefit has to be measured: latency, throughput or cost that a managed external store genuinely can't meet. And the data must be rebuildable or stored durably elsewhere, so losing the cluster means slower recovery, never lost business data.
Teams that use it must meet a checklist in design review: an explicit split-brain strategy, like keep majority or a lease, proven with network partition tests; graceful shutdown that hands over state, with deploys slow enough for rebalancing; rolling-upgrade compatibility tested between versions; metrics and alerts on membership changes and rebalancing; and a runbook for full-cluster recovery, plus named owners.
On the platform side, I'd reduce demand by offering managed stateful services, Redis or Valkey, databases and Kafka, that are quick to provision, because teams often embed clusters when the alternative is slow to get.
Finally, licensing and support are part of the decision: Akka moved to a business source licence, and Apache Pekko is the open-source fork, so we check the exact version's terms and our exit path before approving.
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 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, when would you allow application-level clustering, and...": https://scrivio-interview-library.netlify.app/architecture/distributed-systems/6123b9920b/