Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost Serialization Library upgrade

How do I know that I can safely upgrade Boost Serialization Library on a production system without breaking compatibility with the existing data ? Is there any test that I should perform in order to be sure that all data stored in the binary format by previous version of the library will be successfully read by the new one ? Does Boost Serialization library itself guarantee some sort of compatibility between versions ?

like image 288
Konstantin Avatar asked Jun 09 '10 08:06

Konstantin


People also ask

What is Boost serialization?

The library Boost. Serialization makes it possible to convert objects in a C++ program to a sequence of bytes that can be saved and loaded to restore the objects. There are different data formats available to define the rules for generating sequences of bytes. All of the formats supported by Boost.

What is serialization C++?

Serialization is the process of writing or reading an object to or from a persistent storage medium such as a disk file. Serialization is ideal for situations where it is desired to maintain the state of structured data (such as C++ classes or structures) during or after execution of a program.


2 Answers

Boost.serialization is backward-compatible but is not guaranteed to be forwards compatible.

This means:

  • you can create an archive with an older version of boost.serialization that can be read with a newer version.
  • There is no guarantee that an archive created with a newer version of boost.serialization will be readable by a older one.

If you send messages between a client and a server in both directions, for instance, you may have to upgrade the version of boost on both in lockstep.

The 'wire format' does not change with every version of boost. So between 2 specific versions of boost, you may have no problem - I can't find specific documentation of which version of the archive format is used within which version of boost.

Note also that while backwards compatibility is 'guaranteed', that's just expressing an intent - although I guess you could get your money back ;-). Boost versions 1.42 and 1.43 had a bug that meant later versions cannot read them back - see the 1.45 release notes.

like image 184
bacar Avatar answered Oct 13 '22 19:10

bacar


The initial Release was in Boost 1.32. It appears you can view the release history since then here: http://www.boost.org/doc/libs/1_43_0/libs/serialization/doc/release.html

Other than that I'd suggest asking on the boost mailing list: http://www.boost.org/community/groups.html#users

like image 27
Martin Ba Avatar answered Oct 13 '22 19:10

Martin Ba