zlacker

[parent] [thread] 1 comments
1. klabb3+(OP)[view] [source] 2023-07-24 05:15:34
Correct. Text based is more than fine these days, as long as you use length prefix so you can avoid escaping. But you do still need to parse lines which can be tricky in bare or poorly tooled environments. It’s the best trade off today, because debugging binary formats is a serious obstacle.

> Json would be less efficient; gRPC adds tons of complexity and overhead.

Indeed. There aren’t many suitable specs around, and this protocol, albeit custom, is very easy to implement. Which is proven by the fact that there are well maintained Nats clients in many different languages.

replies(1): >>no_cir+VQ1
2. no_cir+VQ1[view] [source] 2023-07-24 16:25:31
>>klabb3+(OP)
The only developers that would likely need to debug binary protocols are the framework developer themselves. It would be an extremely rare occurrence for someone to need to use a binary/hex viewer to figure out what is going wrong with their "app". Perhaps you are thinking of telemetry/introspection of one's own messages? In that case there usually is a library call to convert them to a human readable format like JSON, e.g., https://protobuf.dev/programming-guides/proto3/#json.

IMO it is a real waste of developer time to code up a new transport protocol without determining that the existing ones don't work or don't perform as well as needed. Multiply that by all the programming languages that need to be supported... when instead the client APIs could have been mostly code generated.

Although may only apply to the "client-side" API, what is going in the message payload? JSON probably, or some other serialization format. I don't think a lot of developers are hand writing parsers for their own payloads. The overhead of the JSON or Protobuf parser is already in there.

[go to top]