Elasticsearch medium
When a search request is sent to any node in the cluster, that node becomes the 'Coordinating Node'. What is its specific responsibility?
- A It moves all relevant data into its local RAM to perform the search locally.
- B Scatter-Gather: It forwards the query to a copy of every shard in the index, collects their top results, merges/sorts them, and calculates the final global ranking.
- C It writes the query to the persistent audit log before execution.
- D It is primarily responsible for electing a new Master node if the current one is slow.
Answer: B. Scatter-Gather: It forwards the query to a copy of every shard in the index, collects their top results, merges/sorts them, and calculates the final global ranking.
The Coordinating node is the 'Manager'. In a 10-shard index where you want the 'Top 5' results, the manager asks 10 shards for their 'Local Top 5'. It then sorts all 50 results (the 'Gather' phase) to find the 'Global Top 5' to return to the user.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What are the two primary reasons for configuring one or more 'Replica Shards' for an index?
- When a String field is mapped as `text`, what process is performed to enable full-text search capability?
- What is the primary benefit of splitting an Elasticsearch index into multiple 'Primary Shards'?
- Every document stored in an Elasticsearch index is uniquely tracked by which mandatory metadata field?
- Elasticsearch search results include a metadata field called `_score`. What does this value primarily indicate?
- What is the primary architectural purpose of Elasticsearch in a modern software stack?