FullStack AI Hub
Studio
lesson depth
Mastery
not started · 0%

Object Storage with Amazon S3 and MinIO

Compare S3 and MinIO object keys, multipart commits, checksums, consistency, and erasure-coded availability for large durable objects.

Freshness: current•13 min read•Data Engineering and Databases
Isometric Diagram LabSystem Design · 10 steps · 9 min

Object Storage, Erasure Coding & Multipart Uploads

Visualize immutable blob metadata separation, erasure-coded durability, and presigned direct uploads.

Open Isometric Walkthrough
Full Technical Reference Document

Mental model

Amazon S3 and MinIO expose objects through buckets and keys, but multipart upload separates staging from publication: parts remain private to an upload ID until completion creates one key. A successful object write is atomic for that key; neither service provides a transaction across multiple keys. S3 documents strong read-after-write semantics, while MinIO's erasure-set quorum determines how many drive failures a deployment tolerates.

Theory

An object is addressed by a bucket and a key. A key such as tenant=42/day=2026-11-21/events-0001.parquet looks like a path, but the slash-delimited prefixes are part of one key string rather than directories that can be renamed atomically. Prefixes are still useful for grouping data by tenant, date, or retention policy, and for organizing listings and access rules. Do not scatter random prefixes to imitate old sharding advice without measuring the service and workload: Amazon S3 scales request rates across prefixes, and a sudden increase can receive temporary 503 Slow Down responses while scaling catches up.

For a normal PutObject, the service publishes one object at one key. Amazon S3 guarantees strong read-after-write consistency for successful object PUT and DELETE operations, including subsequent GET, HEAD, and LIST observations. That does not create a multi-key transaction. If a workflow writes a data object and a separate manifest, a reader can observe one key without the other unless the application defines a commit protocol. Concurrent writes to the same key also need explicit policy: versioning preserves versions, while a conditional request can prevent an unexpected overwrite.

Multipart upload lets a client transfer one large object in independently retriable pieces. The client initiates an upload and receives an upload ID, sends numbered parts, then submits the ordered part-number and ETag list to complete it. Only successful completion assembles and publishes the object under its key; uploaded parts are not visible as the final object. A lost connection during completion is an ambiguous result, so a retry should inspect the key and its metadata or use a unique key before repeating work. ETags for a completed multipart object are not necessarily an MD5 digest; use explicit checksums when integrity needs to be verified.

Parts left behind after an abandoned upload consume storage until the client aborts the upload or a lifecycle rule removes it. A production bucket should have an abort-incomplete-multipart policy that matches the longest legitimate upload duration. Completion and abort must be coordinated with in-flight part requests, since a part request that was already running can finish after an abort starts.

MinIO implements an S3-compatible API and can run as a distributed object store on customer-managed drives. Its availability design uses erasure sets: each object is encoded into data shards and parity shards on drives selected for its bucket and key namespace. A read or write needs the quorum defined by the erasure set and parity configuration. For a 16-drive erasure set configured with four parity shards, the data layout has twelve data shards and tolerates up to four failed drives for reads. Write quorum rules also prevent a split cluster from accepting incompatible updates when exactly half the drives are isolated. Erasure coding repairs availability; it does not replace backups, replication across failure domains, or testing restore procedures.

MinIO documents strict read-after-write and list-after-write consistency for its supported I/O operations. As with S3, that guarantee applies to individual object operations rather than a transaction over a manifest and hundreds of data keys. Treat portable API calls and provider-specific consistency and checksum features as separate contracts, then test the exact client and server versions you deploy.

Mechanism and implementation boundary

Consider a 48 GiB analytics file split into 64 MiB parts. It requires 48 × 1024 / 64 = 768 part requests, plus one initiation and one completion request. With eight uploads in flight, the client needs about 8 × 64 MiB = 512 MiB of part buffers if it keeps one buffer per worker. Increasing part size reduces request count but raises memory pressure and retry cost. Choosing parallelism should use measured network bandwidth, client memory, server limits, and the duration of the largest retry.

Mbuffers=C×SM_{\text{buffers}} = C \times S

Here M_buffers is the client's in-flight buffer memory in bytes, C is the number of concurrent part uploads, and S is the buffer size in bytes for each part. The estimate excludes SDK copies, TLS buffers, and checksum state, so leave headroom rather than setting concurrency from the process memory limit.

Operational design

Use an object key scheme that makes listing, lifecycle, and authorization understandable to the operators who own the data. A tenant/date/table prefix can align with scoped queries and retention rules; it is not a promise that data are physically stored in a directory or that every backend distributes keys in the same way. For S3, monitor request latency, 503 responses, bytes transferred, multipart backlog, and per-prefix request rates. For MinIO, monitor drive health, healing progress, erasure-set quorum, read/write latency, and free space in every pool. A healthy endpoint can hide a degraded set with little spare parity.

Treat multipart metadata and object metadata as part of the data contract. Record a content checksum and schema version, and store the intended dataset generation in a manifest or database row. Publish that manifest only after all data objects have completed and passed validation. When readers need a consistent multi-object snapshot, write immutable versioned keys and atomically update a small pointer or manifest last; do not rely on listing order as a transaction boundary.

Failure modes and misconceptions

An upload ID is not a published object. A crash after part uploads but before completion leaves billable fragments, not a readable key. A lifecycle rule cleans up stale fragments but can also remove a very long-running valid upload if its deadline is too short. Set the cleanup interval above the documented maximum transfer window and alert on the age and bytes of incomplete uploads.

