AlgoViz

Object storage

easy 26 min

Object storage keeps files as objects: the bytes, some metadata and a unique key, in a flat bucket reached over HTTP.

Video lesson · Chapter 1 of 5

Give a photograph an address

0:00 / 3:42

Object storage in 90 seconds

1:30Reel coming soon

Theory

Read or listen first. About 2 min.

What it is

Object storage, also called blob storage, manages data as objects. An object is three things: the content, metadata about it, and a unique key. Objects live in buckets, and you reach them with HTTP requests such as PUT and GET.

There are no real folders. A key like images/2024/photo.jpg is one name that happens to contain slashes. This flat design is what lets the store spread over very many machines.

Why it exists

Applications collect large files that rarely change: pictures, videos, backups, logs. A disk on one server fills up and fails with the server. A database is made for small records and costs more for each byte.

Object storage takes over the hard parts: copies in several places, growth, and access from anywhere. In return you give up what a disk does well: changing a few bytes in the middle, and very low delay.

A short history

  1. 1996

    Object storage is proposed as a research project at Garth Gibson's laboratory at Carnegie Mellon University.

  2. 13 March 2006

    Amazon announces S3: storage for the internet, with a simple web interface to write and read any amount of data.

  3. 1 December 2020

    S3 begins to give strong read-after-write consistency for all requests.

  4. 5 January 2023

    S3 starts to encrypt every newly uploaded object by default.

  5. 2 December 2025

    S3 raises the largest object from 5 TB to 50 TB.

Words to know

Object
Content, metadata and a key, stored and replaced as one piece.
Bucket
A named container of objects. Azure calls it a container.
Key
The unique name of an object inside its bucket.
Prefix
The beginning of a key, used like a folder when listing.
Storage class
A price plan: cheaper to keep, dearer or slower to read.
Presigned URL
A link that allows one operation on one object for a limited time.
Multipart upload
Sending one large object in parts that can be retried one by one.
Durability
How sure you are that the data is not lost. Different from being reachable now.

Understand it

Start here

Self-storage with a label on each door

Imagine a self-storage building. Anything fits into a unit: skis, a tent, old toys. Every door has a label. You do not walk through rooms inside rooms. You say the label, and the clerk opens that door.

A building full of doors
A label on each doorA1A2B2B7C1C9winter, 4 kg

Real systems often store coded pieces instead of full copies, but the idea is the same: losing one place loses nothing.

The idea

Three kinds of storage

FileBlockObject
You seeFolders and filesNumbered blocksKeys in a bucket
Example/home/user/docsBlock 001, block 002images/photo.jpg in a bucket
AccessFile system callsA disk; needs a file system on topHTTP requests
ChangeAny byteAny blockThe whole object
Good forShared foldersDatabases and boot disksMedia, backups, data lakes
Databases sit on block storage because they change small pieces all the time.
  • Key

    images/2024/profile-photo.jpg: the unique name inside the bucket.

  • Data

    Any bytes. S3 allows up to 50 TB in one object.

  • Metadata

    Content-Type image/jpeg, size 2.4 MB, and your own fields such as x-amz-meta-user: alice.

  • Benefits

    Very large scale, pay for what you use, reachable over HTTP, and 11 nines of designed durability.

Structure

Buckets and flat keys

Account, buckets, objects

The slash is part of the name. Consoles draw folders by grouping keys with the same prefix.

Object storage: flat

  • One lookup by full key
  • No directory that can become a bottleneck
  • A prefix is enough to list
  • Renaming a folder means copying every object

File system: a tree

  • Walks root, images, 2024, photo
  • A record on disk for every file and directory
  • Directories with millions of files are slow
  • Renaming a folder is one small change

A normal S3 bucket name must be unique over all AWS accounts in a partition. Choose names that are hard to guess, and never put secrets or personal data in a key.

Inside

How a request travels

Front end, index, storage nodes

A client sends a request to the front end of an object store. The front end asks an index service where the key is, and reads or writes storage nodes in three separate zones.
A general picture. Providers do not publish every detail, but the split between names and bytes is common.

The parts on the way

PartJob
ClientSends PUT or GET with a bucket and a key
CDN edgeAnswers popular reads close to the user
Load balancerSpreads requests over front ends
Front endChecks identity and permission
Index serviceKnows where the bytes of each key are
Storage nodesHold the bytes, in several zones

One PUT

The key is switched to the new content only after the bytes are safe, so nobody reads half an object.

