AWS EFS vs EBS vs S3 (differences & when to use?) [closed]
Asked Answered
D

13

407

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

My understanding of each:

  • S3 is a storage facility accessible any where
  • EBS is a device you can mount onto EC2
  • EFS is a file system you can mount onto EC2

So why would I use EBS over 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. I guess my understanding of EBS is lacking hence I'm unable to distinguish.

Why choose S3 over 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 use standard I/O methods from your programming language of choice to create files. But is that the only real difference?

Derbent answered 11/4, 2015 at 8:43 Comment(1)
EFS is like NFS. EBS is essentially a SAN. S3 is kinda like WebDav. Glacier is probably blueray DVDs storagemojo.com/2014/04/25/amazons-glacier-secret-bdxlGerfen
C
552

One word answer: MONEY :D

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

  • Glacier: $0.004/Month (Note: Major price cut in 2016)
  • S3: $0.023/Month
  • S3-IA (announced in 2015.09): $0.0125/Month (+$0.01/gig retrieval charge)
  • EBS: $0.045-0.1/Month (depends on speed - SSD or not) + IOPS costs
  • EFS: $0.3/Month

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

  • SNS
  • SQS
  • Kinesis stream
  • 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:

  • 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.
  • It's a highly available service.
  • It's a managed service
  • You can attach the EFS storage to an EC2 Instance
  • Can be accessed by multiple EC2 instances simultaneously
  • Since 2016.dec.20 it's possible to attach your EFS storage directly to on-premise servers via Direct Connect. ()

EBS is:

  • 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
  • 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.
  • You can snapshot an EBS (while it's still running) for backup reasons
  • 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)
  • You need an EC2 instance to attach it to
  • New feature (2017.Feb.15): You can now increase volume size, adjust performance, or change the volume type while the volume is in use. You can continue to use your application while the change takes effect.

S3 is:

  • 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
  • But it's perfect for storing your images and videos for your website
  • Great for short term archiving (e.g. a few weeks). It's good for long term archiving too, but Glacier is more cost efficient.
  • 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)
  • Much cheaper than 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

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)

As it got mentioned in JDL's comment, there are several interesting aspects in terms of pricing. For example Glacier, S3, EFS allocates the storage for you based on your usage, while at EBS you need to predefine the allocated storage. 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.)

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

Counterbalance answered 11/4, 2015 at 20:56 Comment(14)
Glacier is extremely expensive if data needs to be restored quickly liangzan.net/aws-glacier-calculatorBellbella
Disagree that S3 is cheaper than EBS. With S3 you can only have 2000 PUT and 20 000 GET for free. With EBS you have 2 000 000 I/O operations for free. Here is my QA #34049366Edyth
2 000 000 S3 read costs ~0.4$, 2 000 000 write costs ~$5... But the main point is, you need to choose the right storage for the task. S3 is (mostly) for big, not too frequently changing but widely accessible files the best. (with a lots of exception :D )Counterbalance
you can mount an S3 bucket as local storage. i assume you meant without 3rd party tools? sharadchhetri.com/2013/03/08/…Kibler
S3 bucket is NOT meant to be as a local storage. There can be scenarios where it is maybe a good idea, but generally NO! S3 is NOT a file system. Even with 3rd party tools locking and several other "Filesystem features" are not working properly.Counterbalance
Good comparison. But one other major difference between EBS and EFS, is EBS is a fixed amount of storage. So yes, 1 GB comparison is different, but why would you create a 1GB EBS partition? Minimum, if you are going to create a 10 GB partition, then you are looking at $.5-1.0 for that same 1GB of data stored on the 10GB of data. Depending on how fast your need to store data will grow and how much unused space you want to keep paying for, EFS may be a better option.Mutule
Also worth noting: EFS currently only works with Linux, not Windows.Blackthorn
You can now access EFS on-premise, and you can remove "You need an EC2 instance to attach it to" from your answer! aws.amazon.com/blogs/aws/…Helicoid
Very good overview! Just a small note - I might be wrong, but I don't think EFS data is distributed across regions, only across multiple Availability Zones in the same region.Osana
@Ivan: Good point. (Did I say EFS is cross region?) You need an instance or a service which migrates your data between the EFS in two different regions. Can be useful for warm standby for Disaster Recovery. ( This should be a built in feature! :D ) Cross region charges apply.Counterbalance
Financial cost aside, I would emphasize the fact that you can serve static assets directly from S3 as one of the most important distinctions. If your site is asset-heavy, having a third-party server handle those requests is going to have a huge impact on the web traffic you need to handle. If you're running a platform like WordPress, which expects to store stuff on the local FS, S3 involves some extra work, but if your app is already 12FA this is a huge advantage with minimal technical costs.Scrimpy
@Adam Ocsvari While s3 is clearly not meant to be a filesystem, could you explain which drawbacks it implies for such a use ? We have several servers using "large" ammount of EBS (read 50 to 200GB), and would like to replace this static provisionning with a more "elastic" one. S3 seemed great, since we can mount it using s3fs. EFS... would look even better if it wasn't so expensive (In such conditions, we'd rather provision 1TB than using EBS). Since the files of our IS are not extensively accessed, it doesn't look like a bad idea... if reliable. Looks more arguable for our GIT, though.Glass
"Can be accessed by multiple EC2 instances simultaneously" probably is one of, if not the biggest, difference maker between EBS vs EFS.Paramorph
Note, with EFS, you can use Lifecycle Management to further reduce costs to $0.025 / GB-Month after 7, 14, 30, 60, or 90 days since last access. So the cost can radically change using lifecycle management. This makes it close to comparable cost to S3. I chose EFS because of Lifecycle cost savings but high performance for X days.Warford
G
134

