nerdexam
MongoDB

C100DBA · Question #31

In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?

The correct answer is C. individual language drivers. Individual language drivers (C) are responsible for mongos failover because clients connect to mongos instances via a connection string that can list multiple mongos addresses. When one mongos becomes unavailable, the driver detects the connection failure and automatically…

Sharding

Question

In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?

Options

  • Amongos
  • Bmongo shell
  • Cindividual language drivers
  • Dmongod

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    11% (5)
  • C
    80% (36)
  • D
    7% (3)

Explanation

Individual language drivers (C) are responsible for mongos failover because clients connect to mongos instances via a connection string that can list multiple mongos addresses. When one mongos becomes unavailable, the driver detects the connection failure and automatically retries against another mongos in that list - the failover logic lives entirely on the client side.

Why the distractors are wrong:

  • A. mongos - mongos is a stateless query router; it has no awareness of or coordination with peer mongos instances, so it cannot orchestrate its own failover.
  • B. mongo shell - the shell is just an interactive client tool; while it uses a driver internally, "the shell" is not the mechanism that handles failover in production applications.
  • D. mongod - mongod handles replica set elections (failover within a shard), but it has no role in deciding which mongos a client uses next.

Memory tip: Think of it this way - mongos is like a load balancer endpoint; if one goes down, your code (the driver) has to pick another. MongoDB doesn't add a separate "mongos manager" layer, so responsibility falls to the caller - the driver.

Topics

#mongos#sharding#failover#language drivers

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice