可扩展性和弹性
SaaS 中的故障转移和冗余是什么?
什么是故障转移和冗余?
Failover and redundancy are methods used to maintain the functionality of your systems, even during unexpected failures. Redundancy involves having backup parts or systems as substitutes, while failover is the switch, usually automatic, to those backups when the original system fails. Amazon RDS, for example, switches a Multi-AZ DB instance to its standby replica; failover times are typically 60–120 seconds.
On its own, failover solves smaller or localized issues, which are usually limited in scope, while disaster recovery (DR) is a solution for extensive issues such as natural disasters, cyber threats, or system crashes.
The presence of redundancy and failover configurations often relates to the level of disruption experienced during maintenance and upgrades, impacting service continuity. This is crucial in business, where even minor disruptions can be costly.
冗余就像汽车的备用轮胎。它不是驾驶的必需品,但如果轮胎爆胎,它至关重要。
冗余和高可用性之间有什么区别?
冗余是一种专门用于实现高可用性的技术。可以将冗余视为工具箱中的一种工具。它涉及拥有一件或多件设备的备份,以确保在初始设备发生故障时有备用方案。
High availability (HA), on the other hand, is the overall strategy of ensuring that your systems are reliably operational with a minimum of interruption. It includes a broader range of strategies, not just redundancy, but also:
- 负载均衡: 在多个服务器之间分配负载,以避免任务使某些服务器过载。
- 定期维护: 在故障发生并损害业务组织的工作流程之前,预测并纠正问题。
- 强大的监控: Quickly identifying failures and executing the necessary failover or other recovery processes.
此外,为了确保在动态环境中实现高可用性,系统需要整合 可扩展性和弹性 以适应不断变化的工作负载。
因此,冗余不是高可用性的唯一因素,而是一个重要的组成部分。
| 方面 | 冗余 | 高可用性 |
|---|---|---|
| 核心定义 | ||
| 定义 | 确保系统备份和应急的策略 | 维护系统可靠性的综合策略 |
| 主要目标 | 提供备用系统以防止停机 | 确保最小的系统中断 |
| 操作方法 | ||
| 关键策略 | 备份设备和系统 | 负载均衡、维护、监控、可扩展性 |
| 范围 | 范围窄,专注于备份系统 | 范围广,包含多种系统可靠性技术 |
| 实施 | ||
| 复杂性 | 相对简单的备份机制 | 更复杂、多方面的方法 |
| 关系 | 高可用性的一个组成部分 | 包含冗余作为策略 |
冗余的三种类型是什么?
Three common types of redundancy 是:
- 活动-活动: 两个冗余系统同时分担工作负载,以实现最大的资源利用率。
- 主-被动: 一个系统完全运行(活动),另一个系统不运行(被动),仅在活动系统发生故障时才投入运行。
- N+1 冗余: 您拥有正常运行所需的系统数量 (N),外加一个用于备份目的的系统。
These models can apply at several layers: power (UPS units and generators), network links from different providers, storage such as RAID, and servers. A redundant network keeps a second path ready if one link fails.
您的 SaaS 是否需要故障转移和冗余?
决定您是否需要故障转移和冗余取决于几个因素。请考虑以下问题:
- Can your business handle any downtime?
- 您的服务对您的客户有多重要?
- 服务中断会造成哪些财务影响?
If downtime translates into loss of sales or erosion of customer confidence, or breaks the uptime promised in your 服务水平协议, then redundancy and failover may prove to be cost-effective solutions.
Managed services can run failover for parts of your infrastructure: on Amazon RDS, failover times for a Multi-AZ DB instance are typically 60–120 seconds (AWS). Test it before you need it; RDS lets you force a failover by rebooting the instance.
冗余和灾难恢复之间有什么区别?
冗余和灾难恢复 (DR) 都有助于保持您的系统运行,但它们处理不同的场景:
冗余:
- 重点: Minimizing the chances of experiencing downtime in the first place.
- 工作原理: 使用备件或额外的类似系统在主系统停止工作时接管。
- When it’s used: 针对诸如硬件故障或单个节点/设施级电源故障等小问题。
- 可以把它看作: 一个备用轮胎,以防汽车轮胎爆胎。
灾难恢复:
- 重点: Restoring systems and data after a major disruption event.
- 工作原理: 需要一个全面的计划,包括备份数据、将操作转移到备用站点以及恢复系统在线。
- When it’s used: 在发生自然灾害、网络威胁,甚至整个系统崩溃等重大事件时。
- 可以把它看作: 类似于商业保险政策,它用于在发生灾难时促进恢复。
In short, redundancy is used to prevent unexpected downtime, and disaster recovery is used to restore systems and data after a major disruption. Redundancy differs from a backup, as issues like data deletion or encryption may be replicated to standby systems, indicating that distinct backup strategies are relevant for 灾难恢复.
结论
Redundancy and failover are some of the most vital concepts one can use to provide the reliability and availability of critical systems. Understand and strategically implement these concepts to address unexpected disruptions and manage operations effectively.