Lesson 1 · Unit 03
Object storage
Keys, durability, signed URLs, storage classes and the cost of leaving
What you practise
- Buckets and keys, durability against availability, signed URLs, storage classes, the cost of data leaving
Try a question from this lesson
Pick one
An app saves user photos as files on its one web server's disk. The team adds a second server behind a load balancer. What breaks first?
Correct answer
Half the requests reach a server without the file
Why
Each server only has the files that were uploaded through it. Disks do not sync by themselves. Files have to move out of the servers into a store that every server can reach.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Buckets, keys, objects
Object storage keeps files outside your servers.
A bucket is a named container. An object is a blob of bytes stored under a key: a string such as users/42/cat.jpg.
There are no real folders. The / is part of the key, and you list objects by prefix.
You put, get and delete whole objects over HTTP. There is no disk to size and no editing the middle of a file.
AWS: S3. Cloudflare: R2, which speaks the same S3 API.
bucket: pics
key size
users/42/cat.jpg 2 MB
users/42/dog.jpg 3 MB
users/7/sunset.jpg 5 MBConcept
Durable is not available
Durability is the chance that stored bytes are not lost. Object stores keep several copies on separate devices and repair them constantly.
Availability is the chance that a request succeeds right now.
An object can be perfectly safe and briefly unreachable.
Neither protects you from yourself: a delete is carried out durably too. Versioning and backups are for that.
S3 and R2 are also strongly consistent: a read after a successful write sees that write.
10 more exercises in the app
- 1× fill the blanks
- 3× multiple choice
- 2× true or false
- 1× order the lines
- 2× type the answer
- 1× match the pairs
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.