Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a shard in Elasticsearch?
A shard is a basic unit of storage in Elasticsearch. It holds a subset of the data and allows Elasticsearch to distribute and parallelize data across nodes.
Click to reveal answer
beginner
Why is shard sizing important in Elasticsearch?
Shard sizing is important because too small shards cause overhead and resource waste, while too large shards can slow down search and indexing performance.
Click to reveal answer
intermediate
What is the recommended shard size range for Elasticsearch?
A common recommendation is to keep shard sizes between 10GB and 50GB to balance performance and resource use.
Click to reveal answer
intermediate
How does shard sizing affect cluster recovery time?
Larger shards take longer to recover because more data must be copied or rebuilt, so keeping shard sizes moderate helps reduce recovery time.
Click to reveal answer
advanced
What factors should you consider when deciding shard size?
Consider data volume, query patterns, hardware resources, and cluster size to choose shard sizes that optimize performance and manageability.
Click to reveal answer
What happens if shards are too small in Elasticsearch?
AIncreased overhead and wasted resources
BFaster search performance
CReduced cluster size
DAutomatic shard merging
✗ Incorrect
Too small shards cause overhead because each shard uses resources, so many small shards waste memory and CPU.
What is a good shard size range to aim for in Elasticsearch?
A1GB to 5GB
B100GB to 200GB
C10GB to 50GB
DOver 500GB
✗ Incorrect
10GB to 50GB is a common recommended range balancing performance and resource use.
How does shard size affect cluster recovery?
AShard size does not affect recovery
BLarger shards increase recovery time
CSmaller shards increase recovery time
DRecovery time depends only on network speed
✗ Incorrect
Larger shards take longer to recover because more data must be transferred or rebuilt.
Which factor is NOT important when choosing shard size?
AData volume
BQuery patterns
CHardware resources
DColor of the server rack
✗ Incorrect
The color of the server rack has no impact on shard sizing.
What is a shard in Elasticsearch?
AA unit of data storage
BA visualization tool
CA network protocol
DA type of query
✗ Incorrect
A shard is a unit of data storage that holds part of the index data.
Explain why shard sizing matters in Elasticsearch and what happens if shards are too large or too small.
Think about how shard size impacts speed and resource use.
You got /3 concepts.
List the key factors to consider when deciding the shard size for an Elasticsearch cluster.
Consider what affects performance and manageability.
You got /4 concepts.
Practice
(1/5)
1. What is the main reason to choose an appropriate shard size in Elasticsearch?
easy
A. To balance data storage and search performance
B. To increase the number of replicas
C. To reduce the number of indices
D. To avoid using any replicas
Solution
Step 1: Understand shard purpose
Shards split data to distribute storage and speed up search operations.
Step 2: Connect shard size to performance
Choosing the right shard size balances storage efficiency and search speed.
Final Answer:
To balance data storage and search performance -> Option A
Quick Check:
Shard size affects performance balance = A [OK]
Hint: Shard size balances storage and speed [OK]
Common Mistakes:
Thinking replicas control shard size
Confusing shard count with replica count
Assuming more shards always improve speed
2. Which setting controls the number of primary shards when creating an Elasticsearch index?
easy
A. number_of_shards
B. number_of_replicas
C. shard_size
D. index_refresh_interval
Solution
Step 1: Identify shard count setting
The setting number_of_shards defines how many primary shards an index has.
Step 2: Differentiate from replicas
number_of_replicas controls copies, not primary shard count.
Final Answer:
number_of_shards -> Option A
Quick Check:
Primary shards = number_of_shards [OK]
Hint: Primary shards set by number_of_shards [OK]
Common Mistakes:
Confusing replicas with shards
Using shard_size which is not a setting
Mixing index refresh with shard count
3. Given an index with 5 primary shards and each shard sized at 20GB, what is the total data size stored in the index?
medium
A. 20GB
B. 100GB
C. 25GB
D. 5GB
Solution
Step 1: Calculate total size from shards
Total size = number of shards x size per shard = 5 x 20GB = 100GB.
Step 2: Confirm no replicas included
Replicas add copies but do not affect primary data size calculation here.
Final Answer:
100GB -> Option B
Quick Check:
5 shards x 20GB = 100GB [OK]
Hint: Multiply shards by shard size [OK]
Common Mistakes:
Adding replica size to primary data size
Confusing shard count with replica count
Choosing shard size instead of total
4. You set number_of_shards to 1 but your data size grows to 200GB. What is the main problem with this shard sizing?
medium
A. Index refresh interval is too short
B. Too many shards causing overhead
C. Replica count is zero
D. Shard size is too large, causing slower search and indexing
Solution
Step 1: Analyze shard size impact
One shard holding 200GB is large and can slow down search and indexing.
Step 2: Identify correct problem
Too few shards for large data causes performance issues, not replica count or refresh interval.
Final Answer:
Shard size is too large, causing slower search and indexing -> Option D
Quick Check:
Large shard size = slower performance [OK]
Hint: Avoid very large single shards [OK]
Common Mistakes:
Blaming replica count instead of shard size
Thinking many shards cause this problem
Ignoring shard size impact on speed
5. You have 500GB of data and want to keep shard sizes between 10GB and 40GB. Which shard count is best to set for your index?