MongoDB replica set
A MongoDB replica set is a group of server instances maintaining synchronized data copies, with an elected primary for writes and automatic failover.
MongoDB 8.0 in Action, Third Edition
A replica set is a group of database servers that maintain replicated copies of data with automatic primary election for availability.
- How it is used
- Provides redundant data copies and primary failover, including within shards and config servers in a sharded cluster.
- How deep it goes
- Defines members and their roles, then identifies election voting and the oplog without walking through replica-set configuration commands.
- Examples
- Illustrates failover when a shard primary fails and diagrams shards and config servers as replica sets.
- What you can do after
- Evaluate/understand when replication improves availability and read capacity, and when sharding is needed to address write bottlenecks.
Read how MongoDB 8.0 in Action, Third Edition explains MongoDB replica set →
Kubernetes in Action, Second Edition
A MongoDB replica set is a group of MongoDB server instances that maintain replicated data and designate a primary for write operations.
- How it is used
- Deploys replicated MongoDB as a stateful Kubernetes workload with per-replica storage, identity, and initialization.
- How deep it goes
- Explains storage and addressing requirements, StatefulSet artifacts, initialization, readiness failures, and inspection commands.
- Examples
- Uses a three-pod quiz deployment, per-pod claims, stable DNS names, and an rs.initiate command.
- What you can do after
- Operate/configure a three-member replica set with kubectl, mongosh, stable Services, and per-pod persistent claims.
Read how Kubernetes in Action, Second Edition explains MongoDB replica set →
Related concepts
- read preferenceconfigured by · Read preference is a database-client policy specifying which replica roles or locations may serve read operations.
- Kubernetes operatorconfigured by · A Kubernetes operator is a controller pattern that extends Kubernetes to automate application or service management by reconciling desired and actual state through the Kubernetes API.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

