About Hidden Node

There’s something I don’t understand about hidden nodes.

  • A hidden member maintains a copy of the primary’s data set but is invisible to client applications.
  • Use hidden members for dedicated tasks such as reporting and backups.

I want to monitor or back up the hidden node’s data using the third-party solution according to the recommendation in the second sentence.
However, it is expected that the hidden node will not be visible in the program by the first sentence.

Then what is the meaning of the second sentence?
Under what conditions can hidden nodes be used for reporting or backup?

Hello @Kim_Hakseon,

However, it is expected that the hidden node will not be visible in the program by the first sentence.

The client application, in this case, means the client program that is connecting to the replica set. The client writes and reads data from the replica set. You specify the replica set’s uri from your client program (e.g., shell, NodeJS or Java program) to connect, read and write. This client program cannot connect to the hidden member in any case (only data replication happens). But, a client program can read data from other secondary members - when appropriate Read Preference is configured.

If the replica set’s primary crashes, an election takes place and a new member is elected as primary. And the client program reads and writes from the new primary. In such a scenario, the hidden member cannot become a primary.


Use hidden members for dedicated tasks such as reporting and backups

In a replica set, you can connect to a secondary member directly and perform read operations (e.g., query a collection). This capability allows you to extract the data needed from the hidden member for reporting and such tasks. Note that, the only operation happening on the hidden member is just the replication (copy of the write operations are written to this node).

1 Like

The conclusion of the answer is that the hidden node is invisible in the connection to the replica set (ex:mongodb://host1:27017,host2:27017,host3:27017/?replicaaSet:rs0), and can be seen in the direct access to the hidden node (ex:mongodb://host3:27017/).

Thank you so much. :smiley:

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.