All Products
Search
Document Center

Elastic Compute Service:Best practices for local disks

Last Updated:Jan 31, 2023

Local disks are disks that are attached to the physical machines that host your ECS instances. Compared with cloud disks, local disks have higher storage I/O performance, but have greater data risks. This topic describes the benefits of using local disks, and how to reduce data risks that are associated with local disks.

What are local disks?

Local disks are disks that are attached to the physical machines that host ECS instances. Local disks provide local read/write capabilities to ECS instances. Local disks provide the following benefits: high random IOPS, high throughput, high cost-effectiveness, and low latency. Instances that are equipped with local disks are suitable for services that require high storage I/O performance. Local disks are also ideal for services that have implemented high availability at the application layer. For more information about local disks, see Local disks.

Risk comparison between local disks and cloud disks

A local disk is attached only to a single physical machine and does not provide a distributed multi-copy mechanism. The data reliability of a local disk is dependent on the reliability of the physical machine to which the local disk is attached. Data loss can occur if the local disk fails, if the physical machine to which the local disk is attached fails, or if the disk is mishandled. We recommend that you do not use local disks for long-term data storage.

In contrast,cloud disks use a distributed triplicate mechanism, which provides data durability in the event of unexpected hardware failures. If your application does not have a multi-node data redundancy architecture, we recommend that you use a cloud disk for data storage.

Best practices

Select instance types

Instances that are equipped with local disks have great advantages in terms of costs and read/write latency, and are ideal for big data and heavy-load database applications. These instances include those in the i2 and d1 instance families. Businesses that have high availability implemented at the application layer and require high storage I/O performance are ideal candidates for Instances that are equipped with local disks. If you use a big data cluster, we recommend that you use deployment sets. Deployment sets distribute your ECS instances across different physical machines and reduce data risk in the event of local disk failures.

If high-availability is not implemented at the application layer, we recommend that you do not use instances that are equipped with local disks. For more information about instance families, see Overview of instance families. For more information about best practices for instance type selection, see Best practices for instance type selection.

Back up a local disk

If your service is built on an instance that is equipped with local disks, but high availability is not implemented at the application layer, we recommend that you back up your data. You can back up local disk data by using one of the following methods:

  • Method 1: Use Hybrid Backup Recovery (HBR)

    HBR is a fully managed online backup service that allows you to back up data to the cloud in an efficient, secure, and cost-effective way. You can use HBR to back up data from local Internet data centers (IDCs), branches, or cloud resources to a cloud vault. For more information, see What is Hybrid Backup Recovery?

  • Method 2: Build a redundant architecture

    You can build a redundant data architecture to reduce the impact of local disk failures. We recommend that you use a cloud disk and copy the data on local disks to cloud disks in real time. You can also use ECS instances in different zones or regions and deploy applications on the instances for disaster recovery.

Use deployment sets to improve availability

To ensure data availability, we recommend that you implement data redundancy at the application layer.

You can use deployment sets to distribute ECS instances across multiple physical machines to implement high availability and disaster recovery. For more information, see Create a deployment set.

Migrate data from a local disk to a cloud disk

If your services are built on an instance that are equipped with local disks, you can change the instance to an instance equipped with cloud disks. Cloud disks use a distributed triplicate mechanism, which provides data durability in the event of unexpected hardware failures. You can create a snapshot for a cloud disk to back up data on the cloud disk.

You can use Server Migration Center (SMC) to back up the data stored on an ECS instance that are equipped with local disks. SMC can also help you back up data from a single or multiple instances that are equipped with local disks to Alibaba Cloud within one click and generate image replicas. For more information, see What is SMC?

When you migrate data, take note of the following items:

  • When you use SMC, you are charged only for ECS resources that you use during migration.

  • If you want to retain the public IP address of the source instance, you can convert the public IP address to an elastic IP address (EIP). Then, disassociate the EIP from the source instance. After you create a destination instance, you can associate the EIP with the destination instance.

  • If you want to retain the private IP address of the source instance, you must specify a VPC and vSwitch that have the same CIDR blocks as the VPC and vSwitch of the source instance when you create the destination instance. After you create the destination instance by using the console, you can change the private IP address of the destination instance to that of the source instance. Alternatively, if you call an API operation to create the destination instance, you must specify the VPC and vSwitch that have the same CIDR blocks as the VPC and vSwitch of the source instance while you specify the private IP address of the destination instance.

  • We recommend that you select the transferring data over an internal network mode and enable block copy to maximize the efficiency of migration backup.

  • We recommend that you enable Automatic incremental synchronization when you use SMC to migrate data and generate image replicas on a regular basis.

  • During migration, SMC does not interfere with the source instance, and does not modify the configurations or files of the source instance. SMC uses only a portion of CPU, memory, and bandwidth. To ensure data consistency for applications such as databases, we recommend that you suspend the applications before you use SMC to migrate and back up data.

Respond to local disk damages

If a local disk is damaged, Alibaba Cloud triggers a system event and sends you notifications, countermeasures, and event cycles. For more information, see O&M scenarios and system events for instances equipped with local disks.