I am working on matching engine and i want my service to receive order as message and then find the corresponding matched order then i want to send this order and matched orders’ array to other microservices which one should i use Json or protocol buffer ?
If you have to ask us, then I think you should start with JSON. It’s much easier to get started with.
This is really a design question, and based on what you have told us there is no reason you should pick Protocol Buffers over JSON.
i was reading protocol buffer is 6 time faster than json and in my case latency is an important concern
Then you should consider using Protocol Buffers in this case? We can’t make a decision for you.
If your application ends up fast enough using JSON, then use that. Try it out!
Measure first. Protobuf is always more compact, but is not automatically faster than JSON.
I had a program that processed large amounts of data, streaming it between files, and needed fast encoding and decoding. For that particular program, protobuf and
encoding/json had the same performance, so JSON ended up as the better choice.
right i understand now
You might consider JSON sequences rather than a regular JSON object. That way, the receiver can decode on a streaming basis rather than having to wait for the entire reply, which will help reduce latency.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.