Protobuf for binary data

1,755 views
Skip to first unread message

sansun08

unread,
Nov 8, 2009, 11:45:17 AM11/8/09
to Protocol Buffers
I have written a client server application in java. The client
application upload's huge files to the server via http. Will protobuf
be helpful in improving the speed of uploads. To be more precise, does
it compress binary data(A class containing a byte array of size 256k
and few more sting fields. Will this be a good candidate for protobuf
serialization.). Based on the documents, I do see that protobuf does
encoding, but I also get an impression that it is efficient only in
the case of object serialization of complex class structures. Is my
understanding right?

Evan Jones

unread,
Nov 8, 2009, 12:41:04 PM11/8/09
to sansun08, Protocol Buffers

Are you using Java serialization? If so, protocol buffers are almost
certainly going to take up less space on the wire, due to the "extra"
stuff Java serialization needs to do. If you have written your own code
to write the data, protocol buffers would probably be slightly larger.
However, you also get benefits like being able to change the messages in
backwards compatible ways, or interfacing with different languages.

If you just have binary data and text strings, you probably want to
consider gzipping your data.

Evan

--
Evan Jones
http://evanjones.ca/

Kenton Varda

unread,
Nov 8, 2009, 4:28:32 PM11/8/09
to sansun08, Protocol Buffers
Protobuf does not do compression (though you can, of course, apply compression on top of protobufs).

If you are just looking to transmit a large blob of bytes with no structure, then protobufs won't help you.

sansun08

unread,
Nov 9, 2009, 12:17:37 AM11/9/09
to Protocol Buffers

Thanks to you all. This answers my question.

Sankar

On Nov 9, 2:28 am, Kenton Varda <ken...@google.com> wrote:
> Protobuf does not do compression (though you can, of course, apply
> compression on top of protobufs).
>
> If you are just looking to transmit a large blob of bytes with no structure,
> then protobufs won't help you.
>
Reply all
Reply to author
Forward
0 new messages