At work we're using HTTP requests and now we added RabbitMQ in the last few months to deal with the fact that our frontend has to talk to our backend. After seeing this article it feels like we chose the wrong tool for the job; protobuf/thrift appear to be typed which would have saved us a lot of frustration as we've already run into multiple cases where the receiver or sender have messed up the type conversion or pa…
I don't see how protobuf is mutually exclusive with RabbitMQ. RabbitMQ is a message broker and can send around byte arrays. These byte arrays can be anything, including protobuf messages.
Using Protobuf instead of JSON to communicate with a front end
41–50 of 99 posts
Re: Using Protobuf instead of JSON to communicate with a front end
#42Earlier quoted context omitted.
I don't see how protobuf is mutually exclusive with RabbitMQ. RabbitMQ is a message broker and can send around byte arrays. These byte arrays can be anything, including protobuf messages.
(The above, but yes, send protobufs because they are typed.)
Re: Using Protobuf instead of JSON to communicate with a front end
#43This will allow you to switch between JSON and protobuf binary on the wire easily, while using official protobuf client libraries. So you can choose easily whether you care more about size/speed efficiency or wire readability. Best of both worlds!
I work on the protobuf team at Google and would be happy to answer any questions.
Re: Using Protobuf instead of JSON to communicate with a front end
#44Re: Using Protobuf instead of JSON to communicate with a front end
#45Making JSON first-class is an explicit design goal of proto3, the next version of Protocol Buffers currently in alpha: https://developers.google.com/protocol-buffers/docs/proto3#j... This will allow you to switch between JSON and protobuf binary on the wire easily, while using official protobuf client libraries. So you can choose easily whether you care more about size/speed efficiency or wire readability. Best of bo…
http://hperadin.github.io/jvm-serializers-report/report.html
Re: Using Protobuf instead of JSON to communicate with a front end
#46Have you guys tried MsgPack? If so, is it worth it? http://msgpack.org/
Re: Using Protobuf instead of JSON to communicate with a front end
#47Making JSON first-class is an explicit design goal of proto3, the next version of Protocol Buffers currently in alpha: https://developers.google.com/protocol-buffers/docs/proto3#j... This will allow you to switch between JSON and protobuf binary on the wire easily, while using official protobuf client libraries. So you can choose easily whether you care more about size/speed efficiency or wire readability. Best of bo…
Do you plan on improving Protobuf speed in Java? People don't expect it to be slower than JSON ;) http://hperadin.github.io/jvm-serializers-report/report.html
One unavoidable issue is that, unlike JSON, protobuf serializers have to do two passes over the message tree, because in protobuf binary format all submessages are prefixed by their length. The first pass just calculates lengths, while the second performs the actual serialization. This could potentially slow down serialization compared to JSON, especially for message trees with lots of nodes/depth.
Re: Using Protobuf instead of JSON to communicate with a front end
#48I like to use Protobuf in my server code, but then support JSON _or_ Protobuf as the encoding. So browsers can continue to use JSON, but the server gets strongly-typed Protobuf structures.
Which library do you use to support both?
Re: Using Protobuf instead of JSON to communicate with a front end
#49Have you guys tried MsgPack? If so, is it worth it? http://msgpack.org/