Hybrid MongoDB cluster and number of nodes

Welcome to the MongoDB Community @Samuel_VISCAPI!

To provide more certainty to @Prasad_Saya’s answer: as long as you are using compatible server versions (ideally, identical) the replication protocol is cross-platform and a replica set can have members using different operating systems.

However, generally you would want data-bearing replica set members to have similar configurations so performance and failover is more predictable. Performance, security, and tuning will vary between operating systems on otherwise identical hardware.

Unfortunately this is inaccurate terminology. However I realise it is used in one of our MongoDB University courses and have raised an issue to review this usage.

The replication oplog records operations affecting data as ordered sequences of idempotent changes based on the original command and the affected documents. Oplog operations produce the same results whether applied once or multiple times to the target dataset, which would not be the case if the original statement was used. For example, a command deleting a range of documents (eg db.mydata.remove({expired: true}) will result in an oplog entry for every document deleted on the primary to ensure all members of the replica set apply identical changes.

I think it is important to call out this difference, as statement-based replication in the SQL world can lead to significant side effects (especially when stored procedures are involved). For some example caveats, see MySQL’s Advantages and Disadvantages of Statement-Based and Row-Based Replication.

A better description for MongoDB’s approach might be document-based replication, or perhaps logical replication (as opposed to physical). We need to agree on that when revising the course material :slight_smile: .

I recommend you avoid using an arbiter in a production environment with modern versions of MongoDB. Arbiters are not ideal (see my comment on Replica set with 3 DB Nodes and 1 Arbiter) and the operational consequences will be more disruptive with an active cluster.

Regards,
Stennie

1 Like