Whether it is a replica set instance or a cluster version instance, the underlying layer uses multiple replicas to store data. Multiple replicas form a replica set, which normally contains 1 primary node, 1 hidden node, and 1 or more secondary nodes.
The primary node undertakes data write requests, while the secondary and hidden nodes update data via oplog logs.
By default, the user's read and write requests are sent to the primary node for processing, and the overall performance is limited by the resources of the primary node.
Users can adjust the configuration parameters to send read requests to the secondary node by using the following method. The performance of the system can be greatly improved by read write separation.