Arkinu
AWS service comparison

Amazon EFS vs Amazon S3: differences and when to use each

Amazon EFS
Amazon S3

Often confused on the examQuestions tend to offer one as a distractor for the other: look for the phrase in the scenario that tips the balance.

Storage

Amazon EFS

Serverless, elastic file system, accessible through the NFS protocol, that grows and shrinks automatically as you add or delete files. It lets many Amazon EC2 instances, containers, or AWS Lambda functions share the same files without provisioning capacity; it is not supported on Windows instances.

Exam phrases that point here

  • «a shared file system accessed by multiple Linux instances at the same time»

    Amazon EFS is a managed NFS file system: many instances mount it at the same time and see the same files, with file locking included.

    When not: If the clients are Windows and use SMB, the answer is usually Amazon FSx for Windows File Server. If the disk is used by a single instance (for example, a self-managed database), Amazon EBS fits.

  • «mount the same storage from instances in multiple Availability Zones»

    A Regional EFS file system stores data across several zones and supports a mount target in each one, so instances in different zones share the same data and the file system survives the loss of a zone.

    When not: If you choose EFS One Zone to save money, the data lives in a single zone and does not survive its loss. And if what you need is a block disk for an instance, Amazon EBS cannot be shared across zones.

  • «file storage that grows and shrinks automatically, without provisioning capacity»

    EFS is elastic: you pay for what you store and do not have to reserve a size in advance.

    When not: If the data is read and written as objects over HTTP or an API (website images, a data lake), Amazon S3 is usually more suitable and cheaper. If you need an extreme-performance parallel file system for HPC, think of Amazon FSx for Lustre.

  • «reduce the cost of files that are rarely accessed, without changing the application»

    With lifecycle management, EFS automatically moves files that are not being used to the Infrequent Access or Archive classes; the application still sees them at the same path.

    When not: If the data is objects in a bucket, the equivalent tool is Amazon S3 lifecycle rules. And if cold files are read frequently and latency matters, it is best to have them return to Standard on first access.

  • «persistent, shared storage for Lambda functions or containers on Fargate»

    Both AWS Lambda and Amazon ECS (with EC2 or Fargate) can mount an EFS file system, and the data survives each invocation or task.

    When not: If you only need temporary space during execution, the service's own ephemeral storage is enough. If the data is stored as objects, Amazon S3 is the simplest option.

Often paired with

  • Amazon EC2
  • AWS Lambda
Study Amazon EFS →

Storage

Amazon S3

Object storage: you store data as objects in buckets and access them by their key, in any amount. It is used for data lakes, websites, backups, archiving, and analytics, and it offers storage classes to adjust cost to access frequency.

Exam phrases that point here

  • «highly durable, scalable object storage for any amount of data»

    Amazon S3 stores objects with no limit on total volume and is designed for eleven nines of durability, copying data across at least three Availability Zones in most of its storage classes.

    When not: If what you need is a block volume for the operating system or database of an EC2 instance, the answer is Amazon EBS; if several instances must mount a shared file system, Amazon EFS is a better fit.

  • «unknown or changing access patterns»

    S3 Intelligent-Tiering monitors each object and automatically moves it between access tiers based on usage, with no retrieval charge and no performance impact.

    When not: If the access pattern is known in advance (for example, data that stops being read after 30 days), a lifecycle rule to a specific storage class can be just as valid and more predictable. Objects smaller than 128 KB are not automatically moved between tiers.

  • «infrequently accessed data that must still be available in milliseconds»

    S3 Standard-IA and S3 Glacier Instant Retrieval offer the same millisecond latency as S3 Standard with cheaper storage, in exchange for a retrieval charge.

    When not: If the data can be re-created and cost matters more than resilience, S3 One Zone-IA is cheaper, but it does not survive the loss of an Availability Zone. If waiting hours is acceptable, an archive class such as S3 Glacier Flexible Retrieval is even cheaper.

  • «keep a copy of the objects in another Region»

    S3 Cross-Region Replication automatically and asynchronously copies new objects from one bucket to another bucket in a different Region, even in another account.

    When not: It replicates only new objects: existing ones require S3 Batch Replication, and both buckets must have versioning enabled. If the goal is to serve content with low latency to users around the world, Amazon CloudFront in front of a single bucket is usually enough.

  • «protect objects from accidental overwrites or deletions»

    With versioning, S3 keeps every version of an object; a delete leaves the previous versions recoverable, and MFA Delete requires a second factor to permanently delete them.

    When not: If a regulation requires the data to be immutable (WORM) for a set period, versioning is not enough: you need S3 Object Lock, in Compliance mode if no one, not even the root user, should be able to bypass the retention.

  • «upload large files to a central bucket from distant locations»

    S3 Transfer Acceleration makes data enter through the nearest edge location and travel to the bucket over an optimized network path, which speeds up long-distance transfers.

    When not: For objects or data sets smaller than 1 GB, the FAQ suggests considering PUT/POST through Amazon CloudFront. If you must move terabytes or petabytes, think of AWS DataSync (with AWS Direct Connect if the internet is not enough) or a physical transfer; AWS Snowball Edge is no longer offered to new customers.

Often paired with

  • Amazon CloudFront
  • AWS Lambda
Study Amazon S3 →