thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilm Schumacher <wilm.schumac...@cawoom.com>
Subject Re: Data migration in Thrift / Possibilty to create message dynamically at runtime?
Date Tue, 03 Jun 2014 07:31:28 GMT
Hi,

you have always the last chance of serializing the data and deserialize
it like Nevo Hed proposed.

You could use e.g. JSON or XML. If your data is arbitrary but somehow
predictable, e.g. not nested, you could use something easier to parse,
like "a:data_a,b:data_b" etc.

But this only makes sense if you are somehow bound to thrift AND the
idea of dynamic data structures.

If the key point is the dynamic nature of your data and thrift is not
necessarily the method of choice there are easier ways of doing this.
Perhaps http is a good idea.

In my understanding the idea of thrift is to create new services which
rely on specific fields and structures like any other service (e.g.
http, which is kind of dynamic, but only in the sense outlined above).
So the serialize-deserialize idea is somehow a hack which kills the
advantages of this technologie (speed! by predefinition).

Hope this helps

Best wishes

Wilm

Am 24.05.2014 17:49, schrieb Klaus Kraft:
> Hi all,
> 
> so far I gained some experiences with Apache Avro and Google ProtoBuf. Now
> I wanted to play around with Thrift a bit.
> One of the thrings I'm mainly interested in is data migration. Lets say I
> have defined certain structs.
> I know that thrift can deal with additions, deletions and renamings.
> 
> But can I also deal with more complex migration scenarios, e.g., when I
> move a field of a struct
> into another struct? Or splitting a field of a struct into two fields (of
> the same struct)?
> The crucial point here is to be able to write migration classes or so which
> prevent me from
> loosing data.
> 
> In ProtoBuf, I could write a message dynamically. This allowed me to create
> a message with
> certain content at runtime. This was based on some reflection mechanisms.
> Is something like this
> also possible in Thrift? Can I write a message dynamically at runtime
> without using the
> classes generated out of the .thrift file?
> 
> Thanks in advance.
> 

Mime
View raw message