Concept Flow - Primary and secondary nodes
Start: Replica Set Initiated
Elect Primary Node
Primary Accepts Writes
Primary Replicates Data
Secondary Nodes Receive Data
Secondaries Serve Reads (optional)
If Primary Fails
Election: New Primary Chosen
Continue Operations
The replica set starts, elects a primary node that handles writes and replicates data to secondary nodes, which can serve reads. If the primary fails, a new primary is elected to keep the system running.