Managed Service for MySQL® storage
Managed Service for MySQL® allows you to use network and local storage drives for database clusters. Network drives are based on network blocks, which are virtual disks in the Yandex Cloud infrastructure. Local disks are physically located on the database host servers.
When creating a cluster, you can select the following disk types for data storage:
-
Network HDDs (
network-hdd): Most cost-effective option for clusters that do not require high read/write performance. -
Network SSDs (
network-ssd): Balanced solution. Such disks are slower than local SSD storage, but, unlike local disks, they ensure data integrity if Yandex Cloud hardware fails. -
Non-replicated SSDs (
network-ssd-nonreplicated): Network disks with enhanced performance achieved by eliminating redundancy.The storage size can only be increased in 93 GB increments.
-
Ultra high-speed network SSDs with three replicas (
network-ssd-io-m3): Network disks with the same performance characteristics as non-replicated ones. This disk type provides redundancy.Such disks can be increased in size only in 93 GB increments.
-
Local SSDs (
local-ssd): Disks with the best performance.The size of such a storage can be increased:
- For Intel Broadwell and Intel Cascade Lake: Only in 100 GB increments.
- For Intel Ice Lake: In 368 GB increments only.
For clusters with hosts residing in the
ru-central1-davailability zone, local SSD storage is not available if using Intel Cascade Lake.
Note
Up to 5% of disk space is reserved for system use, so the disks may have less available space than indicated when creating a cluster.
For more information about sizes and performance of different disk types, see the Yandex Compute Cloud documentation.
Selecting disk type during cluster creation
The number of hosts you can create together with a MySQL® cluster depends on the selected disk type:
-
You can create a cluster only with three or more hosts when using the following disk types:
- Local SSDs (
local-ssd) - Non-replicated SSDs (
network-ssd-nonreplicated)
This cluster will be highly available.
Local SSD storage has an effect on how much a cluster will cost: you pay for it even if it is stopped. For more information, refer to the pricing policy.
- Local SSDs (
-
You can add any number of hosts within the current quota when using the following disk types:
- Network HDDs (
network-hdd) - Network SSDs (
network-ssd) - Ultra high-speed network SSDs with three replicas (
network-ssd-io-m3)
- Network HDDs (
For more information about limits on the number of hosts per cluster, see Quotas and limits.
Disk encryption
When creating or restoring a cluster from a backup, you can encrypt the storage disk with a custom KMS key. To encrypt a disk of an already created cluster, disable encryption, or encrypt a disk with a different key, create a backup of the cluster and restore it with the new settings.
Warning
Encryption is not available for local disks (local-hdd and local-ssd).
To create an encrypted disk, you need the kms.keys.user role or higher.
If you deactivate the key used to encrypt a disk, access to the data will be suspended until you reactivate the key.
Alert
If you delete the key used to encrypt a disk or its version, you will irrevocably lose access to your data. For more information, see this Key Management Service article.
Disk space management
When the storage is more than 95% full, the host will automatically switch to read-only mode. Also, the read_only = 1 system variable will be set on the master host.
In this mode, the INSERT, DELETE, and UPDATE queries fail with an error.
To recover a Managed Service for MySQL® cluster from read-only mode, increase its storage size.
To monitor storage utilization, set up alerts in Yandex Monitoring.
Automatic increase of storage size
Automatic storage size increase prevents situations where the disk runs out of free space and hosts switch to read-only mode. The storage size increases upon reaching the specified threshold percentage of the total capacity. There are two thresholds:
-
Scheduled increase threshold: To plan this increase, an algorithm analyzes data from the last few hours and estimates how quickly the storage is filling up. If the calculations show that the specified threshold will be exceeded by the start of the nearest maintenance window, the system schedules a storage increase. If a check at the maintenance start shows that the threshold was indeed exceeded, the storage size is increased.
-
Immediate increase threshold: When reached, the storage size increases immediately.
You can use one or both thresholds. If you set both thresholds, make sure the immediate increase threshold is higher than the scheduled one.
If the specified threshold is reached, the storage size increases depending on disk type:
-
For network HDDs and SSDs, by the higher of the two values: 20 GB or 20% of the current disk size.
-
For non-replicated SSDs and ultra high-speed network SSDs with three replicas, by 93 GB.
-
For local SSDs:
- In an Intel Broadwell or Intel Cascade Lake cluster, by 100 GB.
- Intel Ice Lake cluster, by 368 GB.
If the threshold is reached again, the storage size will increase until it reaches the specified maximum value. Then you should increase the maximum storage size.
You can configure automatic increase of storage size when creating or updating a cluster. If you set the scheduled increase threshold, you also need to configure the maintenance window schedule.
Warning
-
Automatic increase of storage size is not supported on dedicated hosts.
-
While resizing the storage, cluster hosts will be unavailable.
-
You cannot decrease the storage size.