0

We're using protobuf to serialize messages and send them to an HTTP API. We recently started to implement a cache for our API to improve the performances when a message was already processed in the past.

Our first idea was to use a hash of the binary message generated by protobuf as a key for our cache but we figured out that protobuf doesn't guarantee messages to be deterministics across different environments.

Is there a good strategy to use protobuf messages as a cache key (knowing that we'd like to avoid implementing our own serialization logic) ?

Bertrand
  • 994
  • 9
  • 23
  • 1
    This might be helpful - https://stackoverflow.com/questions/68965130/hash-protobuf-object-to-a-string-as-the-key-for-redis-database – Shiva Nov 09 '22 at 05:06

0 Answers0