High availability of a Yandex StoreDoc cluster
The high availability of a Yandex StoreDoc cluster depends on the SLA
Number and placement of cluster hosts
For a non-sharded cluster
A single-host cluster does not provide high availability. If the primary replica fails, your cluster becomes unavailable for reading and writing until the replica is recovered.
If your cluster has at least two hosts, it remains available if one of them fails.
A cluster with two or more hosts located in different availability zones remains available for reading if one zone fails. To keep the cluster available for writing, each availability zone must contain no more than half of all the cluster's hosts.
Hidden hosts do not affect cluster availability and are not included in the calculations.
For a cluster with standard sharding
A cluster remains tolerant to a single zone failure under the following conditions:
- The cluster has at least two
MONGOINFRAhosts. - No availability zone contains more than half of all
MONGOINFRAhosts. - Each shard has at least two
MONGODhosts. - No availability zone contains more than half of
MONGODhosts that belong to a single shard.
Hidden hosts do not affect cluster availability and are not included in the calculations.
For a cluster with advanced sharding
A cluster remains tolerant to a single zone failure under the following conditions:
- The cluster has at least two
MONGOShosts and twoMONGOCFGhosts. - No availability zone contains more than half of all
MONGOSorMONGOCFGhosts. - Each shard has at least two
MONGODhosts. - No availability zone contains more than half of
MONGODhosts that belong to a single shard.
Hidden hosts do not affect cluster availability and are not included in the calculations.
Backups
If a cluster goes down, you can restore it from a backup.
To ensure data integrity and acceptable cluster recovery time:
- Make sure the cluster is running and automatic backups are under way at the scheduled backup start time.
- Set the backup retention period as needed.
- Perform manual backups before making important changes. Manual backups are stored with no time limit.
- Regularly test cluster recovery from backups.
Connecting to Yandex StoreDoc
Yandex StoreDoc cluster availability depends on the connection method and settings:
-
Only use recommended clients for connection.
-
Enable public access and configure security groups for each cluster host.
Warning
If public access is not configured for all cluster hosts, automatic primary replica failover may render the cluster unavailable from the internet.
Available storage space
Yandex StoreDoc monitors how much disk space is used and automatically activates Read only mode for those cluster hosts that have:
- Less than 500 MB of free disk space left (if the host storage size is less than 600 GB).
- Less than 5 GB of free disk space left (if the host storage size is 600 GB or more).
To keep your cluster's hosts writable, regularly check its Disk space usage per host chart or create an alert with the disk.free_bytes metric.
Virtual machine type
Cluster availability depends on the type of VMs you use to deploy your hosts. A highly available cluster should use a VM type with a 100% vCPU guarantee. The burstable VM type with a 50% vCPU guarantee does not ensure high availability and should only be used for test environments.
Maintaining a cluster and modifying its parameters
The following operations may lead to interrupted database connections and temporary performance degradation:
- Maintenance start (you set the start time when you select the maintenance window).
- Host class change.
- Automatic and manual database backups.
Run these operations when the cluster load is minimal.
Warning
These operations may trigger a primary replica switch. If the cluster has no hosts that can become the new primary replica, it is rendered temporarily unavailable.