1.

Define the terms Shard and Replica in ElasticSearch.

Answer»

Shard: Elasticsearch crashes are often caused by LARGE indexes. Due to the unlimited number of documents that can be stored on each index, an index may consume more disk space than the hosting server can provide. Indexing will begin to FAIL as soon as the index reaches this limit. As a SOLUTION to this problem, it is possible to divide or segment indexes horizontally into MULTIPLE pieces, also called shards. For an index, you can easily specify how many shards you want. As a result, every shard is its own, fully functional, and independent "index", which can run on any node in a cluster.

Replica: As the name implies, replicas are Elasticsearch fail-safe mechanisms, and are essentially copies of an index's shards. As a backup, this could come in handy when a node crashes. Furthermore, replicas can serve read requests, which is useful for increasing search performance. To ensure HIGH availability, replicas must not be placed on the same node as the original shard (called the "primary shared") from which they were replicated.



Discussion

No Comment Found