Block, File and Object Storage

Instance store, EBS, EFS and S3: choosing a storage type, S3 classes, lifecycle rules, durability and availability.

What is it?

AWS offers three storage shapes:

  • Block storage (like a raw disk): Amazon EBS volumes attach to one EC2 instance in the same AZ (some types support multi-attach) and persist on their own. Instance store is disk physically attached to the host: very fast, but data is lost when the instance stops or terminates. EBS snapshots are incremental backups in S3-backed storage; you can copy them across Regions.
  • File storage: Amazon EFS is a managed, elastic NFS file system for Linux that many instances can mount at once across AZs. Related options include FSx for Windows and other file systems.
  • Object storage: Amazon S3 stores objects (data + metadata) in buckets at unlimited scale, over HTTP APIs. It is not a drive you mount.

S3 storage classes trade retrieval speed and access frequency for price:

  • S3 Standard: frequent access.
  • S3 Express One Zone: very low latency in a single AZ, for performance-critical data.
  • S3 Intelligent-Tiering: moves objects between tiers automatically when patterns are unknown.
  • S3 Standard-IA and One Zone-IA: infrequent access, lower storage price, retrieval fee.
  • S3 Glacier Instant Retrieval: archive with millisecond access.
  • S3 Glacier Flexible Retrieval: archive, retrieval in minutes to hours.
  • S3 Glacier Deep Archive: cheapest, retrieval within hours (long-term retention).

Lifecycle rules move or expire objects automatically. S3 durability is designed for eleven nines (99.999999999%): data is very unlikely to be lost. That differs from availability (can you read it right now), which varies by class.

More storage and data-protection services

  • Amazon FSx: fully managed third-party file systems: FSx for Windows File Server (SMB), FSx for Lustre (high-performance computing), FSx for NetApp ONTAP and FSx for OpenZFS.
  • AWS Storage Gateway: hybrid service connecting on-premises apps to AWS storage through File, Volume or Tape Gateway types, with local caching.
  • AWS Backup: one place to set backup policies and schedules across EC2, EBS, RDS, DynamoDB, EFS, FSx and more, with cross-Region and cross-account copy.
  • AWS Elastic Disaster Recovery (DRS): continuously replicates servers to a low-cost staging area in AWS and launches them quickly after a disaster.
  • AWS Transfer Family: managed SFTP, FTPS and FTP endpoints that read and write to S3 or EFS, so partners keep their file-transfer clients.

Choosing by access pattern:

  • A virtual disk for one server: block (EBS).
  • A shared drive many servers read and write at once, with file locking, over NFS or SMB: file (EFS, FSx).
  • Upload and serve files over HTTPS with no infrastructure to manage: object (S3).

Object storage has no file locking and isn't meant to be mounted as an OS drive or used for high-IOPS work.

S3 fundamentals

  • An object is a key (its name), the value (the bytes), a version ID when versioning is on, and metadata. Console 'folders' are just key prefixes.
  • Bucket names are globally unique, like domain names, though each bucket lives in one Region.
  • Objects range from 0 bytes to a 50 TB maximum (raised from 5 TB in December 2025; older material says 5 TB). Total storage is unlimited.
  • S3 Standard keeps data across at least three AZs. Intelligent-Tiering moves objects between access tiers based on monitored access, with no retrieval fees and a small monitoring fee (it is not described as machine learning). Standard-IA is as fast as Standard but charges a retrieval fee, so frequent reads get expensive. One Zone-IA keeps one AZ copy; use it only for data you can re-create.
  • Archive data now lives in the S3 Glacier storage classes inside S3; the original vault-based Glacier service is legacy. S3 on Outposts has its own class for keeping S3 data on premises.
  • Bucket types: general purpose (the normal choice), directory buckets (for S3 Express One Zone), plus table buckets and vector buckets for newer use cases.

