简体   繁体   English

在将我的Web应用托管在云上时,我应该在db2实例上安装数据库还是应该使用RDS服务?

[英]While hosting my web app on cloud, should I install my db on the EC2 instance or should i use RDS service?

While hosting my web app on cloud, should I install my db on the EC2 instance or should i use RDS service ? 在将我的Web应用程序托管在云上时,应该在db2实例上安装数据库还是应该使用RDS服务? Some points come up : 一些要点:

  1. Backing up would be automatic as EC2 instances are also backed up. 由于也会​​备份EC2实例,因此备份将是自动的。
  2. Wouldn't automatic scaling of resources compensate for any automatic scaling of db that RDS would provide ? 资源的自动扩展不会补偿RDS提供的db的任何自动扩展吗?

You can do either, and I have done both, but the absolute better practice is to use RDS for your database and EC2 for the websites, unless you have a really good reason not to (and if you are not sure if you have a good reason, then you probably don't). 您可以做任何一个,而我都做过,但是绝对更好的做法是对数据库使用RDS,对网站使用EC2,除非您确实有很好的理由不这样做(并且如果不确定是否有一个很好的理由)。原因,那么您可能不知道)。

I ran DB's on the instances using SQL Server for years, for a few low-traffic sites, and had no problems. 我在使用SQL Server的实例上运行DB已有多年,仅用于一些低流量站点,并且没有任何问题。 I finally moved the last of these off of my EC2 instances and into RDS and wish I had done in years ago. 我终于将其中的最后一个移出了我的EC2实例,并移到了RDS中,希望我几年前就做过。

For a small, low-traffic site, you can get away with it, but as traffic picks up on your site, and you want to add the ability to autoscale your front-end, keeping the database on the instance is no longer an option. 对于小型,低流量的站点,您可以摆脱它,但是随着站点上流量的增加,并且您希望增加自动扩展前端的功能,将数据库保留在实例上不再是一种选择。 When you have upto 5-10-20 EC2 web instances balancing web traffic, and you want to add or remove instances dynamically to conserve resource (ie money), you'll be really happy the database is not on the single instance. 当您拥有最多5-10-20个EC2 Web实例来平衡Web流量,并且想要动态添加或删除实例以节省资源(即金钱)时,您将很高兴数据库不在单个实例上。

Besides that the automatic backups, the ability to restore to point-in-time, and they ability to take an RDS snapshot, and spin up a new RDS instance for development or testing purposes is really convenient. 除了自动备份之外,还具有还原到时间点的能力以及创建RDS快照和启动新的RDS实例以进行开发或测试的能力,这确实非常方便。

Ultimately, everything that RDS does for you, you could do for yourselve using a fleet of EC2 instances, and a lot of time and money, but like I said, if you don't have the time, money or expertise (or the compelling reason) to set that redundancy up youself, then why bother. 最终,RDS为您所做的一切,都可以使用大量的EC2实例自行完成,并且花费了大量的时间和金钱,但是就像我说的那样,如果您没有时间,金钱或专业知识(或令人信服的原因)来自己设置冗余,那又何必呢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该在RDS上还是在EC2上运行数据库? - Should i run my database on a RDS or off an EC2? 我应该为我的文件使用 s3 存储桶还是应该只使用我的 ec2 实例 - Should I use an s3 bucket for my files or should I just stick to my ec2 instance 如果停止EC2实例,是否将删除我的Web应用程序? - Will my web app be deleted if I stop my EC2 instance? 我应该为EC2实例使用哪些AWS磁盘选项? - What AWS disk options should I use for my EC2 instance? 是否应将AWS RDS用于EC2 MYSQL? - Should I use AWS RDS for EC2 MYSQL? 在EC2上托管时,我应该使用FS“本地”存储文件还是使用s3fs“间接”存储s3服务上的文件? - When hosting on EC2, should I use FS to store files “locally” or s3fs to store files on my s3 service “indirectly”? 为什么我不能直接连接到MySQL RDS数据库实例? (我只能通过SSH连接到EC2) - Why can't I connect directly to my MySQL RDS DB Instance? (I can only connect via SSHing into an EC2) 我应该在哪里存储我的 object 在 AWS 运行 Ec2 实例与应用程序负载均衡器 - where should I store my object in AWS Running Ec2 Instance With Application Load balancer 为什么我不能从EC2实例访问我的Amazon RDS实例? - Why can't I access my amazon RDS instance from my EC2 instance? 我如何在AWS EC2实例上安装特定字体? - How I install specific fonts on my AWS EC2 instance?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM