0
0
MongoDBquery~5 mins

Primary and secondary nodes in MongoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a primary node in MongoDB?
A primary node is the main server in a MongoDB replica set that receives all write operations. It replicates data to secondary nodes.
Click to reveal answer
beginner
What is a secondary node in MongoDB?
A secondary node is a server in a MongoDB replica set that copies data from the primary node and can serve read operations.
Click to reveal answer
beginner
Why does MongoDB use primary and secondary nodes?
To ensure data is safe and available. The primary handles writes, and secondaries keep copies to protect against failure and allow reads.
Click to reveal answer
intermediate
What happens if the primary node fails in MongoDB?
The replica set automatically elects a new primary from the secondary nodes to keep the database working without interruption.
Click to reveal answer
beginner
Can secondary nodes accept write operations directly?
No, only the primary node accepts writes. Secondary nodes replicate data from the primary and can serve reads if configured.
Click to reveal answer
What role does the primary node play in a MongoDB replica set?
AElects secondary nodes
BHandles all write operations
COnly serves read operations
DBacks up data to cloud
What is the main purpose of secondary nodes?
ATo elect the primary node
BTo accept write operations
CTo replicate data from the primary
DTo delete old data
If the primary node fails, what happens next?
AA secondary node is elected as the new primary
BThe database stops working
CAll data is lost
DThe primary node repairs itself automatically
Can secondary nodes serve read requests in MongoDB?
AOnly for write operations
BNo, only primary nodes can serve reads
COnly during primary failure
DYes, if configured to do so
Which node type in MongoDB replica set accepts write operations?
APrimary node
BSecondary node
CBoth primary and secondary
DNeither primary nor secondary
Explain the roles of primary and secondary nodes in a MongoDB replica set.
Think about who writes data and who copies it.
You got /4 concepts.
    Describe what happens during a primary node failure in MongoDB.
    Focus on failover and election process.
    You got /4 concepts.