I wonder why people are not highlighting the MOST compelling reason in favor of 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.

(Edit 2020 May, EBS supports mounting to multiple EC2 at same time now as well, see: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html)

Giffard answered 4/9, 2015 at 6:0 Comment(3)
Similarly, this is a difference between using S3 and EBS -- S3 and EFS work well for data shared across multiple servers, whereas EBS doesn't.Shool
also EFS cannot be used as an origin for CDN, S3 is better for this role. If you have a lot of assets that needs to be up for CDN, better use S3Inductor
EBS's IO1 & IO2 can now be multi attached bit can't be used as boot volumes in that case.Justajustemilieu
R
84

Fixing the comparison:

  • S3 is a storage facility accessible any where
  • EBS is a device you can mount onto EC2
  • EFS is a file system you can mount onto several EC2 instances at the same time

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.

Why would you use S3?

  • You don't have a need for the files to be 'local' to one or more EC2 instances.
  • (effectively) infinite capacity
  • built-in web serving, authentication
Rabato answered 11/4, 2015 at 15:57 Comment(1)
I recently set up an EFS volume as it is now available in West-2. I seem to be having write issues with large files. For example creating a docker container fails with "file too large" and creating a sqlite db also failed. Didn't have these issue on the EBS volume I was using. So yea EFS may have usability/reliability issues that need "fixing" at this time.Deadpan
I
9

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

EBS

Taken from EBS docs:

| 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.

You can further increase throughput by e.g. deploying EBS volumes as RAID0

EFS

Taken from EFS docs

| 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 is a total different thing, so it cannot really be compared to EBS and EFS. Plus: There are no published throughput metrics for 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

Iamb answered 9/3, 2018 at 7:4 Comment(0)
G
8

To add to the comparison: (burst)read/write-performance on EFS depends on gathered credits. Gathering of credits depends on the amount of data you store on it. More data -> 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 throughput drops to about 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.

Glenn answered 20/7, 2017 at 5:58 Comment(0)
F
6

AWS (Amazon Web Services) is well-known for its extensive product line. There are (probably) a few Amazon Web Services ninjas who know exactly how and when to use which Amazon product for which task. The rest of us are in desperate need of assistance.

AWS offers three common storage services: S3, Elastic Block Store (EBS), and Elastic File System (EFS), all of which function differently and provide various levels of performance, cost, availability, and scalability. We'll compare the performance, cost, and accessibility to stored data of these storage options, as well as their use cases.

AWS Storage Options:

Amazon S3 is a basic object storage service that can be used to host website images and videos, as well as data analytics and smartphone and web applications. Data is managed as objects in object storage, which means that all data types are stored in their native formats. With object storage, there is no hierarchy of file relationships, and data objects can be spread through many machines. You can use the S3 service from any computer with an internet connection.

AWS EBS offers block-level data storage that is persistent. Block storage systems are more versatile and provide better capacity than standard file storage since files are stored in several volumes called blocks, which serve as separate hard drives. An Amazon EC2 instance must be mounted with EBS. Business continuity, software testing, and database management are examples of use cases.

AWS EFS is a shared, elastic file storage framework that expands and contracts in response to file additions and deletions. It follows the conventional file storage model, with data organized into folders and subdirectories. EFS is useful for content management systems and SaaS applications. EFS can be mounted on several EC2 instances at once.

Which AWS Cloud Storage Service Is Best?

As always, it depends.

For data storage alone, Amazon S3 is the cheapest choice. S3, on the other hand, has a range of other pricing criteria, including cost per upload, S3 Analytics, and data transfer out of S3 per gigabyte. The cost structure of EFS is the most straightforward.

Amazon S3 is a cloud storage service that can be accessed from anywhere. AWS EBS is only accessible in a single region, while multiple EFS instances can share files across multiple regions.

EBS and EFS both outperform Amazon S3 in terms of IOPS and latency.

With a single API call, EBS can be scaled up or down. You can use EBS for database backups and other low-latency interactive applications that need reliable, predictable performance because it is less expensive than EFS.

Large amounts of data, such as large analytic workloads, are better served by EFS. Users must break up data and distribute it between EBS instances because data at this scale cannot be stored on a single EC2 instance allowed in EBS. The EFS service allows thousands of EC2 instances to be accessed at the same time, allowing vast volumes of data to be processed and analyzed in real-time.

