I am using custom serializer for my EventStore.
The deserialize/2 function is unable to deserialize a snapshot with snapshot_module_version = n - 1 if snapshot_version in the snapshotting configuration is equal to n. In other words: it's not backward compatible.
Currently, when trying to read snapshot when rebuilding aggregate state, the snapshot is read, deserialized and the version is checked against the configured one.
Of course, this doesn't work for me, because as soon as the snapshot is sent to the deserialize/2 function, it raises an exception.
I am not sure if I am using the custom serializer incorrectly, so please correct me, if I am wrong. I thought that the snapshot retrieval could use some JSON(B) querying to return nil if there's no snapshot in the EventStore with the current version.
This could skip the useless deserialization if the snapshot is already old.
If I am thinking correctly, I could try to implement this myself. If not, then thanks for the clarification in advance. :-)
I am using custom serializer for my
EventStore.The
deserialize/2function is unable to deserialize a snapshot withsnapshot_module_version = n - 1ifsnapshot_versionin thesnapshottingconfiguration is equal ton. In other words: it's not backward compatible.Currently, when trying to read snapshot when rebuilding aggregate state, the snapshot is read, deserialized and the version is checked against the configured one.
Of course, this doesn't work for me, because as soon as the snapshot is sent to the
deserialize/2function, it raises an exception.I am not sure if I am using the custom serializer incorrectly, so please correct me, if I am wrong. I thought that the snapshot retrieval could use some JSON(B) querying to return
nilif there's no snapshot in the EventStore with the current version.This could skip the useless deserialization if the snapshot is already old.
If I am thinking correctly, I could try to implement this myself. If not, then thanks for the clarification in advance. :-)