Durability

Eleven nines

Amazon designs S3 for 99.999999999% durability over a year. Most classes store data redundantly in at least three Availability Zones. It is a design goal for hardware loss, not a promise against your own mistakes.

What eleven nines means

10,000,000 objects×(1−0.99999999999)=107×10−11=10−4 losses a year10{,}000{,}000\ \text{objects} \times (1 - 0.99999999999) = 10^{7} \times 10^{-11} = 10^{-4}\ \text{losses a year}
On average, one lost object in 10,000 years for ten million objects. A wrong delete command is far more likely.

Copies or coded pieces

3 copies: 3.0×10 data + 4 parity pieces: 1410=1.4×\text{3 copies: } 3.0\times \qquad \text{10 data + 4 parity pieces: } \tfrac{14}{10} = 1.4\times
With erasure coding any 10 of the 14 pieces rebuild the object, so 4 losses are survived at less than half the space. The numbers are an example.

Consistency

What you can rely on

S3 gives strong read-after-write consistency: after a successful PUT or DELETE, the next read sees it. Two writers to the same key: the last one wins. If that is not acceptable, use a conditional write. The header If-None-Match refuses to overwrite an existing key.

Money

Storage classes

Amazon S3 classes

ClassForFirst bytePrice to keep
StandardRead oftenMillisecondsHighest of these
Intelligent-TieringUnknown or changing patternMilliseconds, unless archive tiers are onMoves by itself
Standard-IARead about monthly, needed at onceMillisecondsLower, plus a fee to read
One Zone-IAThe same, and easy to make againMillisecondsLower; one zone only
Glacier Instant RetrievalArchive, rare but quickMillisecondsLow
Glacier Flexible RetrievalArchive, can waitMinutes to about 12 hoursLower
Glacier Deep ArchiveKept for years12 to 48 hoursLowest
There is also Express One Zone for very low delay. The rule: the cheaper it is to keep, the more it costs to read, in money or time.

A lifecycle rule

The store moves and deletes by itself. By default S3 does not move objects under 128 KB, because the move would cost more than it saves.
Text
# Terraformresource "aws_s3_bucket" "assets" {  bucket = "my-app-assets"}resource "aws_s3_bucket_versioning" "assets" {  bucket = aws_s3_bucket.assets.id  versioning_configuration {    status = "Enabled"  }}resource "aws_s3_bucket_lifecycle_configuration" "assets" {  bucket = aws_s3_bucket.assets.id  rule {    id     = "archive-old"    status = "Enabled"    filter {}    transition {      days          = 30      storage_class = "STANDARD_IA"    }    transition {      days          = 90      storage_class = "GLACIER"    }    expiration {      days = 365    }    abort_incomplete_multipart_upload {      days_after_initiation = 7    }  }}
The same rule in Terraform, with versioning, and with cleanup of uploads that were never completed after 7 days.

Choosing a class

Safety

Versions, encryption and access

Versioning keeps the old ones

VersionDateSizeState
v11 January1.2 MBkept
v25 January1.4 MBkept
v310 January1.3 MBcurrent
All three are stored and paid for: 3.9 MB. A delete only adds a marker, so it can be undone. Add a lifecycle rule for old versions.
TopicOptions
Encryption by the storeSSE-S3 with keys of the service (the default), SSE-KMS with keys in a key service, SSE-C with keys you send
Encryption before uploadClient-side: the store never sees the content
Who may do whatIAM policies for users and roles, bucket policies on the resource
Old wayACLs on single objects: disabled by default on new buckets
Temporary accessPresigned URLs
No change allowedObject Lock: write once, read many, for a set time
Keep public access blocked, and give each program only the prefix it needs.

Patterns

Uploads and downloads

Direct upload with a presigned URL

The bytes never pass through your servers. Check size and type afterwards, because the client says what it likes.

The whole subject, with resuming, checks and virus scanning, is in file upload APIs. One fact to remember: whoever has the URL can use it until it expires. A signature made with IAM user keys can last at most 7 days, and one made with temporary credentials ends with them.

Multipart upload

  1. 1

    Start

    Ask for an upload and receive an upload id.

  2. 2

    Send parts

    Parts of 5 MiB to 5 GiB, up to 10,000 of them, in parallel. Retry only a part that failed.

  3. 3

    Track

    Each part is stored and answered with an ETag. You pay for parts already stored.

  4. 4

    Complete

    Send the list of part numbers and ETags. The store joins them.

  5. 5

    Clean up

    A lifecycle rule removes uploads that were never completed.

