不同数据库灾难恢复选项之间的区别是什么?

huangapple go评论107阅读模式
英文:

What are the differences among the different disaster recovery options for databases?

问题

在AWS数据库的背景下,以下灾难恢复策略之间有何不同:

  • 点对点恢复
  • 备份
  • 快照
  • Aurora回溯

在何种情况下应选择其中一种而不是其他的?

为什么我们需要这么多不同的选项,一个选项不就足够了吗?

我们应该尝试使用它们全部吗?

英文:

In the context of AWS databases, how do the following disaster recovery strategies differ from one another:

  • point-in-time recovery
  • backup
  • snapshot
  • Aurora backtrack

When should we choose one over the others?

Why do we need so many different options when one will suffice?

Should we try to use all of them?

答案1

得分: 1

'Disaster Recovery'是非常古老的术语。它意味着在出现问题时需要进行故障切换。然而,在云中,您可以专注于高可用性,这样系统可以在发生故障时自动恢复,无需回到原始系统。

因此,最佳选择是不进行灾难恢复

相反,利用Amazon Aurora的云首选设计,它会自动在多个可用区之间复制数据(每个可用区都是不同的数据中心)。

来自Amazon Aurora的高可用性

Aurora在单个AWS区域内的DB集群中存储数据的副本跨多个可用区。无论DB集群中的实例是否跨越多个可用区,Aurora都会存储这些副本。

当数据被写入主DB实例时,Aurora会同步将数据复制到与您的集群卷关联的六个存储节点中。这样可以提供数据冗余,消除I/O冻结,并在系统备份期间最小化延迟峰值。运行具有高可用性的DB实例可以增强计划系统维护期间的可用性,并帮助保护数据库免受故障和可用区中断。

如果您希望使用传统数据库(例如SQL Server),您可以使用Amazon RDS来运行**Multi-AZ数据库**。这包括位于同一区域但位于不同可用区(即不同数据中心)的两个数据库服务器:

  • 一个主服务器位于一个可用区,用于提供流量
  • 另一个辅助服务器位于同一区域的不同可用区,由主服务器持续更新

如果主服务器发生故障,辅助服务器将成为新的主服务器。存在短暂的中断,但不会丢失数据。然后,RDS服务将启动新的辅助服务器。

故障恢复与数据恢复

您提到的其他选项(按时间点恢复、快照)侧重于恢复数据库中特定时间点的数据。通常情况下,这是因为某人/某物意外删除或更改了数据,您希望将数据恢复到以前的状态。将高可用性和快照结合使用是一个不错的选择,尽管由于其能够返回到以前的时间点,Amazon Aurora几乎使快照变得不那么重要。

**最重要的是:**不要考虑_灾难恢复_,而要考虑_高可用性_。

英文:

'Disaster Recovery' is very old-world. It implies having to fail-over when a problem happens. In the cloud, however, you can focus on High Availability so that systems can recover automatically when there is a failure, without the need to 'fail-back' to the original system.

Therefore, the best option is do not do disaster recovery.

Instead, take advantage of the cloud-first design of Amazon Aurora, which automatically replicates data between multiple Availability Zones (each being a different data center).

From High availability for Amazon Aurora - Amazon Aurora:

> Aurora stores copies of the data in a DB cluster across multiple Availability Zones in a single AWS Region. Aurora stores these copies regardless of whether the instances in the DB cluster span multiple Availability Zones.
>
>When data is written to the primary DB instance, Aurora synchronously replicates the data across Availability Zones to six storage nodes associated with your cluster volume. Doing so provides data redundancy, eliminates I/O freezes, and minimizes latency spikes during system backups. Running a DB instance with high availability can enhance availability during planned system maintenance, and help protect your databases against failure and Availability Zone disruption.

If you want to use a traditional database instead (eg SQL Server), you can use Amazon RDS to run a Multi-AZ Database. This consists of two databases servers in the same Region but in different Availability Zones (which means different data centers):

  • A Primary server in one AZ that is serving traffic
  • A Secondary server in a different AZ (in the same Region) that is being continuously updated by the Primary server

If a failure happens with the Primary server, the Secondary server becomes the new Primary server. There is a brief outage, but no data is lost. The RDS service will then launch a new Secondary server.

Failure recovery vs Data recovery

The other options you mention (point-in-time recovery, snapshots) are focussed on recovering data that was in the database at a particular time. This is normally because somebody/something accidentally deleted or changed data and you wish to recovery the data as it was at a previous time. It is good to combine both High Availability and Snapshots, although Amazon Aurora almost makes Snapshots irrelevant due to its ability to go back to a previous point in time.

Bottom line: Instead of Disaster Recovery, think High Availability.

答案2

得分: 1

首先,您需要确定您的工作负载的恢复时间目标(RTO)和恢复点目标(RPO)。RTO是从灾难事件发生到您的系统必须再次完全运行的时间。RPO是灾难事件后您可以容忍的数据损失的最大量。这些目标有助于确定您的灾难恢复(DR)计划的适当风险和成本水平。

