Skip to content

Proof of Concept: Replace wire-schema library with grpc-zero #6809

@EricWittmann

Description

@EricWittmann

Background

Apicurio Registry currently uses the com.squareup.wire:wire-schema library (version 5.3.3) for Protocol Buffers schema parsing and manipulation. This library is primarily used in:

  • utils/protobuf-schema-utilities module
  • schema-util/protobuf module
  • serdes/generic/serde-common-protobuf module
  • Various protobuf-related components for validation, canonicalization, compatibility checking, and reference handling

Proposal

Investigate replacing the wire-schema library with Quarkus gRPC Zero, a new experimental feature that provides a pure JVM-based approach to Protocol Buffers compilation.

About gRPC Zero

gRPC Zero is an innovative Quarkus extension that:

  • Runs protoc compilation entirely within the JVM using WebAssembly
  • Eliminates the need for platform-specific native protoc binaries
  • Uses Chicory to translate the protobuf engine to pure Java bytecode
  • Provides portable, consistent builds across different environments (laptops, CI, containers, edge devices)
  • Simplifies continuous integration and reduces maintenance overhead

More information: https://quarkus.io/blog/grpc-zero/

Goals

This proof of concept should explore:

  1. Feasibility: Can grpc-zero replace the functionality currently provided by wire-schema?
  2. API Compatibility: What changes would be required to adapt existing code?
  3. Performance: How does grpc-zero compare in terms of performance?
  4. Build Integration: How would grpc-zero integrate with our current Maven build process?
  5. Dependencies: What dependency changes would be required? Can we reduce the dependency footprint?

Scope

This is a proof of concept task. The goal is to:

  • Create a prototype implementation in a branch
  • Document findings about compatibility and migration effort
  • Identify any gaps or limitations
  • Provide recommendations on whether a full migration would be beneficial

Current wire-schema Usage

Key areas where wire-schema is currently used:

  • FileDescriptorUtils - Converting between wire-schema and protobuf descriptors
  • ProtobufSchemaLoader - Loading and parsing protobuf schemas
  • ProtobufFile - Representing protobuf schema files
  • ProtobufContentValidator - Validating protobuf content
  • ProtobufCompatibilityChecker - Checking protobuf schema compatibility
  • ProtobufReferenceFinder - Finding references in protobuf schemas
  • ProtobufDereferencer - Dereferencing protobuf schemas
  • ProtobufContentCanonicalizer - Canonicalizing protobuf content

Dependencies to Consider

Current protobuf-related dependencies:

  • com.squareup.wire:wire-schema:5.3.3
  • com.squareup.wire:wire-schema-jvm:5.3.3
  • com.squareup.okio:okio-jvm:3.10.2
  • com.squareup.okio:okio-fakefilesystem:3.10.2
  • com.ibm.icu:icu4j:76.1
  • com.google.protobuf:protobuf-java:4.33.0
  • org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1

Success Criteria

The POC will be considered successful if it demonstrates:

  1. Basic protobuf schema parsing and manipulation using grpc-zero
  2. A clear migration path for existing wire-schema usage
  3. Potential benefits in terms of build portability and simplification
  4. No significant performance regressions
  5. Reduction in platform-specific build dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions