Scrivio Interview library
LeadershipAdvanced7 min read · updated 12 November 2026

Search is run on a self-managed Elasticsearch cluster by one team, and other teams want to add their own indexes to it. How would you decide on ownership, tenancy and the platform choice?

I would first decide whether search is a platform service: if several teams need it, one team owns it with stated service levels, onboarding rules and a cost model, instead of one product team quietly hosting everyone. Tenants are isolated with separate indexes, index templates, access controls and limits, and the most critical workloads get separate clusters. I would compare staying self-managed with managed offerings, OpenSearch and database full-text search, checking current licence terms, require every index to have a tested rebuild path from its source of truth, and monitor cluster health, shard counts and query cost per tenant.

Why this question is asked

A self-managed Elasticsearch cluster that started as one team's product search becomes attractive to everyone else: it is already running, it is fast, and asking for an index is easier than building something new. But each new index adds shards, memory pressure and query load that the owning team never planned for, and their on-call engineer becomes the search team for the whole company by accident. Interviewers ask this leadership question to see whether we can turn an informal arrangement into a deliberate one, with ownership, isolation and a reasoned platform choice. In this answer, we will decide the ownership model, design tenancy and isolation, compare platform options, set the rebuild rule, and define the monitoring that makes it all manageable.

1A Quick Recap: Why Sharing a Search Cluster Is Hard

An Elasticsearch index is split into shards, each one a Lucene index living on a node, with replicas on other nodes. Every shard costs heap memory and file handles whether it is busy or not, and the master node tracks all of them in the cluster state. Queries fan out to every shard of the indexes they touch, and an expensive query, a deep aggregation or a wildcard on a large index, consumes CPU and memory on every node that holds those shards.

So tenants share far more than disk. One team's oversharded index or runaway aggregation can slow everyone's searches, and in the worst case push nodes into long garbage collection or out-of-memory, taking the cluster down for all. That is the risk the decision must address.

2Decision 1: Is Search a Platform Service?

If one other team wants one small index, a lightweight agreement may be enough. If several teams want in and more will follow, search has become shared infrastructure and needs an owner. Making it a platform service means a named team owns the clusters, publishes service levels such as 99.9 percent availability and p99 query latency targets, defines how a team onboards, and charges or at least shows back the cost each tenant creates. Without that, the original team is funded for one product but carries the operational load of five.

Onboarding rules are the practical heart of it: an index request states its expected size, growth, query rate and criticality, names an owning team and on-call contact, and comes with a mapping and a rebuild plan. The platform team reviews it like a capacity request, because that is what it is.

Step throughOnboarding a new index
  1. Team submits index requestsize, growth, query rate, criticality, owner
  2. Has a rebuild path from its source of truth?
    YesContinueNoSend back: rebuild path required
  3. Critical or very large?
    YesDedicated clusterNoShared cluster with template and limits
  4. Apply template, roles, dashboardsper-tenant monitoring from day one

4 steps in order. Play them, or step through them one at a time.

3Decision 2: Tenancy and Isolation

Isolation comes in levels, and we match the level to criticality. The lightest level is separate indexes per team with a naming prefix such as orders-search-*, index templates that fix shard counts, replicas and mappings so nobody creates a 50-shard index for 2 GB of data, and roles that let each team's credentials read and write only its own indexes. Elasticsearch has fewer controls for limiting a tenant's query cost than for limiting access, so we add search timeouts and limits on result windows and aggregations in the template and client defaults, and watch slow logs.

The strongest level is a separate cluster. Revenue-critical search, such as storefront product search, should not share nodes with an internal log-style index someone added for a dashboard. A common result is two or three clusters grouped by criticality rather than one per team, which keeps the operational cost manageable while containing failures.

Isolation levels
LevelProtects againstCost
Separate indexes + naming prefixnaming clashes, accidental writesvery low
Index templates (shards, mappings)oversharding, mapping explosionslow
Roles per teamreading or deleting others' datalow
Query limits, timeouts, slow logssome runaway queriesmedium, partial
Separate cluster by criticalitynoisy neighbours, shared outageshighest

4Decision 3: Which Platform?

