🔍 Elasticsearch
Beginner
What is a shard and why does it matter in Elasticsearch?
Answer
A shard is the fundamental unit of storage and scalability in Elasticsearch. When you create an index, Elasticsearch divides it into a configurable number of primary shards (default is 1 in ES 7+). Each shard is an independent Lucene index that can be hosted on any node in the cluster. Sharding matters because it enables horizontal scaling: adding more nodes allows shards to redistribute, increasing storage capacity and search throughput. However, the number of primary shards is fixed at index creation time, so you must plan shard count carefully upfront. The rule of thumb is 20–40 GB per shard.
Previous
What is a cluster, node, shard, and replica in Elasticsearch?
Next
What is the difference between primary and replica shards?