Web / Apache Solr Interview questions
When would you choose sharding over replication in SolrCloud?
Sharding and replication solve different problems, and confusing them leads to either wasted hardware or a cluster that can't handle its data volume.
- Replication - copies the same full data set to more nodes. Use it when a single shard's index already fits comfortably on one node's disk and memory, but you need more read throughput or fault tolerance.
- Sharding - splits the data set across nodes. Use it when the collection is too large to fit, or perform well, on a single node - either the index size exceeds available memory for caching, or a single node can't sustain the indexing rate.
In practice these are combined: a large collection is split into several shards for size, and each shard is then replicated for availability and read scaling. The decision to add more shards versus more replicas should be driven by measuring whether the bottleneck is data volume/indexing load (add shards) or query concurrency (add replicas).
More Related questions...