Elasticsearch hard
Why is 'Point In Time' (PIT) generally preferred over the 'Scroll' API for long-running paginated exports in modern Elasticsearch?
- A Scroll requests are unencrypted, while PIT uses TLS by default.
- B Decoupled Context: PIT separates the 'frozen view' of the data from the searching logic. This prevents 'Search Context' timeouts and allows for more flexible sorting without locking the old segments as aggressively as Scroll.
- C Scroll can only return up to 100 documents per batch.
- D PIT uses the GPU for sorting, making it 50x faster than Scroll.
Answer: B. Decoupled Context: PIT separates the 'frozen view' of the data from the searching logic. This prevents 'Search Context' timeouts and allows for more flexible sorting without locking the old segments as aggressively as Scroll.
Scroll is a legacy stateful session. If a search takes too long, the scroll context expires and you lose your place. PIT with `search_after` is stateless from the cluster's perspective, making it more resilient to node failures and background segment merging.
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?