AWS S3 Fundamental Concepts
Amazon S3 (Simple Storage Service) is a highly scalable, durable, and available object storage service offered by Amazon Web Services (AWS). It is designed for 99.999999999% (11 nines) of durability and stores data as objects within buckets.
Key Concepts
Objects: The fundamental entities stored in S3. An object consists of data, metadata (a set of name-value pairs describing the object), and a key (the unique identifier for the object within a bucket). Objects can be any type of file, such as images, videos, documents, or backups. The maximum size for a single object is 5 TB.
Buckets: Logical containers for storing objects. Buckets are globally unique across all AWS accounts and are associated with a specific AWS region. You can control access to buckets and their objects using various security mechanisms.
Keys: The unique identifier for an object within a bucket. The key is essentially the full path to the object within the bucket. For example, if you have a bucket named
my-unique-bucketand an object namedphotos/vacation/image.jpg, thenphotos/vacation/image.jpgis the key.Regions: Geographical locations where AWS data centers are clustered. When you create an S3 bucket, you choose a region for it. This choice impacts latency, cost, and regulatory compliance. Storing data closer to your users can reduce latency.
Versioning: A feature that allows you to keep multiple versions of an object in the same bucket. This protects against accidental deletions and overwrites, as every version of an object is preserved. When versioning is enabled, every time an object is modified or deleted, a new version is created.
S3 Access Control
S3 provides several mechanisms to control access to your buckets and objects:
- Bucket Policies: JSON-based policies attached to a bucket that define permissions for users and AWS services.
- Access Control Lists (ACLs): Legacy access control mechanism that grants read/write permissions to individual objects. While still supported, bucket policies are generally preferred for their flexibility.
- IAM Policies: Identity and Access Management (IAM) policies can be attached to IAM users, groups, or roles to grant permissions to S3 resources.
S3 Storage Classes
S3 offers different storage classes optimized for various use cases, balancing cost and access frequency:
- S3 Standard: For general-purpose storage of frequently accessed data.
- S3 Intelligent-Tiering: Automatically moves data between two access tiers (frequent and infrequent) based on access patterns, optimizing costs.
- S3 Standard-IA (Infrequent Access): For data that is accessed less frequently but requires rapid access when needed.
- S3 One Zone-IA: For data that is accessed less frequently and can be stored in a single Availability Zone, offering lower cost but less resilience than Standard-IA.
- S3 Glacier: For archival data that is rarely accessed and can tolerate retrieval times of minutes to hours.
- S3 Glacier Deep Archive: The lowest-cost storage class for long-term archival, with retrieval times of hours.
Lifecycle Management
Allows you to define rules to automatically transition objects between different storage classes or expire them after a certain period. This helps optimize storage costs by moving data to less expensive storage classes as it ages or becomes less frequently accessed.
Replication
S3 offers two types of replication:
- Same-Region Replication (SRR): Replicates objects between buckets in the same AWS region.
- Cross-Region Replication (CRR): Replicates objects between buckets in different AWS regions. This is useful for disaster recovery, compliance, and reducing latency for users in different geographical locations.
Event Notifications
S3 can send notifications when certain events occur in your bucket, such as object creation, deletion, or restoration. These notifications can be sent to Amazon SNS topics, Amazon SQS queues, or AWS Lambda functions, enabling automated workflows.
