C100DBA Sharding Practice Question
A MongoDB DBA is configuring a new sharded cluster. The application requires that queries on the sharded collection include the shard key to avoid scatter-gather. The DBA decides to use a ranged shard key on the field 'region'. After sharding, the DBA notices that queries filtering only on 'region' are performing well, but queries that also filter on 'city' are still scanning all shards. What is the most likely cause?
⚠ Common exam trap
The trap here is assuming that any indexed field can be used for shard targeting, when only the shard key determines routing.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The shard key does not include 'city', so queries with both 'region' and 'city' cannot be targeted to a single shard.
Query targeting in a sharded cluster depends on the shard key. If the shard key is only 'region', queries that filter on 'region' can be routed to specific shards. Adding 'city' does not change the routing because 'city' is not part of the shard key. To target on both fields, the shard key would need to be compound, including both 'region' and 'city'.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The 'city' field is not indexed, causing the query to scan all shards.
Why it's wrong here
Indexes on non-shard-key fields do not affect shard targeting. Even with an index on 'city', the mongos cannot use it to route queries because routing is based solely on the shard key. The lack of an index may slow down the query on each shard, but it does not cause scatter-gather across shards.
- ✓
The shard key does not include 'city', so queries with both 'region' and 'city' cannot be targeted to a single shard.
Why this is correct
In a sharded cluster, only queries that include the shard key can be routed to specific shards. Since the shard key is only 'region', a query with both 'region' and 'city' still only uses 'region' for targeting. The 'city' filter is applied after routing, so the query may still target multiple shards if the region spans them, but it is not scatter-gather across all shards solely due to 'city'.
- ✗
The balancer has not yet distributed chunks evenly, so some shards have more data and cause the query to scan them.
Why it's wrong here
The balancer affects data distribution but not query routing. Even if chunks are unevenly distributed, a query that includes the shard key will still be routed to the shards that own the relevant chunks. Uneven distribution might affect performance, but it does not cause a query to scan all shards when the shard key is present.
- ✗
The shard key 'region' has low cardinality, so queries cannot be targeted efficiently.
Why it's wrong here
Low cardinality can lead to large chunks and uneven distribution, but it does not prevent targeting. If a query includes the shard key 'region', mongos can still route it to the shard(s) holding that region value. The issue described is about including 'city', which is not part of the shard key, so cardinality of 'region' is not the cause.
About these practice questions
This C100DBA question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.