天天看点

AWS EFS vs EBS vs S3(差异和何时使用?)

本文翻译自:AWS EFS vs EBS vs S3 (differences & when to use?)

As per the title of this question, what are the practical differences between AWS EFS, EBS and S3?

根据这个问题的标题,AWS EFS,EBS和S3之间的实际差异是什么?

My understanding of each:

我对每个人的理解:
  • S3 is a storage facility accessible any where S3是一个可在任何地方访问的存储设施
  • EBS is a device you can mount onto EC2 EBS是一种可以安装到EC2上的设备
  • EFS is a file system you can mount onto EC2 EFS是一个可以安装到EC2上的文件系统

So why would I use EBS over EFS?

那么为什么我会使用EBS而不是EFS?

Seem like they have the same use cases but minor semantic differences?

看起来他们有相同的用例但是语义差异很小?

Although EFS is replicated across AZs where as EBS is just a mounted device.

虽然EFS是在AZ之间复制的,因为EBS只是一个已安装的设备。

I guess my understanding of EBS is lacking hence I'm unable to distinguish.

我想我对EBS的理解是缺乏的,因此我无法区分。

Why choose S3 over EFS?

为什么选择S3而不是EFS?

They both store files, scale and are replicated.

它们都存储文件,扩展和复制。

I guess with S3 you have to use the SDK where as with EFS being a file system you can you standard I/O methods from your programming language of choice to create files.

我想在S3中你必须使用SDK,因为EFS是一个文件系统,你可以从你选择的编程语言中选择标准的I / O方法来创建文件。

But is that the only real difference?

但那是唯一真正的区别吗?

#1楼

参考:https://stackoom.com/question/2062h/AWS-EFS-vs-EBS-vs-S-差异和何时使用

#2楼

Fixing the comparison:

修正比较:
  • S3 is a storage facility accessible any where S3是一个可在任何地方访问的存储设施
  • EBS is a device you can mount onto EC2 EBS是一种可以安装到EC2上的设备
  • EFS is a file system you can mount onto several EC2 instances at the same time EFS是一个文件系统,可以同时安装到多个EC2实例上

At this point it's a little premature to compare EFS and EBS- the performance of EFS isn't known, nor is its reliability known.

此时比较EFS和EBS还为时尚早 - EFS的性能未知,其可靠性也未知。

Why would you use S3?

你为什么要用S3?
  • You don't have a need for the files to be 'local' to one or more EC2 instances. 您不需要将文件作为一个或多个EC2实例的“本地”。
  • (effectively) infinite capacity (有效)无限的能力
  • built-in web serving, authentication 内置Web服务,身份验证

#3楼

One word answer: MONEY :D

一个字回答:钱:D

1 GB to store in US-East-1: (Updated at 2016.dec.20)

1 GB存储在US-East-1 :(更新于2016.dec.20)
  • Glacier: $0.004/Month (Note: Major price cut in 2016) 冰川:每月0.004美元(注:2016年主要降价)
  • S3: $0.023/Month S3:每月0.023美元
  • S3-IA (announced in 2015.09): $0.0125/Month (+$0.01/gig retrieval charge) S3-IA(2015.09宣布):0.0125美元/月(+ 0.01美元/ gig检索费)
  • EBS: $0.045-0.1/Month (depends on speed - SSD or not) + IOPS costs EBS:0.045-0.1美元/月(取决于速度 - SSD与否)+ IOPS成本
  • EFS: $0.3/Month EFS:0.3美元/月

Further storage options, which may be used for temporary storing data while/before processing it:

更多存储选项,可用于在处理数据时/临时存储数据:
  • SNS SNS
  • SQS SQS
  • Kinesis stream Kinesis流
  • DynamoDB, SimpleDB DynamoDB,SimpleDB

The costs above are just samples.

以上费用只是样品。

There can be differences by region, and it can change at any point.

区域可能存在差异,并且可能随时发生变化。

Also there are extra costs for data transfer (out to the internet).

还有额外的数据传输成本(到互联网)。

However they show a ratio between the prices of the services .

然而,它们显示了服务价格之间的比率 。

There are a lot more differences between these services:

这些服务之间存在很多差异:

EFS is:

