A classic problem facing MongoDB developers is the lack of enough hardware to properly set up and test a replica set. Furthermore, even though some developers either have the requisite hardware or have access to a properly equipped lab, the computers available are often old and dissimilar, leading to inconsistent results during development and testing. One possible solution to this problem is to use virtualization technology to model a replica set.
As of the time of writing, MongoDB Atlas offers a free sandbox tier that provides a 3-member replica set across availability zones and 500 MB of storage. For more information, refer to https://www.mongodb.com/cloud/atlas.
The way to start this setup is to create a Dockerfile for each member of the replica set, examined next. You can find these files in /path/to/repo/chapters/13.