根据AWS文档,在AWS上有四种主要的DR策略可供选择:

  1. 备份和还原 - 备份您的系统,并在发生灾难时从备份中还原。这是低成本但高风险的方法,因为它具有较高的RTO和RPO。
  2. 试点灯 - 将您的数据和核心元素复制到另一个区域,需要时进行扩展。这降低了RTO和RPO,但需要一些手动干预。
  3. 温暖的待机 - 在另一个区域运行您系统的精简版本,可以处理最小流量。这允许您在最短的停机时间内快速切换,但增加了成本和复杂性。
  4. 多站点主动/主动 - 在多个区域上运行您的系统,配备负载平衡和同步。这提供了最高的可用性和韧性,以及可能的最低RTO和RPO。但是,这也需要最多的成本和复杂性。

您的问题仅关注不同的备份和还原策略。它们都是使用AWS服务(如Amazon关系数据库服务(RDS),Amazon Aurora或Amazon DynamoDB)从特定时间点还原数据库状态的不同方式。

然而,这些选项不包括DR的其他方面,如资源扩展,流量切换或在不同区域之间同步数据。一些服务,如AWS Aurora,原生支持多站点主动/主动DR,但像RDS这样的其他服务则不支持。因此,在选择DR策略之前,您需要首先关注您工作负载的RTO和RPO目标。还请参考AWS上的灾难恢复

英文:

First of all, you need to identify the Recovery Time Objective (RTO) and
Recovery Point Objective (RPO)
for
your workload. RTO is the amount of time from a disaster event to when your
system must be fully operational again. RPO is the maximum amount of data loss
that you can tolerate after a disaster event. These objectives help you
determine the appropriate level of risk and cost for your disaster recovery (DR)
plan.

According to AWS
documentation
,
there are four main DR strategies that you can use on AWS:

  1. Backup and restore – back up your systems and restore them from backup if
    disaster strikes. This is low-cost but high-risk, as it has a high RTO and
    RPO.
  2. Pilot light – replicate your data and core elements to another Region and
    scale up when needed. This reduces the RTO and RPO but requires some manual
    intervention.
  3. Warm standby – run a scaled-down version of your system in another Region
    that can handle minimal traffic. This allows you to switch over quickly with
    minimal downtime. This further reduces the RTO and RPO but increases the cost
    and complexity.
  4. Multi-site active/active – run your system across multiple Regions with
    load balancing and synchronization. This provides the highest availability
    and resilience, as well as the lowest RTO and RPO possible. However, this
    also requires the most cost and complexity.

Your question only focuses on different backup and restore strategies. They are
all different ways of restoring your database state from a specific point in
time using AWS services such as Amazon Relational Database Service (RDS), Amazon
Aurora, or Amazon DynamoDB.

However, these options do not cover other aspects of DR such as scaling up
resources, switching over traffic, or synchronizing data across Regions. Some
services like AWS Aurora natively support multi-site active/active DR, but
others like RDS do not. Therefore, you need to first focus on the RTO and RPO
objectives for your workload before choosing a DR strategy. Also please refer to
Disaster Recovery on AWS.

答案3

得分: 0

手动快照与自动备份之间的一个关键区别在于快照不会过期,而自动备份通常存储最多35天。

当您为AWS数据库启用自动备份时,AWS会定期备份您的数据库并将其存储在Amazon S3中。这些备份作为PITR的起点。AWS在S3中保留事务日志最多35天,允许您在此时间范围内执行时间点恢复(PITR)。

当您启动PITR还原操作时,AWS使用所选备份和事务日志来将数据库恢复到所需的时间点。AWS首先恢复备份,然后应用事务日志中的相关事务到已恢复的备份。这个过程将数据库恢复到所需的时间点,允许您以那个时间点存在的方式恢复数据。

Aurora Backtrack允许您轻松地撤消对数据库的意外或错误更改,将数据库回滚到特定的时间点,而无需从备份中还原。这允许快速回滚,无需创建新的数据库实例。然而,Aurora Backtrack具有最大的回滚窗口为72小时,这意味着您只能将数据库回滚到最近72小时内的任何时间点。这是因为Aurora Backtrack使用事务日志来回滚更改,而事务日志只保留72小时。

英文:

One key difference between a manual snapshot and an automatic backup is that a snapshot doesn't expire, whereas an automatic backup are usually stored for a maximum of 35 days.

When you enable automated backups for your AWS database, AWS takes periodic backups of your database and stores them in Amazon S3. These backups serve as the starting point for PITR. AWS keeps transaction logs in S3 for up to 35 days, allowing you to perform point-in-time recovery (PITR) to any point within that timeframe.

When you initiate a PITR restore operation, AWS uses the selected backup and the transaction log to restore your database to the desired point in time. AWS first restores the backup and then applies the relevant transactions from the transaction log to the restored backup. This process brings the database to the desired point in time, allowing you to recover your data as it existed at that time.

Aurora Backtrack allows you to easily undo unintended or incorrect changes to your database by rolling back the database to a specific point in time without needing to restore from a backup. This allows fast rollbacks without the need to create a new database instance. However, Aurora Backtrack has a maximum backtrack window of 72 hours, which means you can only roll back your database to any point in time within the last 72 hours. This is because Aurora Backtrack uses the transaction log to roll back changes, and transaction logs are only kept for 72 hours.

huangapple
  • 本文由 发表于 2023年3月4日 05:33:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75632066.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定