Understanding delta updates

I’m currently working on some prototyping using Balena for application updates on devices and trying to properly understand how delta updates work, with a view to keeping them small since we have devices that will be pulling updates over low quality mobile connections.

I’ve got a multi-stage Docker build, with the first stage using the build variant of your Python image, and the final stage using the run variant. The run stage copies a Python virtual env containing our PIP dependencies and the application source code from the build stage.

My confusion is coming from a couple of places. Firstly the Balena builder is reporting a delta of 544.62KB when I change a single line in one of the application’s source files, where I’d expect a significantly smaller delta. Its possible the build process is seeing a fresh install of PIP packages/wheels as being a change, but they should be stable from a binary perspective since its just downloading the same files.

The second confusion stems from poking images on an actual device - the latest and delta-${HASH} tagged images are both showing as being 1.06GB. Is there something happening locally that would result in that? During update downloads it also feels like the time it takes indicates a much bigger download than 500KB, but I have nothing but gut feel to back that.

Is there anything I can do inspect what’s causing deltas to be larger than expected, and the validate that devices are in fact downloading only the delta and not a full image?

Hi @jonwood,

I’d suggest look at some of our benchmark examples and compare to your Dockerfile to see what changes can help leverage the full potential of deltas. Ref: GitHub - balena-os/balena-benchmarks: Benchmarks for balaena

Let us know if you have any follow-up question.

My question is not so much about how I can make use of deltas, and more how I can validate that they are in fact being used - as mentioned balena-engine images shows both tags as being the same size, and download times don’t line up with a delta of a few hundred KB.