-
Notifications
You must be signed in to change notification settings - Fork 398
Description
Question
I decided to use Fury as the serialization mechanism for both data in motion and data at rest across the entire application, and I'm wondering what would be the safest approach to future proof the data and prevent deserialization issues. So far, my approach is to add a 56-bit header for every serialized payload, consisting of the following:
- byte: fury major version
- byte: fury minor version
- byte: fury patch version
followed by an int32 with feature bit flags that correspond to the builder params as follows:
- 0: lang = xlang
- 1: lang = java
- 2: lang = python
- 3: lang = cpp
- 4: lang = go
- 5: lang = javascript
- 6: lang = rust
- 7: is row format
- 8: timeRefIgnored
- 9: compressInt
- 10: compressLong
- 11: compressString
- 12: compatible mode = COMPATIBLE
- 13: compatible mode = CONSISTENT
- 14: checkClassVersion
- 15: checkJdkClassSerializable
- 16: registerGuavaTypes
- 17: requireClassRegistration
- 18: suppressClassRegistrationWarnings
- 19: metaShareEnabled
- 20: scopedMetaShareEnabled
- 21: deserializeNonexistentClass
- 22: codeGenEnabled
- 23: asyncCompilationEnabled
- 24: scalaOptimizationEnabled
- 25: copyRef
- 26: serializeEnumByName
- 27: api = serialize/deserialize
- 28: api = serializeJavaObject/deserializeJavaObject
- 29: api = serializeJavaObjectAndClass/deserializeJavaObjectAndClass
- 30: reserved
- 31: reserved
My rationale is that in cases of future errors due to fury api or application-level changes, the builder can be constructed exactly as it was during the time of original serialization. I'm expecting to end up with multiple languages and configurations (speed and size optimized) across multiple fury versions.
Questions:
- Is this overkill and unnecessary (some of this data is already baked into the fury serialization protocol)?
- Is there any other metadata that should be included or can be safely excluded?
- Do I need more reserved flags for future planned configuration options?
- Is there a more compact way to represent the essential metadata?
Thank you.