Storage
    📦Storage

    Amazon S3

    Scalable object storage for any type of data with high durability

    Think of S3 as an infinitely large filing cabinet where you can store anything: photos, videos, documents, backups, entire databases. This filing cabinet never gets full, never catches fire, and makes 11 copies of everything you put in it, spreading them across multiple buildings. You don't organize files in folders exactly; you throw them in 'buckets' and give each file a unique name (a key). Want to find your file? Just ask for it by name. It's like having a librarian with perfect memory who never sleeps. And unlike a real filing cabinet, you can give specific people keys to specific drawers, or even make some files public so anyone on the internet can grab them.

    S3 is an object storage service, not a file system: there's no hierarchy, just a flat namespace of objects within buckets. Each object has a key (filename), metadata, and data (up to 5TB per object). S3 provides 99.999999999% (11 nines) durability by replicating objects across at least 3 Availability Zones. Storage classes let you optimize cost: S3 Standard for frequent access, S3 Intelligent-Tiering for unknown patterns, S3 Glacier for archival.

    Key Capabilities

    Key configurations: bucket policies and IAM policies control access (bucket policies are resource-based, IAM policies are identity-based; you need both aligned). Versioning protects against accidental deletes. Server-side encryption (SSE-S3, SSE-KMS, SSE-C) encrypts at rest.

    Gotchas & Constraints

    Gotcha #1: S3 provides strong read-after-write consistency for all operations (PUTs, DELETEs, and LIST requests) as of December 2020. After a successful write or delete, any subsequent read will immediately return the latest version of the object. Gotcha #2: Bucket names are globally unique across all AWS accounts; you can't create a bucket if someone else already has that name. Constraints: S3 is region-specific; cross-region replication requires explicit configuration. Public access is blocked by default (since 2018) to prevent data leaks.

    A media company stores 500TB of video content for a streaming platform. They use S3 with a multi-tier strategy: new releases in S3 Standard for high-speed access, content older than 90 days automatically moved to S3 Intelligent-Tiering (saves 40% on infrequently watched videos), and archived footage moved to S3 Glacier Deep Archive (saves 95% vs. Standard). They enable S3 Cross-Region Replication to replicate critical content to a second region for disaster recovery. CloudFront CDN sits in front of S3 to cache popular videos at edge locations worldwide, reducing S3 GET requests by 80% and improving viewer latency. S3 Event Notifications trigger Lambda functions when new videos are uploaded; Lambda automatically generates thumbnails and transcodes videos to multiple resolutions, storing outputs back in S3.

    Official AWS Documentation