std.serialization: pre-voting review / discussion

David Nadlinger code at klickverbot.at
Mon Aug 19 12:47:29 PDT 2013


On Monday, 19 August 2013 at 14:47:15 UTC, bsd wrote:
> I think this versioning idea is more important for protocol 
> buffers, msgpck, thrift like libraries that use a separate IDL 
> schema and IDL-compiled code. std.serialization uses the D code 
> itself to serialize so the version is practically dictated by 
> the user. It may as well be manually handled....as long as it 
> throws/returns error and doesn't crash if one tries to 
> deserialize an archive type into a different/modified D type.
>
> From memory the Protocol Buffers versioning is to ensure schema 
> generated code and library are compatible. You get compile 
> errors if you try to compile IDL generated code with a newer 
> version of the library. Similarly you get runtime errors if you 
> deserialize data that was serialized with an older version of 
> the library. This is all from memory so I could be wrong...

Seems like your memory has indeed faded a bit. ;)

Versioning is an integral idea of formats like Protobuf and 
Thrift. For example, see the "A bit of history" section right on 
the doc overview page. [1] You might also want to read through 
the (rather dated) Thrift whitepaper to get an idea about what 
the design constraints for it were. [2]

The main point is that when you have deployed services at the 
scale Google or Facebook work with, you can't just upgrade all 
involved parties simultaneously on a schema change. So, having to 
support multiple versions running along each other is pretty much 
a given, and the best way to deal with that is to build it right 
into your protocols.

David


[1] https://developers.google.com/protocol-buffers/docs/overview
[2] http://thrift.apache.org/static/files/thrift-20070401.pdf


More information about the Digitalmars-d mailing list