我应该使用 EBS 还是 S3 来存储我的数据库?

发布于 2024-11-15 05:41:13 字数 140 浏览 5 评论 0原文

我想在 Amazon EC2 实例上托管一个网站,但出于可靠性目的,我希望将底层数据库存储在一些更永久的存储介质上。不会有任何文件上传或类似的事情,但我想确保数据库查询和更新快速进行。我应该使用 EBS 还是 S3?

如果您想了解更多信息,请发表评论

I want to host a website on an Amazon EC2 instance, but for reliability purposes, I want to have the underlying database on some more permanent storage medium. There won't be any file uploading or anything like that, but I want to make sure that the database queries and updates are going quickly. Should I use EBS or S3 for this?

And just comment if you want more info

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浪菊怪哟 2024-11-22 05:41:13

您无法在 S3 上存储数据库。如果您打算将数据库存储在任何位置,则可以将其存储在 EBS 上或实例存储上。

You can not store a database on S3. If you intend to store your database anywhere it will either be on EBS or on instance storage.

野鹿林 2024-11-22 05:41:13

只是为了建立在其他非常好的答案的基础上,您可以将数据库作为 .sql 文件存储在 s3 上。但是您的网站/应用程序无法查询此文件,因为 s3 没有 MySQL 程序(文件!=数据库)。

Amazon RDS 将数据库的备份作为 .sql 文件(我假设)存储到 s3,它们以编程方式访问这些文件,并在 RDS 数据库实例发生故障时使用该文件来恢复该实例。

EBS 与 RDS 的优点已在其他答案中阐述,但需要明确的是,RDS 的一个主要优点是 Amazon 通过提供备份等来负责恢复失败的实例。

不过,我不确定数据库复制部分因为这似乎是一个单独的概念,并且我读到这不是 RDS 的功能。更有经验的 DBA 似乎经常指出这一点,作为使用 RDS 的理由。有人可以澄清一下吗?

Just to build on the other very nice answers, you can store your database as a .sql file on s3. But your website/application can't make queries to this file because s3 has no MySQL program (file!=database).

Amazon RDS stores backups of your database to s3 as .sql files (I assume) which they programmatically access and use to restore your RDS database instance in the event of its failure.

The advantages of EBS vs. RDS are stated in other answers but just to be clear, a key benefit of RDS is that Amazon takes care of restoring your failed instance by providing backups, etc.

I'm not sure about the DB replication part though as that appears to be a separate concept and I've read that this is NOT a feature of RDS. More experienced DBAs seem to point this out often as a reason NOT to use RDS. Might someone clarify this?

羁拥 2024-11-22 05:41:13

就像@Femi 所说,您不能使用 S3 作为数据库,但您可以使用这些实例存储/EBS/RDS 之一。更多信息如下:

如果您的实例崩溃,实例存储将会消失,+ EBS 卷最近遇到了一个很好的问题 - 虽然这比实例存储好,但我建议您看看 Amazon RDS,我有在我的一个项目中使用了它,它非常酷。

Amazon RDS 有相当好的优势:

http://aws.amazon.com/rds/

功能:

  • 自动备份
  • 数据库
  • 快照 自动主机更换
  • 复制

当您将 EBS 与 RDS 进行比较时,两者的费用与 RDS 相比几乎没有额外费用到EBS,但它值得。亚马逊负责一切,如果您的网站是流量驱动的,它有自动复制的解决方案。

Like, @Femi said, you can not use S3 for DB, but you can use one of these instance-store/EBS/RDS. More info below:

Instance store will disappear if your instance is crashed, + EBS volume got quite a good problem recently - though this is good over instance-store, I would suggest you to have a look at Amazon RDS, I had used it for one my project and it's super cool.

Amazon RDS has got quite a good advantages:

http://aws.amazon.com/rds/

Features:

  • Automated Backups
  • DB Snapshots
  • Automatic Host Replacement
  • Replication

When you compare EBS with RDS, both are charged where as little extra on RDS when compared to EBS, but its worth. Amazon takes care of everything and if your site is traffic-driven, it has got solution to replicate automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文