[Scala] proposol a new capability mode for maintain core data strucutre in the server
Opened this issue · 0 comments
LoranceChen commented
[Background]
For safe maintain core persistence data compatible are the most consider things in server-side.
In many server-side project, only add new field in every new release version and carefully delete existing field is a good practice usually.
Our COMPATIBLE
mode are not check for delete field. There are difficult check safty when release new version.
[Advice]
Add a new CompatibleMode
only allow add new field and explicitly give a register process allow ignore field. Such as:
case class Foo(a: Int, b: String, c: Long)
val fury = Fury.builder()..withCompatibleMode(CompatibleMode.ALLOW_NEW_FIELD).build()
fury.registerDeletableField("Foo.c") // which means Foo.c bytes data can ignored when doing deserilaize process.
This can give a great help to check new release version are safe on data structure level.