Elasticsearch & Lucene (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
How does the Write Path work in a distributed Elasticsearch cluster?
senior LevelSystem Design
In Simple Words:
- Client sends write request to any node (Coordinating Node).
- Coordinating node determines the Primary Shard location via
hash(routing). - Request forwards to node holding the Primary Shard.
- Primary validates the document, writes locally, and forwards the write in parallel to all in-sync Replica Shards.
- Once all active replicas acknowledge the write, the Primary sends success to Coordinating Node, which responds to the client.