QUIZ QUESTIONS AND ANSWERS
Question: Why do we use replica sets? Check all that apply.
- High Availability (Ans)
- Durability (Ans)
- Scaling in some situations (Ans)
- Disaster Recovery (Ans)
- As main backup
Question: Which of the following are true about replication in MongoDB?
- Works on commodity hardware (Ans)
- Supports a model of replications with single primary and multiple secondaries (Ans)
- Also supports multi-master replication
- Works across wide-area networks (Ans)
- Provides eventual consistency (Ans)
Question: Imagine a replica set with 5 servers. What is the minimum number of servers (assume each server has 1 vote) to form a consensus?
- 3 (Ans)
Question: Which of the following scenarios can trigger a rollback?
- A secondary (that was previously a primary) contains write operations that are ahead of current primary (Ans)
- A secondary lags behind the primary by 2 hours or more
- A secondary lags behind the primary by 100 writes or more
Question: Why do we give replica sets names?
- There is no way for any system to implement replication without a name.
- Having a single name to refer to set reduces confusion and human error. (Ans)
- Replication sets are sentient, and deserve to receive names.
- Replication set members should all be hosted on a single box, and the name uniquely identifies that box.
Question: What does optimeDate represent?
- The servers time
- The time of the last operation (Ans)
- The time of the first operation
- The last heartbeat
The time the status command was run
Question: Which command prevents a node from becoming primary for 5 minutes?
- rs.stepDown(300) (Ans)
- rs.freeze(300) (Ans)
Question: When a primary goes down and then is brought back online, it will always resume primary status:
- False (Ans)
Question: What are good reasons to read from a secondary? Check all that apply.
- Geographic reads (latency) (Ans)
- Separate a workload (analytics/reporting) (Ans)
- High availability (during fail over) (Ans)
- Primary is overloaded with writes and cann’t handle reads
- Require consistent reads
Question: For reads which must be consistent, which read preference(s) is used?
- Primary (Ans)
- Primary Preferred
- Secondary Preferred