You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Hans Marggraff <hm...@qint.de> on 2010/05/12 11:33:44 UTC

Serializing Object Graphs with Avro

Hi,
The data, that I want to transmit is a tightly coupled object graph. 
(I.e. some objects appear once, but are referenced many times from other 
objects)
Unfortunately I can not declare this in Avro.
Do others have this requirement, and how did you solve it?

Regards
Hans Marggraff

Developer of www.reportsanywhere.com
The open-source reporting tool for relational, XML, Java and NoSql data.

Re: Serializing Object Graphs with Avro

Posted by Hans Marggraff <hm...@qint.de>.
Thank you Ben.
It is certainly a workable solution. The main issue I have is that it is 
not standardized. I can not simply tell Avro to serialize an object 
graph like I can tell Java serialisation.

Would it make sense to extend Avro with references? It is not hard.
Would such an extension make sense for others as well?

Regards
Hans

On 05/12/2010 04:32 PM, Ben Weaver wrote:
> Hi Hans,
>
> I've solved this problem by serializing the graph as a mapping of
> key/node pairs.  Whenever a node references another node in the graph,
> I serialize the reference as a key.
>
> Best wishes,
>
> -Ben

Re: Serializing Object Graphs with Avro

Posted by Ben Weaver <be...@orangesoda.net>.
Hi Hans,

I've solved this problem by serializing the graph as a mapping of
key/node pairs.  Whenever a node references another node in the graph,
I serialize the reference as a key.

Best wishes,

-Ben