fury icon indicating copy to clipboard operation
fury copied to clipboard

[OSPP][Go] Implement type forward/backward compatibility for Fury Go

Open chaokunyang opened this issue 7 months ago • 2 comments

Feature Request

  1. Background: Fury is a high-performance serialization library that supports cross-language binary protocols. Currently, Go-based applications are gradually increasing. Go language is widely used for its performance, while also facing serialization challenges that need to be compatible with different versions and type structures. For Go language serialization, ensuring forward and backward compatibility of types is crucial for long-term project evolution and multi-version support. (2) Existing Work: Currently, Fury has implemented efficient serialization and deserialization in languages such as Java/Python/NodeJS, but related work in Go is still in its early stages, only supporting serialization and deserialization when object type schemas are strictly consistent. As projects expand and complexity grows, the serialization scheme needs to be more complete and efficient to support version evolution. (3) Existing Shortcomings: The current Fury Go serialization mechanism does not fully support forward and backward compatibility of structural types. When types are updated, there is a lack of adaptation mechanisms to handle added or removed fields to ensure the stability and consistency of serialized data. At the same time, the efficient sharing mechanism of metadata has not yet formed best practices. (4) Desired Improvements: We hope to implement a type-compatible mechanism based on metadata sharing, enabling Fury Go serialization to support dynamic type updates while ensuring compatibility between different versions. Through efficient metadata sharing methods, implement intelligent serialization handling for added, modified, and removed fields to reduce the development burden and operational risks brought by version changes. (5) Final Project Implementation Goals: The ultimate goal is to implement a serialization framework for Fury Go that supports forward and backward compatibility of types. This framework will utilize the metadata sharing mechanism of the Fury binary serialization protocol. The implementation can reference Fury Java/NodeJS and other language implementations, ultimately automatically adapting to changes in type structures, ensuring that data between different versions can be correctly serialized and deserialized, and enhancing the breadth and depth of Fury's application in the Go ecosystem.

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

  1. Implement metadata encoding and parsing modules, obtain type metadata at compile-time, and encode it according to the Fury metadata protocol.
  2. Implement a metadata sharing module, where multiple objects of the same type only serialize type metadata once.
  3. Parse metadata at compile-time and generate deserializers for scenarios where types are inconsistent.

Describe alternatives you've considered

No response

Additional context

No response

chaokunyang avatar Apr 27 '25 03:04 chaokunyang

@chaokunyang, I noticed a small inconsistency in the description: the title and context say “Fury Go,” but several places in the body refer to “Fury Rust.” We may need to straighten this out.

LouisLou2 avatar Apr 27 '25 03:04 LouisLou2

@chaokunyang, I noticed a small inconsistency in the description: the title and context say “Fury Go,” but several places in the body refer to “Fury Rust.” We may need to straighten this out.

Updated

chaokunyang avatar May 11 '25 15:05 chaokunyang