EFS是:
  • Generally Available (out of preview), but may not yet be available in your region 一般可用 (预览外),但您所在的地区可能尚未提供
  • Network filesystem (that means it may have bigger latency but it can be shared across several instances; even between regions) 网络文件系统(这意味着它可能具有更大的延迟,但它可以在多个实例之间共享;甚至在区域之间)
  • It is expensive compared to EBS (~10x more) but it gives extra features. 与EBS相比价格昂贵(大约多10倍),但它提供了额外的功能。
  • It's a highly available service. 这是一项高度可用的服务。
  • It's a managed service 这是一个托管服务
  • You can attach the EFS storage to an EC2 Instance 您可以将EFS存储附加到EC2实例
  • Can be accessed by multiple EC2 instances simultaneously 可以同时由多个EC2实例访问
  • Since 2016.dec.20 it's possible to attach your EFS storage directly to on-premise servers via Direct Connect. 从2016.dec.20开始,可以通过Direct Connect将您的EFS存储直接连接到本地服务器。 () ()

EBS is:

EBS是:
  • A block storage (so you need to format it). 块存储(因此您需要格式化它)。 This means you are able to choose which type of file system you want. 这意味着您可以选择所需的文件系统类型。
  • As it's a block storage, you can use Raid 1 (or 0 or 10) with multiple block storages 由于它是块存储,因此您可以将Raid 1(或0或10)与多个块存储一起使用
  • It is really fast 它真的很快
  • It is relatively cheap 它相对便宜
  • With the new announcements from Amazon, you can store up to 16TB data per storage on SSD-s. 通过亚马逊的新发布,​​您可以在SSD-s上为每个存储存储多达16TB的数据。
  • You can snapshot an EBS (while it's still running) for backup reasons 出于备份原因,您可以对EBS进行快照(当它仍在运行时)
  • But it only exists in a particular region. 但它只存在于特定地区。 Although you can migrate it to another region, you cannot just access it across regions (only if you share it via the EC2; but that means you have a file server) 虽然您可以将其迁移到其他区域,但您不能仅跨区域访问它(仅当您通过EC2共享它时;但这意味着您有一个文件服务器)
  • You need an EC2 instance to attach it to 您需要一个EC2实例来附加它
  • New feature (2017.Feb.15): You can now increase volume size, adjust performance, or change the volume type while the volume is in use. 新功能 (2017.Feb.15):您现在可以在使用音量时增加音量大小,调整性能或更改音量类型。 You can continue to use your application while the change takes effect. 您可以在更改生效时继续使用您的应用程序。

S3 is:

S3是:
  • An object store (not a file system). 对象存储(不是文件系统)。
  • You can store files and "folders" but can't have locks, permissions etc like you would with a traditional file system 您可以存储文件和“文件夹”,但不能像传统文件系统那样拥有锁,权限等
  • This means, by default you can't just mount S3 and use it as your webserver 这意味着,默认情况下,您不能只挂载S3并将其用作您的网络服务器
  • But it's perfect for storing your images and videos for your website 但它非常适合存储您网站的图像和视频
  • Great for short term archiving (eg a few weeks). 非常适合短期归档(例如几周)。 It's good for long term archiving too, but Glacier is more cost efficient. 它也适用于长期存档,但Glacier更具成本效益。
  • Great for storing logs 非常适合存储日志
  • You can access the data from every region (extra costs may apply) 您可以访问每个地区的数据(可能需要额外费用)
  • Highly Available, Redundant. 高度可用,冗余。 Basically data loss is not possible (99.999999999% durability, 99.9 uptime SLA) 基本上数据丢失是不可能的(99.999999999%耐用性,99.9正常运行时间SLA)
  • Much cheaper than EBS. 比EBS便宜得多。
  • You can serve the content directly to the internet, you can even have a full (static) website working direct from S3, without an EC2 instance 您可以直接将内容提供给互联网,甚至可以直接从S3使用完整的(静态)网站,而无需EC2实例

Glacier is:

冰川是:
  • Long term archive storage 长期存档存储
  • Extremely cheap to store 存储非常便宜
  • Potentially very expensive to retrieve 检索可能非常昂贵
  • Takes up to 4 hours to "read back" your data (so only store items you know you won't need to retrieve for a long time) 最多需要4个小时来“回读”您的数据(因此只存储您知道长时间不需要检索的项目)

As it got mentioned in JDL's comment, there are several interesting aspects in terms of pricing.

正如JDL评论中提到的那样,在定价方面有几个有趣的方面。

For example Glacier, S3, EFS allocates the storage for you based on your usage, while at EBS you need to predefine the allocated storage.

例如,Glacier,S3,EFS根据您的使用情况为您分配存储,而在EBS中,您需要预定义分配的存储。

Which means, you need to over estimate.

这意味着,你需要过度估计。

( However it's easy to add more storage to your EBS volumes, it requires some engineering, which means you always "overpay" your EBS storage, which makes it even more expensive.)

(但是,为EBS卷添加更多存储空间很容易,这需要一些工程设计,这意味着您总是“多付”您的EBS存储空间,这使得它更加昂贵。)

Source: AWS Storage Update – New Lower Cost S3 Storage Option & Glacier Price Reduction

来源: AWS Storage Update - 新的低成本S3存储选项和降低冰川价格

#4楼

I wonder why people are not highlighting the MOST compelling reason in favor of EFS.

我想知道为什么人们没有强调支持EFS的最有说服力的理由。

EFS can be mounted on more than one EC2 instance at the same time, enabling access to files on EFS at the same time.

EFS可以同时安装在多个EC2实例上,从而可以同时访问EFS上的文件。

#5楼

To add to the comparison: (burst)read/write-performance on EFS depends on gathered credits.

添加到比较:EFS上的(突发)读/写性能取决于收集的信用。

Gathering of credits depends on the amount of data you store on it.

信用的收集取决于您存储在其上的数据量。

More date -> more credits.

更多日期 - >更多学分。

That means that when you only need a few GB of storage which is read or written often you will run out of credits very soon and througphput drops to about 50kb/s.

这意味着当你只需要几GB的存储空间时,你很快就会读取或写入存储空间,并且很快就会耗尽,并且吞吐量会下降到大约50kb / s。

The only way to fix this (in my case) was to add large dummy files to increase the rate credits are earned.

修复此问题的唯一方法(在我的情况下)是添加大型虚拟文件以增加获得的信用额度。

However more storage -> more cost.

但是更多的存储 - >更多的成本。

#6楼

Apart from price and features, the throughput also varies greatly (as mentioned by user1677120):

除了价格和功能外,吞吐量也有很大差异(如用户1677120所述):

EBS EBS

Taken from EBS docs :

摘自EBS文档 :
| EBS volume | Throughput |           Throughput          |
|    type    |   MiB/s    |         dependent on..        |
|------------|------------|-------------------------------|
| gp2 (SSD)  | 128-160    | volume size                   |
| io1 (SSD)  | 0.25-500   | IOPS (256Kib/s per IOPS)      |
| st1 (HDD)  | 20-500     | volume size (40Mib/s per TiB) |
| sc1 (HDD)  | 6-250      | volume size (12Mib/s per TiB) |
           

Note, that for io1, st1 and sc1 you can burst throughput traffic to at least 125Mib/s, but to 500Mib/s, depending on volume size.

请注意,对于io1,st1和sc1,您可以将吞吐量流量突发至至少125Mib / s,但达到500Mib / s,具体取决于卷大小。

You can further increase throughput by eg deploying EBS volumes as RAID0

您可以通过将EBS卷部署为RAID0来进一步提高吞吐量

EFS EFS

Taken from EFS docs

摘自EFS文档
| Filesystem |    Base    |   Burst    |
|    Size    | Throughput | Throughput |
|    GiB     |   MiB/s    |   MiB/s    |
|------------|------------|------------|
|         10 |        0.5 |        100 |
|        256 |       12.5 |        100 |
|        512 |       25.0 |        100 |
|       1024 |       50.0 |        100 |
|       1536 |       75.0 |        150 |
|       2048 |      100.0 |        200 |
|       3072 |      150.0 |        300 |
|       4096 |      200.0 |        400 |
           

The base throughput is guaranteed, burst throughput uses up credits you gathered while being below the base throughput (so you'll only have this for a limited time, see here for more details.

基本吞吐量得到保证,突发吞吐量会消耗您在低于基本吞吐量时收集的信用额度(因此您只能在有限的时间内使用此信息,请参阅此处了解更多详细信息。

S3 S3

S3 is a total different thing, so it cannot really be compared to EBS and EFS.

S3是完全不同的东西,因此无法与EBS和EFS进行比较。

Plus: There are no published throughput metrics for S3.

另外:S3没有公布的吞吐量指标。

You can improve throughput by downloading in parallel (I somewhere read AWS states you would have basically unlimited throughput this way), or adding CloudFront to the mix

您可以通过并行下载来提高吞吐量(我在某处读取AWS状态,您可以通过这种方式获得基本无限的吞吐量),或者将CloudFront添加到混合中

继续阅读