Primary node and nodes in the cluster

Hi,
please explain what is node and primary node in mongodb? what are the differences between them.
Thanks!!

Hi !
Nodes are servers hosting a “mongod” instance containing your data.
The replication allows you to have several nodes : if one goes down, you can still access your data.

The primary node is a little bit different : in addition to containing your data, it receives all write operations.

You can read more here :
https://docs.mongodb.com/manual/replication/#replication-in-mongodb

Hope having helped you !

2 Likes

Hi @Aqsa_22856,

In addition to @Geoffrey_91795.

In MongoDB, the concept of replication allows you to have multiple copies of the same data on different nodes/servers. This is to ensure redundancy and high availability of the data.

Primary node is also a data bearing node just like any other secondary node except it has some additional responsibility such as the primary node receives all write operations.

If you want to know more about replication then you can refer our documentation or checkout M103: Basic Cluster Administration course.

If you still have any query, please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer