我应该在 EBS 还是 S3 上保留图像? [英] Should I persist images on EBS or S3?

查看:20
本文介绍了我应该在 EBS 还是 S3 上保留图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的 Java、Tomcat、Mysql 服务器迁移到 AWS EC2.

I am migrating my Java,Tomcat, Mysql server to AWS EC2.

我已经附加了用于存储 MySql 数据的 EBS 卷.在我的 Web 应用程序中,人们可能会上传图像.所以我应该坚持他们.我认为有两种选择:

I have already attached EBS volume for storing MySql data. In my web application people may upload images. So I should persist them. There are 2 alternatives in my mind:

  1. 将上传的图像保存到 EBS 卷.
  2. 使用 S3 服务.

以下是我的笔记,请持怀疑态度,因为我的专长不是服务器,而是软件开发.

The followings are my notes, please be skeptic about them, as my expertise is not on servers, but software development.

  • EBS plus:S3 存储更贵.(0.15 美元/Gb > 0.1 美元/Gb)

  • EBS plus: S3 storage is more expensive. (0.15 $/Gb > 0.1$/Gb)

S3 plus:从 EBS 提供静态数据可能会对我的 Web 服务器的性能产生负面影响.这是真的?提供图像是否显着影响服务器性能?对于 S3,我的服务器将不负责提供静态数据.

S3 plus: Serving statics from EBS may influence my web server's performance negatively. Is this true? Does Serving images affect server performance notably? For S3 my server will not be responsible for serving statics.

S3 plus:从 EBS 提供静态数据可能会导致 I/O 成本,可能很小.

S3 plus: Serving statics from EBS may result I/O cost, probably it will be minor.

EBS plus:人们说 EBS 更快.

EBS plus: People say EBS is faster.

S3 plus:人们说 S3 对于持久性更安全.

S3 plus: People say S3 is more safe for persistence.

EBS plus:无需学习 API,直接将图像保存到 EBS 卷.

EBS plus: No need to learn API, it is straight forward to save the images to EBS volume.

即我无法决定,如果您指导会很高兴.

Namely I can not decide, will be happy if you guide.

谢谢

推荐答案

我目前在一个项目中使用 S3,它运行得非常好.

I'm currently using S3 for a project and it's working extremely well.

EBS 意味着你需要管理一个卷 + 机器来附加它.您需要在空间填满时添加空间并执行备份(并不是说您不应该备份您的 S3 数据,只是它不是那么重要).

EBS means you need to manage a volume + machines to attach it to. You need to add space as it's filling up and perform backups (not saying you shouldn't back up your S3 data, just that it's not as critical).

这也使得扩展变得更加困难:当您想要添加额外的机器时,您要么需要将图像拉到单独的机器上,要么在所有机器上克隆图像.这也意味着你会增加一个瓶颈:你必须管理自己的上传过程,要么上传到所有机器,要么让一台机器管理它.

It also makes it harder to scale: when you want to add additional machines, you either need to pull off the images to a separate machine or clone the images across all. This also means you're adding a bottleneck: you'll have to manage your own upload process that will either upload to all machines or have a single machine managing it.

我推荐 S3:它已经设置并忘记了.任何数量的机器都可以并行执行上传,你真的不需要通知其他机器上传.

I recommend S3: it's set and forget. Any number of machines can be performing uploads in parallel and you don't really need to notify other machines about the upload.

此外,您可以将 Amazon Cloudfront 作为廉价的 CDN 使用在图像前面,而不是直接从 S3 下载.

In addition, you can use Amazon Cloudfront as a cheap CDN in front of the images instead of directly downloading from S3.

这篇关于我应该在 EBS 还是 S3 上保留图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