[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SOAP versus googles protocol buffers

Posted on 2010-11-15
8
Medium Priority
?
1,847 Views
Last Modified: 2012-05-10
I have read some comments on google's protocol buffers (GPB) and some comments say that it is better to use GPB then SOAP. Seeing as how I am not familiar with GPB I was looking for some comments as to pros and cons.
Does GPB translate across all OS, e.g. Win32, Andriod, BlackBerry, MAC OS, ...?
Does it save on XML setup and parshing?
Does it use or is it better than using Web Services?

Thanks
0
Comment
Question by:atomicgs12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34151945
I am only learning about Protocol Buffers, myself, so don't quote me, but I can give you what I know:

Simple, fast
Less confusion (ambiguity)
Cross-platform
Binary
Language neutral
Open source
Define message structure in .proto files
Google's Lingua franca (or working/bridging language)
Not as widely accepted as XML/SOAP
Binary formats need to be converted to readable, debuggable format
Positional binding -- attributes are not sent with the request
Rich API to define the data contract
0
 

Author Comment

by:atomicgs12
ID: 34152475
So far what do you think from a development stand point? Would PBs be just as easy to debug as SOAP? Faster or longer learning curve for development vs SOAP?
Thanks
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 34155748
Debugging is usually where they say that proto buffers have their limitation, because you need to convert them to a readable format.  I believe, though, that the APIs to convert the binary format to a human-readable form, makes that argument null and void.  I believe that the implementation for proto buffers is clean and simple, and much easier to learn vs. XML and SOAP.  The biggest thing for me is performance--smaller payload.  There are good resources for learning about proto buffers, and since I am a C# developer, I am happy to see some APIs coming out for C# developers.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:atomicgs12
ID: 34264051
Anybody else?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34264223
If you would like other opinions, there is a "Request Attention" option, that might get more attention to this question.
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 34422630
Got a "neglected question" alert on this one, and I'll try to help.

SOAP is complicated, difficult to debug and wastes endless hours of developers time.  I see literally hundreds of questions each year from people who are confounded by SOAP problems.  As I see it, this happens because SOAP requires the client to understand the server's "thought processes" but has no good way of exposing those thought processes.  So you're left with a lot of guesswork and no good debugging tools.  One of my colleagues, with no hint of sarcasm, said "SOAP is the devil."

Contrast the RESTful interface.  REST makes every request atomic and complete.  The best example of this is the WWW.  Go to a web site and you see the web site!  No questions or confusion or debugging needed.  All the important input is in the URL.  All the important output is in the browser data stream.  Common response formats are JSON, XML, CSV or in the case of the WWW, HTML.

The best technologies are invisible.  Turn on a light switch and the light comes on.  You do not need to know anything about power generation, voltage conversion, circuitry, impedance, heat dissipation, etc.  You just get the light, which is what you wanted.  REST is a light switch.

In online applications other than the WWW, a great illustration of REST can be found in Version 1 of the Yahoo Geocoder.  Ignore the fact that Yahoo says this is deprecated and just look at the elegance of the interface.
http://developer.yahoo.com/maps/rest/V1/geocode.html

RESTful apps can be secure.  Just put the app behind HTTPS.  RESTful apps can be version controlled and password protected with an API key.   An example of the architecture is in the code snippet.  Give it a first name and get back the last name -- easy!

So if your question is between GPB or SOAP, my response would be to set both of those aside, and see if there is anything preventing you from using REST.

Best regards, ~Ray
<?php // RAY_REST_get_last_name.php
error_reporting(E_ALL);



// DEMONSTRATE HOW A RESTFUL WEB SERVICE WORKS
// INPUT FIRST NAME, OUTPUT LAST NAME
// CALLING EXAMPLE:
// file_get_contents('http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray');



// OUR DATA MODEL CONTAINS ALL THE ANSWERS - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED
$dataModel
= array
( 'Brian'   => 'Portlock'
, 'Ray'     => 'Paseur'
, 'Richard' => 'Quadling'
, 'Dave'    => 'Baldwin'
)
;


// SHOULD RESPONSE BE PLAIN TEXT OR XML FORMAT
$alpha = '';
$omega = '';
if ( (isset($_GET["resp"])) && ($_GET["resp"] == 'XML') )
{
    $alpha = '<response>';
    $omega = '</response>';
}



// TEST THE API KEY
$key = FALSE;
if (isset($_GET["key"])) $key = $_GET["key"];
if ($key !== 'ABC') die($alpha . 'BOGUS API KEY' . $omega);



// LOOK UP THE LAST NAME
$name="?";
if (isset($_GET["name"])) $name = $_GET["name"];

// IF THE URL NAME IS FOUND IN THE DATA MODEL
if (array_key_exists($name, $dataModel))
{
    // RETURNS THE LAST NAME FROM THE DATA MODEL
    die($alpha . "$dataModel[$name]" . $omega);
}

// RETURNS THE UNKNOWN NAME INDICATOR
else die($alpha . 'UNKNOWN' . $omega);

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question