Amazon Web Services
Cloud Storage
S3 Architecture
AWS S3
Data Management

Amazon S3 architecture

Codemia Knowledge Hub ·

Amazon Simple Storage Service (Amazon S3) is object storage, not a file system or block storage. Its architecture rests on buckets that hold objects, keys that identify those objects, Regions that decide where data lives, and access controls that decide who can reach it. It was designed with a minimal feature set to make web-scale computing easier for developers.

Core components

  • Buckets: A bucket is a container for objects, and every object lives in one. Buckets are the basic unit of organization in S3 and set the scope of controls such as permissions and geographic storage settings.
  • Objects: An object is the fundamental entity stored in S3. It consists of data and metadata. The data is opaque to S3, while the metadata is a set of name-value pairs describing the object, either predefined or user-defined.
  • Keys: Each object has a key that uniquely identifies it within its bucket. Bucket, key and version ID together uniquely identify every object.
  • Regions: S3 is hosted in geographic locations around the world, made up of Regions and Availability Zones, which determine where data resides.
  • Access control: Objects can be private or public. Permissions can be set on individual objects or through bucket policies.

Object size and operations

Objects can be up to 5 terabytes, with metadata up to 2 kilobytes. The main operations are PUT (upload), GET (retrieve or download), DELETE (remove) and LIST (list available buckets), each with its own configuration options.

Durability, availability and scale

S3 is designed for 99.999999999% (11 nines) durability and 99.99% availability of objects over a given year. It achieves this by replicating data across multiple servers in Amazon's data centers, and it is built to handle large amounts of traffic and data.

Security and compliance

S3 encrypts data in transit and at rest. You can manage your own encryption keys or use keys provided by S3. S3 also supports a number of compliance certifications for regulated data.

Pricing

You pay for what you use: storage consumed, number of requests and data transfer.

Uploading a file with Boto3

To store user-generated content such as photos and videos, you can upload a file to a bucket with Python and Boto3. Note that this example is configured for DigitalOcean Spaces, an S3-compatible service, through endpoint_url. For Amazon S3 itself you would use an AWS Region and drop the custom endpoint.

python
1import boto3
2
3# Initialize a session using DigitalOcean Spaces
4session = boto3.session.Session()
5client = session.client('s3',
6                        region_name='nyc3',
7                        endpoint_url='https://nyc3.digitaloceanspaces.com',
8                        aws_access_key_id='YOUR_ACCESS_KEY',
9                        aws_secret_access_key='YOUR_SECRET_KEY')
10
11# Upload a new file
12with open('example.jpg', 'rb') as data:
13    client.upload_fileobj(data, 'mybeautifulbucket', 'example.jpg')

Components at a glance

FeatureDescriptionExample Value
BucketsContainers for storage"photos-2022"
ObjectsItems stored in buckets"vacation.jpg"
KeysUnique identifier for each object"vacation.jpg"
RegionsGeographic area data is stored"US-West"
Access ControlPermissions for accessing dataPublic/private, user-based rules

Amazon provides documentation, SDKs for popular languages and a community forum, which cover advanced features such as lifecycle policies and cross-origin resource sharing (CORS).


Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design