Ref: https://learn.cantrill.io/courses/1820301/lectures/41301623 [ASSOCIATESHARED]
DEMO: https://learn.cantrill.io/courses/1820301/lectures/41301625 [ASSOCIATESHARED]
S3 Service
- 🔧 S3 is AWS’s default storage service
- Object Storage
- 👍 Perfect for hosting large data sets (movies, audio, photos, text, large data sets…)
- Economical
- Access via UI/CLI/API and even HTTP(S)
- 👍 Public service, unlimited data & multi-user
- Many AWS products use S3 as their default input and/or output of data
- ‼️ S3 is a global storage platform, but is regionally based/resilient!!
- Bucket names must be globally unique
- Data stored in regions
- Data replicated across AZs of the region
- 💡 You don't need to set region in S3 until you create things inside S3
- Since S3 is Object Store…:
- It is NOT File Store → can't browse an S3 bucket like a File System
- It is NOT Block Store → can't mount an S3 bucket as
K:\\
or /images
- 💡 Use EBS for mountable block storage
S3 Objects
- 💡 objects ≈ files (conceptually interchangeable most of the time)
- Components
- Key → identifies the object in a bucket
- e.g.
koala.jpg
- 💡 same function as a filename
- Value → data/contents of the object
- can range from 0B to 5TB → S3 is very scalable!
- Other components: Version ID, metadata, access control list (ACL), subresources
- An object is placed inside a bucket, cannot exist without it
- Summary Diagram of S3 Objects
S3 Buckets
- 🔧 S3 Bucket = container of S3 objects
- Created in a region → stable & controlled data sovereignty
- Its data never leaves the region unless configured to do so
- Can hold an unlimited number of objects → S3 is an infinitely scalable storage system
- Bucket name → identifies the bucket (across the whole AWS!)
- e.g.
koaladata
- ‼️ Bucket names must be globally unique!! (across ALL regions & ALL AWS accounts!)
- 💡 This is why the ARN of an S3 Bucket does not include the region it's stored in
- e.g.
arn:aws:s3:::koalacampagin13333337
- Bucket naming restrictions:
- 3-63 characters, all lower case, no underscores
- Must start with lowercase or number
- Can not be formatted like IP addresses (e.g.
1.2.3.4
)
- FLAT structure (NO complex structure) ← Because S3 is Object Storage
- Objects all stored at same level (no folders, directories nor nodes)
- ‼️ AWS UI presents directories in S3… but it's NOT how it actually is!
- e.g. a bucket has objects with keys:
koala1.jpg
, koala2.jpg
, /old/koala1.jpg
, and /old/koala2.jpg
→ AWS UI displays what looks like a directory called /old
, but it doesn't exist! Those objects are all actually stored at the same level!
/old/
is not a folder/directory, it's a prefix! → Prefixes can be used to filter objects by their keys (and AWS UI displays prefixes separately, in folders)
- Screenshot of AWS UI for an S3 bucket:
- Limit of buckets per account:
- Soft: 100 buckets
- Hard: 1000 buckets
- To go past 100 buckets, submit request to AWS support team
- 💡 Limits are relevant because they influence architecture
- e.g. can't have 1 bucket/user if you have 1000+ users → use a prefix per user instead
- Private by default
- There's even a failsafe (on by default) to prevent all public access