Scaling search and indexing
hard 28 minHow a search cluster grows: the right number and size of shards, replicas for reads and safety, safe placement, storage tiers for old data, rebuilding without downtime, and rules for scaling up and down.
Where it shows up
The same pattern appears across everyday software.
Shop catalogue
Little data, many reads. One or two primaries with several replicas, more before sales days, and a rebuild behind an alias when the analyzer changes.
Application logs
Much data, many writes, few reads. Rollover, tiers, and deletion of whole indices. Searches name a time range and skip most indices.
Elasticsearch shard limits
The documentation allows 1,000 shards that are not frozen on a node by default and recommends 10 to 50 GB a shard, with fewer than 200 million documents.
Solr replica types
NRT replicas index each document themselves. TLOG and PULL replicas copy finished segments from the leader, which saves CPU.
Searchable snapshots
Elasticsearch can search indices kept in a snapshot repository. The frozen tier mounts them partly and keeps only a cache locally.
Multi-tenant search
Small customers share an index, with routing by customer. A large one gets an index of its own, because an index for each small customer means thousands of tiny shards.