The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Google Open-Sources Data Serialization Tool

6 replies on 1 page. Most recent reply: Jul 18, 2008 8:55 AM by Rob Dickens

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 6 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Google Open-Sources Data Serialization Tool Posted: Jul 8, 2008 5:32 PM
Reply to this message Reply
Advertisement

Any application that relies on external data must rely on some kind of serialization mechanism to read and write that data. Many such serialization formats exist, the most popular one being XML. XML also has the benefits of being programming language-agnostic, and also being to some extent self-describing. However, transmitting and processing XML incurs a great deal of overhead.

Google has been using a serialization format called Protocol Buffers for that purpose instead. Today, the company released this tool under an open-source license. According to the project's documentation:

Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the "old" format.

Google's Kenton Varda provides additional details in a blog post:

Protocol Buffers allow you to define simple data structures in a special definition language, then compile them to produce classes to represent those structures in the language of your choice. These classes come complete with heavily-optimized code to parse and serialize your message in an extremely compact format. Best of all, the classes are easy to use: each field has simple "get" and "set" methods, and once you're ready, serializing the whole thing to – or parsing it from – a byte array or an I/O stream just takes a single method call...

One of Protocol Buffers' major design goals is simplicity. By sticking to a simple lists-and-records model that solves the majority of problems and resisting the desire to chase diminishing returns, we believe we have created something that is powerful without being bloated. And, yes, it is very fast – at least an order of magnitude faster than XML.

APIs for reading and writing Protocol Buffers are available for C++, Java, and Python.

What do you think of Protocol Buffers as a data serialization tool? What are your preferred ways to serialize data?


johny boyd

Posts: 28
Nickname: johnyboyd
Registered: Apr, 2007

Re: Google Open-Sources Data Serialization Tool Posted: Jul 9, 2008 8:57 AM
Reply to this message Reply
Yet another NIH syndrome.

Surprising that the code author states in the response that he's unaware of ASN.1. Even more surprising would be that no one at GOOG pointed this out to him earlier.

Granted ASN.1 is probably too complex for mere mortals ..

-jb

Jesse Williamson

Posts: 9
Nickname: chardan
Registered: Dec, 2005

Re: Google Open-Sources Data Serialization Tool Posted: Jul 9, 2008 9:56 AM
Reply to this message Reply
Looks pretty interesting-- but maybe not that suprising. The Google documentation itself invites comparisons to IDL.

Since this has a simpler job to do-- data transfer-- than a complete middleware solution, I can see value in it when you want to avoid some complexity. But, basically, the CORBA model is at heart a really good way to do this kind of thing, so I'm not surprised this looks similar in nature.

I've been using ZeroC's Ice middleware ("http://www.zeroc.com") for enterprise business computing, and it performs outstandingly well compared to any of the commonly-used (read: popular and hyped) technologies in that world.

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Google Open-Sources Data Serialization Tool Posted: Jul 9, 2008 2:01 PM
Reply to this message Reply
> What are <em>your</em> preferred ways to serialize data?</p>

XML and BER

http://en.wikipedia.org/wiki/Basic_encoding_rules

Vijay Kandy

Posts: 37
Nickname: vijaykandy
Registered: Jan, 2007

Re: Google Open-Sources Data Serialization Tool Posted: Jul 9, 2008 2:41 PM
Reply to this message Reply
> What are <em>your</em> preferred ways to serialize data?
YAML. Most LAMP frameworks use this format. http://en.wikipedia.org/wiki/YAML

When I develop in Java, XML.

Wolfgang Lipp

Posts: 17
Nickname: wolf2005
Registered: Sep, 2005

Re: Google Open-Sources Data Serialization Tool Posted: Jul 11, 2008 7:48 AM
Reply to this message Reply
apart from protocols, just looking at the notations, i can't see where this is an obvious advance over JSON. since JSON has hashes (dictionaries) and strings, there is nothing you can't serialize with it (since you can always incorporate type information into a hash structure, and use strings to transport arbitrary byte sequences). JSON has the definite advantage that as soon as it arrives over the wire and gets interpreted within a VM (JavaScript, Python, Perl, PHP, what have you) you have a guarantee it consists of generic nulls, trues, falses, numbers, strings, lists, and hashes---no more, no less. you can then proceed to reconstruct instances of custom classes based on type information optionally laid down in the hashes. the latter thing is the hard part, but its so much easier to do when you base yourself on JSON than on XML.

Rob Dickens

Posts: 15
Nickname: robcd
Registered: Feb, 2008

Re: Google Open-Sources Data Serialization Tool Posted: Jul 18, 2008 8:55 AM
Reply to this message Reply
So its significantly faster than using XML; was there any comparison with native Java serialisation?

Flat View: This topic has 6 replies on 1 page
Topic: Google Open-Sources Data Serialization Tool Previous Topic   Next Topic Topic: Adobe Posts Early Version of Flex 4 SDK

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use