High Availability

Cluster options

To guarantee partition tolerance, only odd numbers of cluster members are allowed. Furthermore, for the time being, single node MongoDB clusters are not permitted. This leaves you with the option of 3, 5, or 7 instances per cluster.
All of these sizes are automatically highly available and replicate your data between instances. One instance is the primary, which accepts write transactions, and the others are secondary, which can optionally be used for read operations.


All instances in an IONOS MongoDB cluster are members of the same replica set, so all secondary instances replicate the data from the primary instance.
By default the write concern before acknowledging a write operations is set to "majority" with j: true. The term "majority" means the write operation must be propagated to the majority of instances. In a three-instance cluster, for example, at least two instances must have the operation before the primary acknowledges it. The j option also requires that the change has already been persisted to the on-disk journal of these instances.
If data is not replicated to the majority, it may be lost in the event of a primary instance failure and subsequent rollback.

Changing the commit guarantees per transaction

You can change the write concern for single operations, for example due to performance reasons. See the official documentation on write concerns.

Read preferences

You can determine which instance to use for read operations by setting the read preference on the client side, if your client supports it.
If you read from the primary instance, you always get the most up-to-date data. You can spread the load by reading from secondary sources, but you might get stale data. However, you can get consistency guarantees using a read concern.