Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost serialization libray 1.32 & 1.39 compatibility issue ( from "To DO" list)
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-09-25 14:58:13


On 25/09/09 6:01 AM, sam p wrote:
> I am facing backward compatibility problem with boost serialization
> library 1.39.
>
> My setup is something like this,
>
> (1) I have one version of my program that is built using boost 1.32
> serialization library, lets call it 1_32.exe
>
> (2) I have another version of my program that is built using boost 1.39
> serialization library, lets call it 1_39.exe
>
> (3) These two versions of my program communicate with each other over
> network and they use boost text serialization to exchange data.
>
> (4) Program 1_39.exe is able to deserialize data sent by 1_32.exe but
> 1_32.exe is not able to deserialize data sent by 1_39.exe
>
> While debugging this problem I realized that program 1_39.exe is putting
> archive version as “5” and 1_32.exe is putting archive version as “3”.
> This results into 1_32.exe throwing “Unknown version” exception. While
> going through boost documentation I read about “Back Versioning”
> description provided at
> http://www.boost.org/doc/libs/1_39_0/libs/serialization/doc/todo.html#backversioning
>
> Looks like its not very difficult to address this issue if we modify
> some code in boost serialization library.

The problem you're describing is actually forward compatibility which is
the ability of a program to load data in a format intended for a later
version.

Boost Serialization doesn't support this and personally, I think
implementing "back versioning" as linked above would be a waste of time.
It would be far better to support forward compatibility.

I believe it is somewhat possible without modifying the current library,
but to be honest, I've never used the idea in production. Generally,
when implementing forward compatibility, you can do it using named
key/value pairs or by reading up to a certain point in a buffer. The
first you can do by modifying your own code, the second you can do by
creating a custom archive.

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net