Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are binary protocols dead? [closed]

It seems like there used to be way more binary protocols because of the very slow internet speeds of the time (dialup). I've been seeing everything being replaced by HTTP and SOAP/REST/XML.

Why is this?

Are binary protocols really dead or are they just less popular? Why would they be dead or less popular?

like image 268
Earlz Avatar asked Mar 26 '10 17:03

Earlz


People also ask

What are binary protocols?

A binary protocol utilizes all values of a byte, as opposed to a text-based protocol which only uses values corresponding to human-readable characters in ASCII encoding. Binary protocols are intended to be read by a machine rather than a human being.

Is HTTP a binary based protocol?

Examples of binary protocols: RTP, TCP, IP. Examples of text protocols: SMTP, HTTP, SIP.


1 Answers

You Just Can't Beat the Binary

Binary protocols will always be more space efficient than text protocols. Even as internet speeds drastically increase, so does the amount and complexity of information we wish to convey.

The text protocols you reference are outstanding in terms of standardization, flexibility and ease of use. However, there will always be applications where the efficiency of binary transport will outweigh those factors.

A great deal of information is binary in nature and will probably never be replaced by a text protocol. Video streaming comes to mind as a clear example.

Even if you compress a text-based protocol (e.g. with GZip), a general purpose compression algorithm will never be as efficient as a binary protocol designed around the specific data stream.

But Sometimes You Don't Have To

The reason you are seeing more text-based protocols is because transmission speeds and data storage capacity have indeed grown fast compared to the data size for a wide range of applications. We humans find it much easier to work with text protocols, so we designed our ubiquitous XML protocol around a text representation. Certainly we could have created XML as a binary protocol, if we really had to save every byte, and built common tools to visualize and work with the data.

Then Again, Sometimes You Really Do

Many developers are used to thinking in terms of multi-GB, multi-core computers. Even your typical phone these days puts my first IBM PC-XT to shame. Still, there are platforms such as embedded devices, that have rather strict limitations on processing power and memory. When dealing with such devices, binary may be a necessity.

like image 98
Eric J. Avatar answered Sep 27 '22 17:09

Eric J.