﻿---
title: Clusters, nodes, and shards
description: You can add servers (nodes) to a cluster to increase capacity, and Elasticsearch automatically distributes your data and query load across all available...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/deploy-manage/distributed-architecture/clusters-nodes-shards
products:
  - Elasticsearch
applies_to:
  - Elastic Stack: Generally available
---

# Clusters, nodes, and shards
<note>
  Nodes and shards are what make Elasticsearch distributed and scalable. These concepts aren’t essential if you’re just getting started. How you [deploy Elasticsearch](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/get-started/deployment-options) in production determines what you need to know:
  - **Self-managed Elasticsearch**: You are responsible for setting up and managing clusters, nodes, shards, and replicas. This includes managing the underlying infrastructure, scaling, and ensuring high availability through failover and backup strategies.
  - **Managed deployments**: This includes deployments on ECH, ECE, and ECK. Elastic can autoscale resources in response to workload changes. Choose from different deployment types to apply sensible defaults for your use case. A basic understanding of nodes, shards, and replicas is still important.
  - **Elastic Cloud Serverless**: You don’t need to worry about nodes, shards, or replicas. These resources are 100% automated on the serverless platform, which is designed to scale with your workload.
</note>

You can add servers (*nodes*) to a cluster to increase capacity, and Elasticsearch automatically distributes your data and query load across all available nodes.
Elasticsearch does that in part by subdividing each index into one or more *shards*.
Each shard is a self-contained [Apache Lucene](https://lucene.apache.org/) index with practical limits on how much data it can efficiently manage, so splitting data across multiple shards keeps individual shards performant. Distributing those shards across cluster nodes adds horizontal scaling and redundancy.
The right number of shards depends on your data volume, query patterns, and cluster topology — there is no single correct answer. Refer to [shard sizing and distribution recommendations](/elastic/docs-content/pull/6483/deploy-manage/production-guidance/optimize-performance/size-shards#sizing-shard-guidelines) for more information and best practices.
There are two types of shards:
- **Primary shards**: Every document belongs to exactly one primary shard. The number of primary shards is fixed at index creation, either through an [index template](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/manage-data/data-store/templates) or the [`index.number_of_shards`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#index-number-of-shards) setting in the create index request.
- **Replica shards**: These are copies of primary shards that provide redundancy and serve read requests. You can adjust the number of replicas at any time using the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) setting. Changing the replica count does not interrupt indexing or query operations.

Shard copies in your cluster are automatically balanced across nodes to provide scale and high availability. All nodes are aware of all the other nodes in the cluster and can forward client requests to the appropriate node. This allows Elasticsearch to distribute indexing and query load across the cluster.
If you’re exploring Elasticsearch for the first time or working in a development environment, then you can use a cluster with a single node and create indices with only one shard. However, in a production environment, you should build a cluster with multiple nodes and indices with multiple shards to increase performance and resilience.
- To learn about optimizing the number and size of shards in your cluster, refer to [Size your shards](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/deploy-manage/production-guidance/optimize-performance/size-shards).
- To learn about how read and write operations are replicated across shards and shard copies, refer to [Reading and writing documents](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/deploy-manage/distributed-architecture/reading-and-writing-documents).
- To adjust how shards are allocated and balanced across nodes, refer to [Shard allocation, relocation, and recovery](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/6483/deploy-manage/distributed-architecture/shard-allocation-relocation-recovery).