Terminology Change Set Exchange
0.2.0 - CI Build International flag

Terminology Change Set Exchange, published by HL7 International - Termionology Infrastructure Work Group. This guide is not an authorized publication; it is the continuous build for version 0.2.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/tinkar-ig/ and changes regularly. See the Directory of published versions

Protobuf Native Representation

Page standards status: Informative

What is Protobuf?

Protocol Buffers (Protobuf) stands as a robust and efficient data serialization framework crafted by Google. Protocol Buffers Documentation ( https://protobuf.dev/). At its core, Protobuf aims to provide language-agnostic and platform-agnostic means of encoding structured data. This is achieved through the definition of data structures using a straightforward and human-readable schema language. The resulting serialization process produces compact binary data, facilitating seamless transmission between diverse systems and programming languages. One of Protobuf's key strengths lies in its extensibility, allowing developers to modify data structures over time while maintaining backward compatibility. The framework's efficiency, both in terms of space utilization and processing speed, coupled with its support for multiple programming languages, positions Protobuf as a compelling solution for applications where rapid and interoperable data exchange is a critical consideration. Further insights into Protobuf's features, applications, and advantages can be explored in the official documentation, accessible at ( https://protobuf.dev/overview/).

Why Protobuf?

Gaps in FHIR Representation for Tinkar Serialization Data: The need for an effective serialization mechanism for Tinkar data arose due to limitations in the FHIR representation. Recognizing these gaps, alternative solutions were explored to enhance serialization efficiency and overcome specific challenges.

Exploring Options: In response to the gaps identified in FHIR representation, a search for suitable solutions led to the evaluation of various options. The goal was to find a serialization method that could effectively address the shortcomings and seamlessly integrate with Tinkar serialization data.

Protobuf as a Data Transfer Object Code Generator: Protobuf emerged as a compelling choice, serving as a Data Transfer Object (DTO) code generator capable of creating classes for the serialization of data to/from disk, network, or other serial mediums. Its versatility and efficiency in handling structured data aligned well with the requirements of Tinkar serialization.

Key Advantages of Protobuf:

Wide Language Support: Protobuf is well-documented, supported by Google, and open source. It seamlessly integrates with Java and Visual Studio development environments, generating output classes in numerous languages.

Code Generation Efficiency: Protobuf rapidly generates code from a simple DTO description language, allowing developers to quickly implement serialization for Tinkar data.

Extensive Testing and Documentation: The framework has undergone thorough testing, resulting in a robust and well-documented solution with known issues addressed.

Performance: While not equivalent to handcrafted solutions, Protobuf offers reasonable speed and efficiency in data serialization processes.

Considerations and Limitations:

Memory Footprint and Allocations: Protobuf implemented classes may have a larger memory footprint (approximately 20% larger) and require more distinct memory allocations compared to handcrafted classes.

Hierarchical Relationships: Protobuf classes lack support for clean hierarchical parent-child class relationships, which may impact the representation of certain data structures.