🔍 Elasticsearch
Beginner
What is the difference between primary and replica shards?
Answer
Primary shards are the authoritative copies of your data. When you index a document, it is written to the primary shard first, then replicated to replica shards. Replica shards are copies of primary shards stored on different nodes. They serve two purposes: high availability — if the node holding a primary shard fails, Elasticsearch promotes a replica to primary automatically — and read scalability — search queries can be routed to both primary and replica shards, so more replicas means more search capacity. Note that replica shards require extra storage and must be on a different node than their primary.
Previous
What is a shard and why does it matter in Elasticsearch?
Next
How do you create an index in Elasticsearch?