Arkinu
AWS service comparison

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

Amazon EBS
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 EBS

Block storage for Amazon EC2 instances: volumes that you attach to an instance and use like a local hard drive, plus snapshots that store point-in-time copies. It provides an instance's disk, for example to store files or install applications.

Exam phrases that point here

  • «persistent block storage for an EC2 instance»

    An Amazon EBS volume behaves like a disk attached to the instance, and its data survives even if the instance is stopped or terminated (if so configured).

    When not: If several instances, even in different Availability Zones, must share the same files, Amazon EFS fits. If the data is temporary and can be lost along with the instance, instance store may be enough.

  • «mission-critical database that needs high, consistent IOPS with very low latency»

    io2 Block Express volumes are designed for demanding databases: sub-millisecond latency, provisioned IOPS, and higher durability than the other EBS volumes.

    When not: If a balance between price and performance is enough, gp3 is usually the choice. And if the scenario prioritizes not managing the database, the answer may be a managed service such as Amazon RDS instead of choosing the volume.

  • «high-throughput sequential workloads, such as big data or log processing»

    HDD volumes (st1 and sc1) are optimized for large, sequential reads and writes, measured in MB/s, at a lower cost than SSDs.

    When not: With small, random I/O, such as that of a transactional database, HDDs perform poorly and the answer becomes an SSD volume (gp3 or io2). Of the two HDDs, sc1 is for cold data that is accessed infrequently.

  • «automate the creation, retention, and deletion of EBS snapshots»

    Amazon Data Lifecycle Manager creates snapshots of volumes or instances with certain tags on a schedule, deletes old ones according to retention, and can copy them to other Regions, at no additional cost.

    When not: If you need to manage backups of several services (EBS, RDS, DynamoDB, EFS...) from a single place, or apply policies across the whole organization, the tool is AWS Backup.

  • «attach the same volume to multiple instances in a cluster»

    EBS Multi-Attach lets you attach a Provisioned IOPS volume (io1 or io2) to multiple instances in the same Availability Zone at once, for cluster applications that coordinate access to the disk.

    When not: The application must coordinate writes (for example, Windows Server Failover Cluster or NVMe reservations); a regular file system would be corrupted. If all that is needed is to share files between instances, the answer is Amazon EFS. A volume with Multi-Attach cannot be used as a boot volume.

  • «ensure that all new volumes are encrypted»

    EBS encryption by default is turned on with a single setting per Region and requires every new volume to be created encrypted with AWS KMS.

    When not: The setting is per Region: it must be turned on in each Region you use. If you must also share encrypted snapshots with other accounts, they must be encrypted with a customer managed key, not the default key.

Study Amazon EBS →

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 →