-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Implement one/multiple more efficient serializers for the dapr client.
Title says it all really. Currently the only Serializer
subclass implemented is DefaultJSONSerializer
. JSON is a perfectly fine serialization method with some strong advantages, but also some very strong disavantages, not least when it comes to byte efficiency/information density. Given the scale of messages sent, states stored etc one could imagine a dapr system could benefit significantly from the ability to use a more efficient serializer based on a technology such as msgpack, bson, etc.
I am happy to do all related work for this myself. I've already looked at all the relevant sections of the codebase and I think this will be perfectly feasible and easy enough within the current defined framework for serializers. It should be perfectly possible to implement this in a way such that it is transparent to any user who does not make an active change by making sure all code defaults to json serialization unless explicitly specified. I am just going to wait for a maintainer to okay this as a viable idea before starting work on it, given my time is limited enough as is.
The obvious question is what serializers to add, but it does not strike me as worth arguing much over. The already-present flexibility of the system means that ones can just be added as people wish, and there is no penalty for creating one or another first - and as long as all defaults are kept to the JSON serializer, there is no harm possible to anyone who does not explicitly opt in regardless. Personally the first one I will implement is probably msgpack based on the ormsgpack library.
RELEASE NOTE: ADD New [TYPE] serializer option for python dapr clients.