A successful PUT response confirms an object-level write, not the consistency of a collection of keys. If a downstream reader lists a prefix while an ingestion job is still writing several objects, it can see only a subset of the job's files. Use versioned immutable names and publish a manifest after validation. A read-after-write guarantee for one key cannot make a set of independent keys appear atomically.

Never infer object integrity from an ETag alone. Multipart, encryption, copy operations, and provider-specific implementations can produce ETags that are not a whole-object MD5 checksum. Supply a supported checksum algorithm, verify the stored checksum after completion, and retain the expected value with the manifest. For endpoints other than Amazon S3, confirm checksum API support in the deployed MinIO version.

MinIO parity is a deployment choice with a direct capacity and availability cost. More parity reduces the usable fraction of each erasure set and changes write quorum behavior; fewer parity shards leave less tolerance for correlated drive failures. Disks in one chassis or power domain do not become independent merely because their data shards are separate. Track the failure domains that align with nodes and drives, and test recovery while a set is degraded.

Trade-offs

Multipart upload improves throughput and retry granularity for large objects, but every part adds requests, buffers, and incomplete-upload state. A small object usually fits better in a single PUT. Larger parts are more efficient on a stable fast path, while smaller parts make a lost transmission cheaper to repeat. Benchmark with the actual network and SDK, and set a maximum object size and upload duration from operational limits.

Amazon S3 delegates drive placement and erasure coding to the managed service; operators choose storage classes, replication, versioning, and lifecycle controls. MinIO exposes erasure-set and pool behavior so a team can run object storage close to its compute, but it must operate hardware, healing, expansion, and quorum monitoring. S3 API compatibility makes common object operations portable, not every feature, lifecycle semantic, checksum mode, or performance profile. Test the exact operations and SDK versions used by the application on both providers.

Decision scenario

A feature store writes 4,000 Parquet objects for each daily build and then publishes one manifest that downstream jobs read. The build currently updates keys in place and readers sometimes mix two generations. Move each build to a generation-specific prefix, upload objects with checksums, validate counts and schema, and publish a small manifest pointer last using a conditional write. Set multipart abort cleanup for abandoned large files and, on MinIO, alert before parity loss approaches write quorum. Keep the prior manifest until readers have moved to the new generation.

Learning outcomes

  • Trace a multipart upload from initiation through part transfer, completion, and visible object reads.
  • Distinguish strong per-key consistency from application-level atomicity across objects.
  • Estimate multipart buffer memory and explain how MinIO parity affects capacity and drive-failure tolerance.

Quantitative model

The 48 GiB example uses 768 parts at 64 MiB each. Eight concurrent uploads hold about 512 MiB of part data in flight before runtime overhead. If the worker budget is 1 GiB, allocating sixteen 64 MiB buffers would consume the entire budget and leave no room for the SDK, TLS, or application. Measure peak resident memory during retries before increasing upload concurrency.

CreateMultipartUpload returns upload ID
numbered parts transfer with checksums
CompleteMultipartUpload publishes object key
manifest conditionally points to generation
MinIO erasure-set healing restores failed shards
Conceptual teaching model synthesized from:aws-s3-multipart-docs,aws-s3-consistency-docs,minio-availability-docs

Implementation pattern

This boto3 example uses the common S3 multipart calls and can target Amazon S3 or a MinIO endpoint configured through environment variables. It aborts unfinished work on local errors; production clients should also reconcile ambiguous completion timeouts by checking the destination key and checksum before retrying.

python
import os
from pathlib import Path
​
import boto3
from botocore.config import Config
​
endpoint = os.getenv("S3_ENDPOINT_URL")
config = Config(s3={"addressing_style": "path"}) if endpoint else Config()
client = boto3.client(
"s3",
endpoint_url=endpoint,
region_name=os.getenv("AWS_REGION", "us-east-1"),
config=config,
)
bucket = os.environ["DATA_BUCKET"]
source_path = Path("events.parquet")
key = "tenant=42/day=2026-11-21/events-0001.parquet"
upload_id = client.create_multipart_upload(Bucket=bucket, Key=key)["UploadId"]
parts = []
try:
with source_path.open("rb") as source:
part_number = 1
while chunk := source.read(64 * 1024 * 1024):
response = client.upload_part(
Bucket=bucket, Key=key, UploadId=upload_id,
PartNumber=part_number, Body=chunk,
)
parts.append({"PartNumber": part_number, "ETag": response["ETag"]})
part_number += 1
result = client.complete_multipart_upload(
Bucket=bucket, Key=key, UploadId=upload_id,
MultipartUpload={"Parts": parts},
)
except Exception:
try:
client.abort_multipart_upload(Bucket=bucket, Key=key, UploadId=upload_id)
except Exception:
pass
raise
print("Published object ETag:", result["ETag"])
Reflect before revealing the guide

Prerequisites & Related Concepts (2)

Private notes

0 words
Recommended Free Track
Free · Verifiable Credential

FS-201Production LLM Engineer

Design an observable full-stack LLM product from capability validation through interfaces retrieval evaluation security and operations.

37 concepts~35h self-paced
Start Free Course
Weekly Engineering Dispatch

Get the weekly systems teardown

One technical note per week covering inference bottlenecks, retrieval harnesses, and commit-pinned teardowns.

Next