天天看點

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添加到混合中

繼續閱讀