RDS 备份与高可用性
了解自动备份、手动快照和多可用区部署,提升数据库的弹性和运行时间。
RDS 备份与高可用性 是 CoddyKit 上的免费 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课时。 这是第 3 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 AWS for Backend Developers (EC2, S3, RDS, Lambda) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Keeping Your Data Safe & Ready
When running databases, two critical concerns are data loss and downtime. What if a server fails? What if you accidentally delete crucial data?
AWS RDS offers powerful features to ensure your database is both resilient against failures and recoverable from data loss. We'll explore how to achieve this with backups and high availability.
RDS Automated Backups
Automated backups are a lifesaver. RDS automatically creates and stores backups of your database instance.
- They include a full daily snapshot and transaction logs.
- You define a retention period (1-35 days).
- Backups happen during a specified backup window to minimize performance impact.
These are enabled by default for new instances!
Recovering to Any Moment
Automated backups enable Point-in-Time Recovery (PITR). This means you can restore your database instance to any second within your retention period.
Imagine accidentally deleting a table at 10:30 AM. With PITR, you can restore your database to 10:29 AM, before the error occurred. This creates a brand new RDS instance with the restored data.
Creating Manual Snapshots
While automated backups are great for short-term recovery, manual snapshots offer more control and flexibility.
- You initiate them whenever needed.
- They are stored until you explicitly delete them.
- Useful for long-term archiving, major schema changes, or migrating data.
They are full backups of your database instance at a specific point in time.
Restoring from a Snapshot
When you restore from either an automated or manual snapshot, RDS creates a new database instance. This new instance is independent of the original one.
You can specify the instance type, storage, and other configurations for the new instance. This process is great for testing changes or recovering a specific version of your data.
Multi-AZ for High Uptime
Multi-Availability Zone (Multi-AZ) deployments are crucial for high availability. Instead of just one database instance, RDS automatically provisions and maintains a synchronous standby replica in a different AZ.
An Availability Zone (AZ) is a physically separate, isolated location within an AWS Region. This protects against an outage in a single AZ.
Automatic Failover in Action
If your primary database instance in a Multi-AZ deployment becomes unavailable (e.g., due to an AZ outage or underlying infrastructure issue), RDS automatically performs a failover.
The standby replica is promoted to become the new primary. Your application's database endpoint automatically points to the new primary, usually within minutes, with minimal disruption.
Multi-AZ vs. Read Replicas
It's important to distinguish Multi-AZ from Read Replicas.
- Multi-AZ: Focuses on high availability and disaster recovery. The standby replica is synchronous and not directly accessible for reads.
- Read Replicas: Focus on performance scaling by offloading read traffic. They are asynchronous and can be in the same or different AZs/Regions.
We'll dive deeper into Read Replicas in a future lesson.
Combining Strategies for Resilience
For maximum database resilience and uptime, a common strategy is to combine these features:
- Automated Backups: For point-in-time recovery from accidental data changes.
- Manual Snapshots: For long-term archives or specific recovery points.
- Multi-AZ: For high availability against AZ-wide outages.
This layered approach ensures your data is protected and always available.
Quick Check on RDS Resilience
You've learned about RDS's powerful features for backups and high availability. Let's test your understanding!
RDS Resilience Recap
Great job! In this lesson, we explored how AWS RDS helps you build resilient databases:
- Automated Backups provide point-in-time recovery.
- Manual Snapshots offer flexible, user-initiated backups.
- Multi-AZ Deployments ensure high availability and automatic failover across Availability Zones.
By using these features, you can significantly enhance your database's data protection and uptime.
常见问题解答
「RDS 备份与高可用性」课时是免费的吗?
是的 — 「RDS 备份与高可用性」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程的其余内容,请升级到 CoddyKit PRO。 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程共包含 4 节课。
「RDS 备份与高可用性」这节课中我会学到什么?
了解自动备份、手动快照和多可用区部署,提升数据库的弹性和运行时间。 你通过在浏览器中直接运行的动手代码来练习 AWS for Backend Developers (EC2, S3, RDS, Lambda),全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 AWS for Backend Developers (EC2, S3, RDS, Lambda) 需要有经验吗?
无需任何先前经验。CoddyKit 上的 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 3 节课,共 4 节。
「RDS 备份与高可用性」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课中编写并运行代码吗?
能。每节 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。
此课程中的所有课时
- Amazon RDS 入门
- 启动并连接到 RDS
- RDS 备份与高可用性
- RDS 扩展与性能调优