Fulton answered 30/4, 2021 at 8:16 Comment(0)
A
4

EBS is simple - block level storage which can be attached to an instance from same AZ, and can survive irrespective of instance life.

However, interesting difference is between EFS and S3, and to identify proper use cases for it.

Cost: EFS is approximately 10 times costly than S3.

Usecases:

  • Whenever we have thousands of instances who needs to process file simultaneously EFS is recommended over S3.
  • Also note that S3 is object based storage while EFS is file based it implies that whenever we have requirement that files are updated continuously (refreshed) we should use EFS.
  • S3 is eventually consistent while EFS is strong consistent. In case you can't afford eventual consistency, you should use EFS
Albuminuria answered 31/12, 2019 at 13:16 Comment(3)
S3 supports now strong consistency: aws.amazon.com/fr/s3/consistencyBolitho
Could you please explain bit more why EFS is recommended over S3 during simultaneous access(as in your first case).Unguent
@Krupa: EFS allows more read/write operations per second compared to S3 on the same file. EFS - In General Purpose mode, there is a limit of 35,000 file operations per second. Operations that read data or metadata consume one file operation, operations that write data or update metadata consume five file operations. i.e. maximum 35,000 read operations per second, or 7,000 write operations or some combination of the two. S3 - 3,500 PUT/COPY/POST/DELETE or 5,500 GET/HEAD requests per second per prefix in a bucketAlbuminuria
E
3

In simple words

Amazon EBS provides block level storage .

Amazon EFS provides network-attached shared file storage.

Amazon S3 provides object storage .

Eulalie answered 17/4, 2019 at 19:25 Comment(0)
C
1

AWS EFS, EBS and S3. From Functional Standpoint, here is the difference

EFS:

  1. Network filesystem :can be shared across several Servers; even between regions. The same is not available for EBS case. This can be used esp for storing the ETL programs without the risk of security

  2. Highly available, scalable service.

  3. Running any application that has a high workload, requires scalable storage, and must produce output quickly.

  4. It can provide higher throughput. It match sudden file system growth, even for workloads up to 500,000 IOPS or 10 GB per second.

  5. Lift-and-shift application support: EFS is elastic, available, and scalable, and enables you to move enterprise applications easily and quickly without needing to re-architect them.

  6. Analytics for big data: It has the ability to run big data applications, which demand significant node throughput, low-latency file access, and read-after-write operations.

EBS:

  1. for NoSQL databases, EBS offers NoSQL databases the low-latency performance and dependability they need for peak performance.

S3:

Robust performance, scalability, and availability: Amazon S3 scales storage resources free from resource procurement cycles or investments upfront.

2)Data lake and big data analytics: Create a data lake to hold raw data in its native format, then using machine learning tools, analytics to draw insights.

  1. Backup and restoration: Secure, robust backup and restoration solutions
  2. Data archiving
  3. S3 is an object store good at storing vast numbers of backups or user files. Unlike EBS or EFS, S3 is not limited to EC2. Files stored within an S3 bucket can be accessed programmatically or directly from services such as AWS CloudFront. Many websites use it to hold their content and media files, which may be served efficiently via AWS CloudFront.
Charming answered 23/11, 2020 at 17:45 Comment(0)
D
1

The main difference between EBS and EFS is that EBS is only accessible from a single EC2 instance in your particular AWS region, while EFS allows you to mount the file system across multiple regions and instances.

Finally, Amazon S3 is an object store good at storing vast numbers of backups or user files.

Deference answered 4/2, 2021 at 3:8 Comment(0)
M
0

Amazon EBS provides block level storage - It is used to create a filesystem on it and store files. Amazon EFS - its shared storage system similar like NAS/SAN. You need to mount it to unix server and use it. Amazon S3 - It is object based storage where each item is stored with a http URL.

One of the difference is - EBS can be attached to 1 instance at a time and EFS can be attached to multiple instances that why shared storage. S2 plain object storage cannot be mounted.

Mg answered 22/8, 2019 at 8:40 Comment(0)
S
0

EFS & S3 have the same purpose, you can store any kind of object or files.

But for me the only difference is EFS is allowing you to have a traditional file system in the VM(EC2) cloud with more flexibility like you can attach to multiple instances.

S3, on the other hand, is a separate flexible and elastic server for your objects. It can be used for your static files, images, videos or even hosting static app (js).

EBS is obviously for block storage where you can install OS or anything related to your OS.

Selfeffacement answered 25/5, 2020 at 7:29 Comment(0)
M
0

This question is very much answered by other people, I just want to make a point whenever deciding on any service to be in AWS is that understanding the use case for each and also see the solution that the service will provide in terms of the Well-Architected Framework, do you need High Availability, Fault Torelant, Cost optimization. This will help to decide on any kind of service to be used.

Marxmarxian answered 8/1, 2021 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.