[erlang-questions] BERT encoding and WebSocket
Thu Apr 12 06:57:21 CEST 2012
A truly stripped down binary-protocol can be faster and leaner than JSON,
for handling binary data and PHP's binary support is all but non-existent.
mochijson2 is a good library for converting between erlang terms and JSON.
JSON is more word-y and takes up more bandwidth, sure, but most people
aren't uber-optimizing for 56k modems these days (exception: mobile.)
makes up for the wire overhead. And it's easier to read tcpdump/pcaps,
use existing tools like curl and read native traces/dumps.
If you're just using backend server-server, BERT is easier and protobufs is
I use JSON on the front, BERT on the back with protobufs for talking to
Riak. I deprecated AMF and a custom binary protocol on the front due to
the above reasons.
On Wed, Apr 11, 2012 at 9:20 AM, Heinz N. Gies <> wrote:
> I was thinking about the same,
> after some testing I went to use JSON it was smaller then BERT+base64 for
> my cases without it I had problems with transmissions.
> Heinz N. Gies
> On Apr 10, 2012, at 04:26, ngocdaothanh wrote:
> > What is the best way to use BERT encoding (http://bert-rpc.org/) with
> > WebSocket?
> > BERT is binary but WebSocket does not support binary at this moment.
> > Should I use base64 to encode BERT binary to normal string? Base64 has
> > 33% overhead (http://en.wikipedia.org/wiki/Base64). How much space can
> > BERT save compared to JSON?
> > _______________________________________________
> > erlang-questions mailing list
> > http://erlang.org/mailman/listinfo/erlang-questions
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions