2.4.2. Amazon S3 for Object Storage (Developer Interaction)
First Principle: Amazon S3 provides highly durable, scalable object storage for developers, enabling applications to efficiently store and retrieve vast amounts of unstructured data via simple API interactions.
S3 stores any amount of data as objects (files) in buckets, with 99.999999999% (11 nines) durability. For developers, S3 is the default answer for storing files, static assets, backups, and data lake content. For developers, S3 is an ideal choice for storing unstructured data like images, videos, documents, backups, and log files.
- Buckets: Data is stored in "buckets," which are containers for objects. Developers create and manage these buckets.
- Objects: Files (objects) are stored with a unique key within a bucket. Each object consists of data, metadata, and a key.
- API Interactions: Developers interact with S3 using RESTful APIs via AWS SDKs (e.g.,
PutObjectto upload,GetObjectto download). - Pre-signed URLs: (Allow temporary access to objects without requiring AWS credentials.) Developers can generate pre-signed URLs to allow users to upload or download objects directly to/from S3 for a limited time.
- S3 Event Notifications: (Configure notifications when certain events occur in a bucket.) Developers can trigger AWS Lambda functions or other services in response to S3 events (e.g., image resizing when a new image is uploaded).
- Security: Control access using Bucket Policies and IAM Policies.
Scenario: You're developing a photo-sharing application where users can upload images. These images need to be stored securely and scalably, and you want to trigger an automated process (e.g., resizing) as soon as an image is uploaded.
ā ļø Exam Trap: S3 is strongly consistent for all operations as of December 2020. Read-after-write is immediate. If a question presents "eventual consistency" as an S3 answer, it's a distractor ā that behavior was eliminated.
