views:

58

answers:

2

Hey all.

I am looking for a fast and efficient protocol that can be used between different web services to send text-data (not binary data). Doesn't matter if the protocol is binary or text base.

Some conditions:

  • I has to be more "efficient" than normal XML which adds a lot of extra data and the tools to read/write is too heavy

  • It has to be "supported" by most major languages, meaning it cannot only be available for one specific language. At the moment, both Java and PHP have to be able to talk to each other using this protocol.

I have already looked at:

  • XML - which I am currently using.
  • Hessian 2 -which works perfectly in Java, but the PHP-support is out of date
  • JSON -the different between JSON and XML is only minor

Any suggestions are welcome!

Update 1: It should be possible to use this protocol over HTTP.

+2  A: 

I have two answers.

First of all, REST services are "supported" from any stack capable of making an HTTP request. If you really need better efficiency than SOAP, just doing it yourself with REST is probably your best bet.

Second, does it really need to be 'more "efficient" than normal XML'? Have you profiled it? Are you certain that data transfer between your service and the client is going to be your bottleneck? How big is your payload with/without the XML?

Iain Galloway
REST is more an approach for getting information from a site and not really a data-protocol.
corgrath
HTTP is certainly a protocol. You can put whatever you like in your payload.
Iain Galloway
You are correct. Since it will it's by different web services, it is already using HTTP. But HTTP only provides me how the data will be transferred over the Internet, but not how the data is formatted.What I am looking for are alternatives to XML that are faster and most major languages have no problem to use.
corgrath
+1  A: 

Protocol Buffers might be exactly what you want. It's a Google creation that, in their words, is "a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more."

Their official docs show implementations in Java, C++ and Python. However, the protocol is simple and has been implemented in a lot of languages (I use a C# implementation, for example.)

IMHO, there are other methodologies in this area, but nothing quite meets the sweet spot of proto-buffers in terms of simplicity and performance across a variety of languages.

jro