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 ?
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.
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
You can create test files using your current version of the software and store them. Then include loading of this files into your automatic tests.
Unfortunately, even if your code will pass this test, you can not be 100% sure at compatibility, because there still can be some sort of serialized content that can not be loaded. Well, it is still better than nothing.
This test will automatically cover only backward compatibility. Testing forward (upward) compatibility will be more complicated. One will need to create test data for every new release and try to load it by every old version...
Extended forward compatibility for boost::serialization is answered here
© 2022 - 2024 — McMap. All rights reserved.