JSON Compression in Axon Server?

When your event payloads are JSON and are persisted to Axon Server (AS) are they compressed in any sort of way?

I’m thinking in the way that Postgres has a binary JSON column type (jsonb) does AS do any compression or is it just the bytes associated with a UTF-8/UTF-16 String?

Hi @vab2048!

Axon Server does not do any level of compression right now.
It simply receives the byte[] as given by the client application.

When this client application is an Axon Framework application, you can adjust the Serializer to further “compress” or shorten the data sent over the wire.

Note that it did cross the minds of the Axon Server team to implement compression.
However, at this stage and given the current setup, if it would be on the radar, it is far away.

Hence, I would recommend you play around with the Serializer (assuming you are using Axon Framework) to optimize the size.
Perhaps the recent PR that will add a CBOR option makes sense for you?

1 Like

Thanks, I was just asking out of curiosity and was pleasantly surprised to see the PR.

Will check it out!