AWS RDS 与 EC2 实例中的本地数据库

AWS RDS vs local database in EC2 instance

我想了解 AWS 关系数据库服务 (RDS) 并发现使用它的好处。

为什么 RDS 比在 EC2 实例中手动安装 PostgreSQL 数据库更好?

是否可以将 EC2 实例中的现有数据库与 Amazon RDS 连接? 它是如何运作的?

我应该如何自动化RDS? 当我想在现有 EC2 实例中创建新数据库时,我可以简单地使用 Ansible。我应该如何将我的应用程序连接到使用 RDS 的数据库?

提前致谢!

I want to understand AWS Relational Database Service (RDS) and discover benefits from using it.

如前所述,请阅读文档和白皮书。

Why RDS is better than manually installed PostgreSQL database in EC2 instance?

您可以确定它设置良好,您将获得 时间点恢复、备份和高可用性。您也可以自己设置它,但是使用 RDS 您已经配置好了。

Ifs it possible to connent existing database in EC2 instance with Amazon RDS? How it really works?

您无权访问任何底层配置,所以不,您无法真正连接 ec2 数据库 w/rds(例如,用于 wal 流的 wal)。

您仍然可以使用数据库迁移工具将所有数据库和更新迁移到 rds 或从 rds 迁移

How I should automation RDS? When I want create new database in existing EC2 instance I can use Ansible in simply way.

您可以使用 cloudformation template 或 cli 命令

How I should connect my application with database which uses RDS ?

当你创建一个rds实例时,你将定义一个admin用户并接收一个连接url

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html#USER_VPC.Scenario1