Formalising search is a good moment to ask whether self-managing is still right. The options are to keep self-managed Elasticsearch, move to Elastic's managed cloud offering, use OpenSearch, the fork created after Elastic changed its licence in 2021, self-managed or as a cloud provider's managed service, or, for some tenants, use the full-text search built into PostgreSQL, a tsvector column with a GIN index, which is often enough for searching a few million rows without a second system. Licensing has moved several times, with Elastic adding an AGPL option in 2024, so we check the current terms against how we actually use and offer the software, with legal advice.

We compare on total cost, not licence alone: machines, engineers' time for upgrades and incidents, the features each tenant needs, such as vector search or specific aggregations, and compatibility of clients and queries if we might switch. If the platform team is two people, a managed service may be the only way to offer real service levels. If some tenants only need basic search over data already in PostgreSQL, keeping them out of the cluster entirely is the cheapest isolation of all.

5Rule: Every Index Has a Rebuild Path

Search indexes are derived data, and we insist on keeping them that way. Every tenant must be able to rebuild its index from its own source of truth, typically through a reindex job that reads the database and writes a new index behind an alias. We test this regularly, for example quarterly, and before major upgrades. The rule pays off three times: mapping changes become routine, a lost or corrupted index is an inconvenience rather than data loss, and a platform migration, to a new version, a new cluster or a different product, becomes a rebuild per tenant instead of a risky data move. An index that holds data available nowhere else is a primary store in disguise, and we do not accept it on the shared platform.

6Monitoring per Tenant

We monitor cluster health (green, yellow or red), heap use and garbage collection time, disk watermarks, and shard counts per node against the guidance for our version, since too many small shards is one of the most common causes of instability. We break query rate, latency and rejected requests down by index prefix, so each tenant sees its own usage and the platform team can show what each one costs. Slow logs per index point at expensive queries, and a monthly report of shard counts and storage per tenant drives capacity planning and the cost conversation.

7Follow-up questions

What if the original team refuses to become the platform team?

That is a reasonable position: they were funded to build a product. Then leadership either funds a platform team, moves search to a managed service with light ownership, or limits shared use. The wrong outcome is the current one, where the work happens without being owned or funded.

How many shards should an index have?

Enough to keep each shard within the size range recommended for your version, commonly tens of gigabytes, and no more. Most small tenant indexes need one primary shard. Index templates set this default so teams do not guess.

Should tenants share one index with a tenant field instead of separate indexes?

For many small tenants of the same application, one index with a tenant field and filtered aliases can be more efficient. For different teams with different mappings and lifecycles, separate indexes are clearer and safer.

8Conclusion

In this answer, we turned an informal shared cluster into a decision. We made search a platform service with an owner, service levels, onboarding rules and visible cost, isolated tenants through indexes, templates, roles and query limits, and separated clusters by criticality. We compared self-managed Elasticsearch with managed offerings, OpenSearch and PostgreSQL full-text search on total cost and current licence terms, required a tested rebuild path for every index, and monitored health, shard counts and query cost per tenant.

What to say in the interviewAbout 90 seconds aloud

Open with

First I would make the ownership question explicit. If more than one or two teams want search, it is shared infrastructure, so either a team owns it as a platform service, with service levels, onboarding rules and a cost model, or we do not share it.

Then, if they want more

What I would not accept is the current situation, where one product team carries everyone's operational load unfunded. For onboarding, every index request states size, growth, query rate, criticality and an owner, and comes with a rebuild plan.

For tenancy, I would use separate indexes with a team prefix, index templates that fix shard counts and mappings, roles so each team can only touch its own indexes, and query limits and timeouts, and I would put the most critical search, like the storefront, on its own cluster, so a dashboard index can't take it down.

Typically that ends as two or three clusters by criticality. Then the platform choice: compare staying self-managed with Elastic's managed offering, OpenSearch self-hosted or managed, and Postgres full-text search for simple cases, on total cost and on current licence terms, which have changed several times, with legal involved.

A hard rule: every index must be rebuildable from its source of truth, tested regularly, which also makes any migration a rebuild. Finally, per-tenant monitoring of health, heap, shard counts, query latency and cost.

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
Spring Data reference
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 "Search is run on a self-managed Elasticsearch cluster by one team, and other teams want...": https://scrivio-interview-library.netlify.app/databases/spring-data-nosql/a41e72f444/