content_image/808571.jpg
## Replica Set Secondary Members 

A secondary maintains a copy of the primary’s data set. To replicate data, a secondary applies operations from the primary’s oplog (page 593) to its own data set in an asynchronous process. A replica set can have one or more secondaries. 

The following three-member replica set has two secondary members. The secondaries replicate the primary’s oplog and apply the operations to their data sets. 

<img src='content_image/808571.jpg'>

Although clients cannot write data to secondaries, clients can read data from secondary members. See Read Preference (page 588) for more information on how clients direct read operations to replica sets. 

A secondary can become a primary. If the current primary becomes unavailable, the replica set holds an election to choose which of the secondaries becomes the new primary. 

In the following three-member replica set, the primary becomes unavailable. This triggers an election where one of the remaining secondaries becomes the new primary. 

See Replica Set Elections (page 580) for more details. 

You can configure a secondary member for a specific purpose. You can configure a secondary to: 

• Prevent it from becoming a primary in an election, which allows it to reside in a secondary data center or to serve as a cold standby. See Priority 0 Replica Set Members (page 567). 

• Prevent applications from reading from it, which allows it to run applications that require separation from normal traffic. See Hidden Replica Set Members (page 569). 

• Keep a running “historical” snapshot for use in recovery from certain errors, such as unintentionally deleted databases. See Delayed Replica Set Members (page 570). 

## Priority 0 Replica Set Members 

A priority 0 member is a secondary that cannot become primary . Priority 0 members cannot trigger elections . Otherwise these members function as normal secondaries. A priority 0 member maintains a copy of the data set, accepts read operations, and votes in elections. Configure a priority 0 member to prevent secondaries from becoming primary, which is particularly useful in multi-data center deployments. 

In a three-member replica set, in one data center hosts the primary and a secondary. A second data center hosts one priority 0 member that cannot become primary. 