S3 security and protection

  • Objects and buckets are private by default, and Block Public Access is on for new buckets. You must turn it off on purpose before any policy can make data public.
  • Use bucket policies (Effect, Principal, Action such as s3:GetObject, Resource as an ARN like arn:aws:s3:::my-bucket/*). s3:GetObject on the whole bucket is very broad; least privilege scopes it to a prefix or adds conditions. ACLs are legacy: AWS recommends Object Ownership set to bucket owner enforced, which disables ACLs.
  • A presigned URL shares one private object for a limited time you set.
  • Encryption at rest is always on by default with SSE-S3 (S3-managed keys). Alternatives: SSE-KMS (keys in AWS KMS; S3 Bucket Keys cut KMS request costs) and DSSE-KMS (dual-layer encryption).
  • Versioning keeps every version, protecting against accidental overwrites and deletions, or an attacker deleting data. Object Lock adds write-once-read-many (WORM) protection for a retention period or indefinitely, and requires versioning.
  • Uploads can include checksums (such as SHA or CRC) to verify integrity.
  • A bucket must be emptied before it can be deleted.

EBS details: volumes and snapshots live in the EC2 console; Amazon Data Lifecycle Manager automates snapshot schedules. Volume types:

  • General Purpose SSD: gp3 is current and generally preferred over gp2.
  • Provisioned IOPS SSD (io1/io2): demanding databases.
  • Throughput Optimized HDD (st1) and Cold HDD (sc1): can't be boot volumes.

Turn on encryption at launch, or by default for the Region. Encrypting an existing unencrypted volume later means snapshot, encrypted copy, then restore.

EFS details: serverless and elastic; you pay for what you store, with no size to provision. Options: Regional (multi-AZ) or One Zone storage, lifecycle management to move cold files to cheaper Infrequent Access and Archive tiers, and throughput modes (Elastic, Provisioned or Bursting).

EFS creates a mount target in each AZ of the VPC, and access points give apps their own entry point. Files outlive any instance: a new instance mounting the same file system sees the same data.

Explain like I'm 10

EBS is a hard drive on your desk: fast and yours, but one desk at a time. EFS is a shared network folder the whole office can open. S3 is a giant warehouse of labeled boxes: you hand over a box and get a ticket, and never edit a box in place. Glacier is the archive basement: cheap shelves, but fetching a box takes a while.

Examples

S3 lifecycle configuration

{
  "Rules": [
    {
      "ID": "age-out-logs",
      "Status": "Enabled",
      "Filter": { "Prefix": "logs/" },
      "Transitions": [
        { "Days": 30,  "StorageClass": "STANDARD_IA" },
        { "Days": 90,  "StorageClass": "GLACIER_IR" },
        { "Days": 365, "StorageClass": "DEEP_ARCHIVE" }
      ],
      "Expiration": { "Days": 2555 },
      "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }
    }
  ]
}

Apply with aws s3api put-bucket-lifecycle-configuration --bucket NAME --lifecycle-configuration file://lifecycle.json. Check minimum storage durations and transition rules for each class first.

Everyday storage commands

# S3
aws s3 cp report.csv s3://zykit-demo-bucket-12345/reports/report.csv --storage-class STANDARD_IA
aws s3 sync ./site s3://zykit-demo-bucket-12345/site --delete
aws s3 ls s3://zykit-demo-bucket-12345/reports/

# EBS volume and snapshot
aws ec2 create-volume --size 20 --volume-type gp3 --availability-zone eu-west-1a
aws ec2 create-snapshot --volume-id vol-0abc1234 --description "pre-upgrade"

Which storage?

Need                                        Choose
------------------------------------------  ----------------------
Boot disk / database volume for one EC2     EBS
Scratch data, caches, can be lost           Instance store
Shared files for many Linux servers         EFS
Images, backups, data lake, static site     S3
Rarely read compliance archive              S3 Glacier Deep Archive

How it works

EBS volumes are network-attached and replicated within their AZ. They survive an instance stop but not the loss of the AZ; snapshots protect against that. EFS replicates across multiple AZs and grows and shrinks automatically. S3 replicates objects across multiple AZs (except One Zone classes) and offers versioning, cross-Region replication, encryption and access controls.

S3 access is controlled by IAM policies, bucket policies and Block Public Access settings. Presigned URLs grant temporary access to objects.

  EC2 instance
    |-- Instance store (local, ephemeral)
    |-- EBS volume (one AZ)  --snapshots--> S3-backed storage
    '-- EFS mount (shared, multi-AZ)

  Application / users --HTTP API--> S3 bucket (objects)
        lifecycle: Standard -> IA -> Glacier -> Deep Archive -> expire

Why does it exist?

Data differs in access pattern, performance needs and value. One storage type for everything would be too slow, too costly or too fragile. Specialised types match cost to need.

When to use it

  • EBS: databases and boot volumes.
  • EFS: shared Linux file systems.
  • S3: static content, backups, logs and analytics data.
  • Lifecycle rules: cut cost as data ages.
  • Intelligent-Tiering: unpredictable access.

When not to use it

Don't keep irreplaceable data on instance store. Don't use S3 as a low-latency block device for a database. Don't put hot data in deep archive classes: retrieval is slow and fees apply.

Common mistakes

  • Treating durability and availability as the same thing.

  • Leaving buckets public.

  • Forgetting EBS volumes and snapshots keep costing after instances are deleted.

  • Moving small objects to cold classes where minimum size or duration charges outweigh savings.

  • Using One Zone classes for data you cannot recreate.

  • Using Storage Gateway when a one-time bulk move is needed - that is DataSync or Snow Family territory.

  • Choosing Standard-IA for data read many times a month; retrieval fees make it cost more than Standard.

  • Trying to delete a bucket that still has objects (or old versions) in it.

  • Making a whole bucket public to share one file instead of using a presigned URL.

  • Expecting to use an HDD (st1/sc1) EBS volume as a boot volume.

  • Launching unencrypted EBS volumes and having to snapshot-copy-restore later to encrypt them.

  • Assuming S3 bucket names only need to be unique in your account; they are globally unique.

Practice exercises

  1. Easy:

    Classify each as block, file, or object: EBS, EFS, S3, instance store.

  2. Medium:

    Write lifecycle rules for application logs kept 7 years with the cheapest cost and rare retrieval.

  3. Medium:

    Use the unit converter to estimate the monthly size of 1 TB written daily and what that means for storage class choice.

  4. Hard:

    Explain how you would restore a database volume after an AZ failure using snapshots, and what data could be lost.

  5. Easy:

    Pick block, file or object storage for: a shared folder for ten Linux web servers, a database disk, user-uploaded profile photos.

  6. Medium:

    Write a bucket policy that lets anyone read only the objects under the public/ prefix of one bucket, and list what else must be changed before it works.

  7. Medium:

    Design protection for regulated records that must not be deleted for seven years, even by administrators. Which S3 features do you combine?

Interview questions

Durability vs availability for S3?

Durability is the likelihood data is not lost (eleven nines); availability is the likelihood you can access it at a moment, which differs between classes.

EBS vs EFS?

EBS is block storage usually attached to a single instance in one AZ; EFS is a shared network file system accessible from many instances across AZs.

What happens to instance store data when the instance stops?

It is lost.

Exam-style: Which S3 class is cheapest for long-term archives retrieved rarely?

S3 Glacier Deep Archive.

Exam-style: Which feature automatically moves objects between storage classes over time?

S3 Lifecycle rules (or S3 Intelligent-Tiering for unpredictable access).

Exam-style: Which service gives on-premises applications access to cloud storage with local caching?

AWS Storage Gateway.

Which service centralises backup policies across many AWS services?

AWS Backup.

Which service provides managed SFTP into Amazon S3?

AWS Transfer Family.

Exam-style: How can you share a private S3 object with a customer for a limited time without making it public?

Generate a presigned URL with an expiry.

Exam-style: Which S3 feature provides write-once-read-many (WORM) protection?

S3 Object Lock (requires versioning).

Exam-style: Which feature protects S3 data from accidental overwrites and deletions by keeping old copies?

S3 Versioning.

Exam-style: Which storage service gives many Windows servers a shared SMB file system?

Amazon FSx for Windows File Server.

Exam-style: Which service is a high-performance file system for HPC and machine learning workloads?

Amazon FSx for Lustre.

What are the three Storage Gateway types?

File Gateway (files stored as S3 objects), Volume Gateway (block volumes backed up to AWS) and Tape Gateway (virtual tapes for existing backup software).

What is the maximum size of a single S3 object?

50 TB (it was 5 TB until December 2025).

Is S3 data encrypted by default?

Yes. All new objects are encrypted at rest with SSE-S3 unless you choose SSE-KMS or DSSE-KMS.