Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purge properties must be compressed using deflate #996

Open
sorru94 opened this issue Oct 1, 2024 · 0 comments
Open

Purge properties must be compressed using deflate #996

sorru94 opened this issue Oct 1, 2024 · 0 comments

Comments

@sorru94
Copy link
Contributor

sorru94 commented Oct 1, 2024

When dealing with properties the purge properties message is essential for the correct state synchronization of a device with an Astarte instance.
The current specification requires the purge properties message payload to be compressed using deflate. This to minimize the size of the payload and increase the efficiency of the Astarte protocol.
However, when dealing with resource-constrained embedded devices the overhead required to compress the payload might surpass the gained benefits.
Let's take as an example the Astarte device SDK for Zephyr. With a simple application taking care of transmitting some datastreams and setting some properties.
Excluding the compression the RAM heap usage never exceeds 6K Bytes.
If we instead include the compression of the purge properties message the used RAM heap rumps up to over 14K Bytes.
Furthermore, the purge properties message is not always transmitted or received when connecting to Astarte.

Some suggestions to improve this
It would be awesome for a device to have the choice of compression or non-compression of the purge properties message.
One first suggestion would be to encode the purge properties state in an empty cache message.
The empty cache message payload is currently hardcoded to "1". However, this is of little utility as already receiving an empty cache message is unequivocal. The payload could be used to encode a choice in the purge properties compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant