intermediateFiles & Object Storage
Accept a File Without Holding It
Decide what you would build from the brief alone. Everything below it is available, but the exercise stops working if you open it first.
The brief you were given
Users upload avatars. The current endpoint buffers the file in memory and writes it to object storage. Memory spikes are causing restarts.
The trap — the wrong fix that looks right
Raising the container memory limit and moving on, because the restarts stop. The limit buys headroom until someone uploads a larger file, and the failure mode is an OOM kill in the middle of a request — which takes every other in-flight request on that instance with it. The size of the file is chosen by the client; a fix that depends on the client staying reasonable is not a fix.