Photo upload pipeline
Direct-to-store uploads, async processing, and durable intents.
Photo upload pipeline
Business constraint
Users upload photos. API VMs should not proxy gigabytes. Processing (EXIF strip, variants) is async.
Naive v0
multipart through the API to disk, then DB. Or client uploads without authz checks.
Failure drill
API saturates on bandwidth. Partial uploads corrupt state. Retries create duplicate objects. Processing runs twice with different outputs.
Evolution path
Iteration 1
Presign PUT to object store (lab mental model: mini-object-store). API records intent row first (outbox).
Iteration 2
Completion callback or poll marks object durable; worker claims processing with idempotency key = object id.
Iteration 3
Virus scan / EXIF strip as gated stages before public visibility.
Implementation cut
Never mark public before processing gates. Idempotent variant writes. Expire abandoned intents.
Numbers
API CPU during uploads near-flat. Duplicate variant rate ~0. Abandoned intent cleanup lag SLO.
Pattern tags
Self-check
- Why presign instead of proxy?
- What does the intent row prevent?
- How do you idempotent processing?
- When is an object safe to show?
- What expires abandoned uploads?
Walkthrough
Recordings will appear here when published. Until then, work the failure drill and lab locally — pause after each iteration and write the metric that moved.
Lab package: see /systems/labs/mini-object-store/.