Questions about MongoDB
-
Why should I use MongoDB in Managed Service for MongoDB rather than my own VM-based installation?
-
Can I deploy a MongoDB cluster in multiple availability zones?
-
Why is the cluster slow even though the computing resources are not used fully?
-
How do I get access to the local.oplog.rs service collection?
-
Can I connect to cluster hosts via SSH or get superuser permissions on hosts?
Why should I use MongoDB in Managed Service for MongoDB rather than my own VM-based installation?
Managed Service for MongoDB automates routine database maintenance:
- Quick DB deployment with the necessary available resources.
- Data backup.
- Regular software updates.
- Providing DB cluster failover.
- Database usage monitoring and statistics.
What happens to a cluster if one of its hosts fails?
If there are more than one replica in the database cluster, it will continue working if a host fails.
The only way data may be lost is if the cluster's only host fails.
Can I deploy a MongoDB cluster in multiple availability zones?
Yes. A database cluster may consist of hosts that reside in different availability zones and even different availability regions.
What is the backup procedure for MongoDB clusters?
Backups are created every 24 hours and stored for seven days after being created. You can restore data only as of the backup creation time.
How does replication work for MongoDB?
Managed Service for MongoDB uses the standard MongoDB replication mechanism: if a cluster has more than one active host, one of them is automatically selected as the primary server to handle write requests.
For more information about how replication works in MongoDB, read the relevant documentation
What limitations are imposed on MongoDB database clusters?
For more information on limits in Managed Service for MongoDB, see Quotas and limits.
Why is the cluster slow even though the computing resources are not used fully?
Perhaps, the maximum storage IOPS and bandwidth values are insufficient for processing the current number of requests. In this case, throttling is triggered and the performance of the entire cluster degrades.
The maximum IOPS and bandwidth values increase by a fixed value when the storage size increases by a certain step. The step and increment values depend on the disk type:
Disk type | Step, GB | Max IOPS increase (read/write) | Max bandwidth increase (read/write), MB/s |
---|---|---|---|
network-hdd |
256 | 300/300 | 30/30 |
network-ssd |
32 | 1,000/1,000 | 15/15 |
network-ssd-nonreplicated |
93 | 28,000/5,600 | 110/82 |
To increase the maximum IOPS and bandwidth values and make throttling less likely, increase the storage size when you update your cluster.
If you are using the network-hdd
storage type, consider switching to network-ssd
or network-ssd-nonreplicated
by restoring the cluster from a backup.
How do I get access to the local.oplog.rs service collection?
To grant a user read access to oplog
, assign them the mdbReplication
role in the admin
database. To do this, run the following command in the Yandex Cloud CLI:
yc managed-mongodb user update <username> \
--cluster-name <cluster_name> \
--permission database=admin,role=mdbReplication,role=<other_role>,... \
--permission database=<other_DB_name>,role=<role>,...
To avoid deleting user roles that are already assigned, list both the existing and new roles in the command.
Can I connect to cluster hosts via SSH or get superuser permissions on hosts?
You cannot connect to hosts via SSH, nor can you get superuser permissions. This is done for the sake of security and user cluster fault tolerance because direct changes inside a host can render it completely inoperable.