# Understanding delta updates

**URL:** <https://forums.balena.io/t/understanding-delta-updates/365224>\
**Category:** Product support\
**Tags:** docker\
**Created:** [October 24, 2022, 10:44am UTC](https://forums.balena.io/t/understanding-delta-updates/365224 "2022-10-24T10:44:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonWood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@JonWood](https://forums.balena.io/u/JonWood)\
**Post date:** [October 24, 2022, 10:44am UTC](https://forums.balena.io/t/understanding-delta-updates/365224/1 "2022-10-24T10:44:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![nitishagar](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/nitishagar/32/4967_2.png) [@nitishagar](https://forums.balena.io/u/nitishagar)\
**Post date:** [October 24, 2022, 12:34pm UTC](https://forums.balena.io/t/understanding-delta-updates/365224/4 "2022-10-24T12:34:46Z")

</div>

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](https://github.com/balena-os/balena-benchmarks)

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

---

<div class="post-metadata">

**Author:** ![JonWood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@JonWood](https://forums.balena.io/u/JonWood)\
**Post date:** [October 24, 2022, 1:14pm UTC](https://forums.balena.io/t/understanding-delta-updates/365224/6 "2022-10-24T13:14:21Z")

</div>

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.
