A distributed search engine partitions a searchable index#
At interview depth, Elasticsearch and OpenSearch expose indexes containing documents. Primary shards partition an index; replica shards hold copies. A coordinating node may route a query to relevant shard copies, collect shard results, and merge them.
| Good fit | Poor default fit |
|---|---|
| Text search, filtering, facets, log/event search | Correctness-critical multi-row transactions |
| Derived search read models | Automatic replacement for the authoritative database |
Shards add parallelism and distribution but also fan-out, merge, rebalancing, and operational cost. Choose shard strategy from data volume, traffic, routing, and failure requirements - not a memorized count.
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Clusters, nodes, and shardsElastic Documentation
- Search shards APIOpenSearch Documentation