Courseiva
Application Administration →mediumMultiple Choice

C100DBA Application Administration Practice Question

A MongoDB DBA is configuring a new application to connect to a sharded cluster. The application requires that reads are distributed across shards and that the driver automatically routes queries to the appropriate shard based on the shard key. Which component must be included in the connection string to enable this routing?

⚠ Common exam trap

The trap here is thinking that connecting directly to shards or config servers will enable automatic routing; only mongos provides that functionality.

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 mongos router hostname and port.

In a sharded cluster, applications must connect to mongos routers, which are responsible for routing queries to the appropriate shards based on the shard key. The connection string should include the hostnames and ports of mongos instances. Connecting directly to config servers or shards bypasses the routing layer and is not supported for application traffic.

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 config server replica set hostnames and ports.

    Why it's wrong here

    Config servers store metadata about the cluster's sharding configuration, but applications must not connect directly to them. Connecting to config servers would bypass the mongos routing layer and likely result in errors or incorrect behavior. The driver requires mongos for query routing.

  • ✗

    The replica set name of the shards.

    Why it's wrong here

    Specifying a replica set name is necessary when connecting directly to a replica set, but for a sharded cluster, the driver must connect to mongos. The replica set name of shards is not used in the application connection string; mongos handles the routing.

  • ✓

    The mongos router hostname and port.

    Why this is correct

    In a sharded cluster, mongos routers are responsible for routing queries to the appropriate shards based on the shard key. The application must connect to mongos instances; the driver does not perform shard routing itself. Including the mongos hostname and port in the connection string ensures queries are correctly routed.

  • ✗

    The shard replica set hostnames and ports.

    Why it's wrong here

    Shard replica sets store the actual data, but applications should not connect directly to them for normal operations. Direct connections bypass mongos, preventing automatic shard routing and potentially causing inconsistent reads or writes. The connection string must target mongos.

About these practice questions

One of 222 original C100DBA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.