Photos in an application

A user uploads a photo directly to an S3 bucket with a link from the API. The API keeps photo facts in PostgreSQL. Users read photos through a CDN, which fetches from the bucket when it does not have them.
Bytes in the bucket, facts in the database, reads through the CDN.
  • Static site

    Files in a bucket, a CDN in front for speed and HTTPS.

  • Data lake

    Devices, logs and APIs write to raw. Jobs make processed and curated. Analytics, BI tools and ML training read.

  • Backups

    Database dumps, snapshots and recovery logs, copied to another region.

  • Compliance archive

    Deep archive with Object Lock, for example for seven years when a rule demands it.

Many analytics engines read files in the lake directly; see OLAP. S3 Select, which filtered inside one object, is no longer open to new customers.

Speed

Performance

Numbers for S3

FactValue
Largest object50 TB (written as 48.8 TiB in the limits table)
Largest single PUT5 GB
Multipart parts5 MiB to 5 GiB each, at most 10,000
When AWS advises multipartFrom about 100 MB
Requests per partitioned prefixAt least 3,500 writes or 11,000 reads a second
Services change these limits; read the documentation before you rely on one.

Read large objects in ranges and in parallel. Put many tiny records into one larger object, because each request costs money and time. Files with a version in the name can be cached for a long time, since they never change.

Python
import jsonimport boto3from boto3.s3.transfer import TransferConfigs3 = boto3.client("s3")s3.upload_file("local-file.txt", "my-bucket", "remote-key.txt")s3.put_object(    Bucket="my-bucket", Key="data/file.json",    Body=json.dumps({"ok": True}), ContentType="application/json",    Metadata={"processed": "true"},)s3.download_file("my-bucket", "remote-key.txt", "local-file.txt")# A listing has pages of at most 1,000 keys, so use a paginatorpages = s3.get_paginator("list_objects_v2").paginate(    Bucket="my-bucket", Prefix="images/2024/")for page in pages:    for obj in page.get("Contents", []):        print(obj["Key"], obj["Size"])# Multipart from 100 MB, ten parts at a times3.upload_file(    "large-file.zip", "my-bucket", "backups/large-file.zip",    Config=TransferConfig(multipart_threshold=100 * 1024 * 1024, max_concurrency=10),)
The Python SDK boto3. It switches to multipart by itself above the threshold.

Products

Providers

Amazon S3Azure Blob StorageGoogle Cloud Storage
Container nameBucketContainerBucket
Designed durability11 nines11 (LRS), 12 (ZRS), 16 (GRS) nines11 nines
Largest object50 TBAbout 190.7 TiB for a block blob5 TiB
Colder tiersIA, Glacier familyCool, Cold, ArchiveNearline, Coldline, Archive
Automatic tieringIntelligent-TieringLifecycle rulesAutoclass
Around itCloudFront, Athena, Lambda events, AWS BackupData Lake Storage Gen2, Functions, immutable blobsBigQuery, Cloud CDN, function triggers
Compare durability with the same redundancy: 16 nines is for a copy in a second region.

For your own machines, Ceph offers object storage through its RADOS Gateway with S3 and Swift compatible interfaces. MinIO is a well known S3-compatible server; its community repository was archived in April 2026, so check the support you would get before choosing it.

Use it for

  • Pictures, video, documents
  • Backups and archives
  • Logs and data lake files
  • Files of a web site

Do not use it for

  • Rows that change every second: use OLTP
  • A database file that is edited in place
  • Queries by many attributes: keep them in a database
  • Very low delay for tiny values: use a key-value database

Summary

The whole topic in one minute.

Object storage keeps whole objects under keys in flat buckets and is reached over HTTP. It is extremely durable because each object is stored redundantly in several places, and it is cheap because you can choose a storage class that fits how often you read.

Upload large files directly with presigned URLs and multipart uploads, serve them through a CDN, keep facts about them in a database, and let lifecycle rules move or delete old ones. Do not use it as a disk or a database.

  • An object is content, metadata and a key in a flat bucket.
  • Objects are replaced as a whole; folders are only prefixes.
  • Durability comes from redundancy over zones, protection from mistakes comes from versioning.
  • Cheaper classes cost more to read, in money or time.
  • Presigned URLs and multipart move large files without your servers.

Sources