System Design Notebook / 02
Object Storage
Why a file is not your application's data, and what to do about it
Seven ways the obvious design dies, one at a time, then block, file and object storage compared on what they actually promise. Ends on the trade you are making when you pick one.
- pages
- 86
- sections
- 54
- editions
- Reading, Print, Tablet
Sign in to read it
Sign in and the whole notebook opens, all three editions with it. An account is what makes a download belong to someone.
Sign in with GitHub or GoogleStart reading
How to use this book
What is inside
Every section, and every one of them opens in the browser. Nothing here is hidden: if a section you need is not in this list, the notebook is not the right one and you should not spend a week on it.
- How to use this book
- The whole picture on one page
- 1The requirement, and the intuitive answer
- 2Failure 1: the file does not fit
- 3Failure 2: the disk is ephemeral
- 4Failure 3: horizontal scaling, and the 1-in-N 404
- 5Failure 4: the disk grows the wrong way
- 6Failure 5: durability is not availability
- 7Failure 6: your server is an expensive CDN
- 8Failure 7: no transaction across two systems
- 9Block storage
- 10File storage, and what POSIX costs
- 11Object storage: the minimum interface
- 12The trade you are actually making
- 13Key, value, metadata, bucket
- 14There are no folders
- 15Designing the key
- 16Why LIST is not a lookup
- 17What happens when you PUT
- 18The data plane: replication and erasure coding
- 19Eleven nines, read carefully
- 20The metadata plane
- 21Consistency: eventual, then strong
- 22Conditional writes, the primitive that changed things
- 23Architecture A: through your server
- 24Buffering versus streaming
- 25The limits streaming does not remove
- 26Architecture B: presigned URLs
- 27The hole in a presigned PUT
- 28Presigned POST policies
- 29The two-phase upload
- 30Reconciliation: pending, expired, orphaned
- 31CORS, the last mile
- 32Why a single PUT stops working
- 33The multipart protocol
- 34Choosing the part size
- 35The ETag trap
- 36Abandoned uploads: the invisible bill
- 37The full large-file architecture
- 38Resuming
- 39Never relay a download
- 40Three delivery patterns
- 41Why a presigned GET destroys your cache
- 42Range requests
- 43Segmented streaming, and where object storage stops
- 44The bill
- 45The security surface
- 46Lifecycle, storage classes and versioning
- 47Untrusted content, and what to watch
- 48The delivery script
- 49Whiteboard drawing order
- 50Follow-up question bank
- Appendix A. Numbers to memorise
- Appendix B. Glossary
- Appendix C. Self-test
How to read it
Read with a pen. Every notebook opens with a question to answer before you start and asks you to redo the answer at the end, and the margin in the Print edition exists so you have somewhere to be wrong first. The Tablet edition is 16:9 with vector text, so note apps draw on it rather than treating it as a photograph.