Solved

SOAP versus googles protocol buffers

Posted on 2010-11-15
8
1,556 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
  • 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 250 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now