MongoDB Quiz

Connect with

Building a Sharded Environment

If you want to build a production system with two shards, each one a replica set with three nodes, how may mongod processes must you start?

a) 2
b) 6
c) 7
d) 9

Ans: d, (2 shards has 6 nodes and 3 config nodes)

Implications of Sharding

Suppose you wanted to shard the zip code collection after importing it. You want to shard on zip code. What index would be required to allow MongoDB to shard on zip code?

a) An index on zip or a non-multi-key index that starts with zip.
b) No index is required to use zip as the shard key.
c) A unique index on the zip code.
d) Any index that includes the zip code.

Ans: a

Sharding + Replication

Suppose you want to run multiple mongos routers for redundancy. What level of the stack will assure that you can failover to a different mongos from within your application?

a) mongod
b) mongos
c) drivers
d) sharding config servers

Ans: c

Choosing a Shard Key

You are building a facebook competitor called footbook that will be a mobile social network of feet. You have decided that your primary data structure for posts to the wall will look like this:

{'username':'toeguy',
     'posttime':ISODate("2012-12-02T23:12:23Z"),
     "randomthought": "I am looking at my feet right now",
     'visible_to':['friends','family', 'walkers']}

Thinking about the tradeoffs of shard key selection, select the true statements below.

a) Choosing posttime as the shard key will cause hotspotting as time progresses.
b) Choosing username as the shard key will distribute posts to the wall well across the shards.
c) Choosing visible_to as a shard key is illegal.
d) Choosing posttime as the shard key suffers from low cardinality.

Ans: a, b and c

Which of the following statements are true about MongoDB replication. Check all that apply.

a) The minimum sensible number of voting nodes to a replica set is three.
b) MongoDB replication is synchronous.
c) The Mongo shell is capable of attaching to a replica set and automatically failing over.
d) By default, using the new MongoClient connection class, w=1 and j=1.
e) The oplog utilizes a capped collection.

Ans: a and e


Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *