




















No one wants to lose data, but it’s hard to avoid: accidental deletion of files, unexpected power outages, hard drive damage, hard drive loss, natural disasters… All of the above will lead to data loss, which is likely to be impossible to recover directly. I believe that many people have had such troubles. This article will briefly introduce the 321 principles of backup, as well as best practices for cloud backup and local backup.
The above data loss has brought huge losses to people, but if we can make data backups in advance, we can reduce the loss of data later.
In the process of backup, we should implement the 321 principle, so as to ensure the reliability and effectiveness of the backup.
In addition, you should also pay attention to the timeliness of backups, and if possible, try to shorten the backup cycle. For example, a minute-by-minute backup is more time-sensitive than an hourly backup. When data is lost, the former will only lose the last 1 minute of work, while the latter will lose the last 1 hour of work.
Generally, cloud backups are very reliable. The cloud server will help you do the 321 principle. You only need to choose a cloud storage service provider and upload the files to be backed up.
It is recommended to choose a service provider that provides an automatic backup function, which can save you the step of manually selecting files to upload. Usually automatic backup also performs incremental backup of files, that is, each backup uploads only the files that have changed since the last backup, which can greatly save upload time.
A typical example of cloud backup is the iCloud backup function in iOS. After this function is enabled, the iOS device will automatically upload personal data such as pictures, contacts, documents, chat records, and software archives to the cloud. After purchasing a new iOS device, this data can be automatically restored to the new device from the cloud.
Regularly package and upload important files on the server to object storage for simple backup. You can directly use the object storage of Amazon S3, Google Cloud Storage, Alibaba Cloud OSS, and Tencent Cloud COS. The above services all provide 99.999999999% durability, that is, once the file is uploaded, it is almost impossible to accidentally lose it. Object storage in cloud services is usually stored in multiple Availability Zones (usually at least three) within a region, and each Availability Zone also contains multiple copies of files. There is a certain distance between the various Availability Zones, so this achieves off-site. About regions and availability zones, you can refer to this AWS article for details.
Object storage for cloud services generally has a choice of regions. The geographically closest region is usually chosen for the lowest latency. These services are usually billed on a per-use basis, which mainly includes storage space occupied within a certain period of time and traffic charges for transferring data. For example, if you want to back up 1GB of data, it may only cost a few dollars or cents per month, or even free. (different service providers charge different)
The software on many servers has integrated the function of using object storage for backup: after the service provider has activated the object storage, you only need to configure the authorization key in the software to use the object storage for backup. If the software does not integrate this backup function, a simple backup can also be implemented manually. For example, use mysqldump to export database files, and use gzip and tar commands to compress and package files for backup. Usually object storage providers also provide command-line tools that can be used to simply upload files to object storage. For example, AWS has aws, which supports S3 operations; Google Cloud Storage has gsutil; Alibaba Cloud OSS has ossutil; Tencent Cloud has tccli, which supports COS operations.
Usually a snapshot backs up all data on the server’s disk. Restoring from snapshots is also very convenient. This doesn’t even require software on the server to support backup functionality. Whether the server disk is damaged, system files are lost, or files are deleted, you can recover from a snapshot.
If possible, it is recommended to use both object storage backup and snapshot backup.
Although cloud backup is simple and durable, the speed of backing up large volumes of data is proportional to bandwidth. What’s more, what the backup needs is the uplink bandwidth, which is usually a fraction of the downlink bandwidth that the operator claims. And just use an ordinary mechanical hard disk for backup, and its speed has reached the speed of a gigabit network, and the gigabit network penetration rate is low and the price is extremely expensive. Therefore, local backup may be more appropriate when encountering one or more situations such as large data volume, limited bandwidth, and limited backup/restore time.
For local backup, you need to do the 321 principle yourself. You’ll need to back up your data to two hard drives (either via a LAN or wired connection) and store one of the hard drives offsite. Many desktop operating systems support backup, you can find the backup function in the control panel of the latest Windows system, and use Time Machine to back up on macOS. It is recommended to configure automatic backup.
If conditions permit, it is recommended to back up more important files to the cloud while backing up locally.
We should keep earlier versions of files in case we need them. Keeping multiple historical versions of files Using incremental backups can help save storage space. If possible, keep as many historical versions as possible.
Earlier versions can have relatively longer intervals in order to save space: like Time Machine in macOS, it keeps hourly backups for the past 24 hours, daily backups for the past month, and Take as many weekly backups as possible over a month, until the disk space fills up.
Some network storages automatically keep historical versions, such as Dropbox, Google Drive, iCloud, etc. Some software also keep historical versions on the local disk. For example, Git keeps a history of every commit.
It is recommended to keep historical versions for important files first, and if possible for all files.
Generally, object storage provides multiple storage categories, and different storage categories have different pricing and usage scenarios. Reasonable use of multiple storage categories can save expenses.
Sorted by storage price from high to low, the durability is 99.999999999%, and they are all available in multiple availability zones.
Backups larger than 128kb and infrequently accessed are recommended to be stored in STANDARD_IA, and early historical versions that are rarely accessed can be stored in GLACIER.
Sorted by storage price from high to low, the durability is 99.999999999%, and they are all available in multiple availability zones.
Likewise, infrequently accessed backups are recommended to be stored in Nearline, and earlier historical versions that are rarely accessed can be stored in Coldline.
Sorted by storage price from high to low, the durability is 99.999999999%, and they are all available in multiple availability zones.
Similarly, it is recommended to store infrequently accessed backups in the infrequent access type, and the early historical versions that are rarely accessed again can be stored in the archive type.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。