Skip to content

[NET_HANDLER] Considering replacing Protobuf with JSON #270

@benliao1

Description

@benliao1

Currently, Runtime communicates with Dawn and Shepherd over the network using the Google Protobuf protocol. It is a highly optimized protocol to deliver a given amount of information over the network in as few bytes as possible. This is useful for large data centers (as Google has) where network loading is a real issue. However, the amount of data sent between Dawn, Runtime, and Shepherd is not that large, in the grand scheme of things.

PiE started using Google Protobuf at least since 2017 in order to try to lighten the load on the network during competition. We now know that the real issue with our networking was that the software projects (especially Shepherd and Runtime) were simply too unstable at the time.

One of Runtime's last big 3rd-party dependencies is Google Protobuf. The process for using Google Protobuf in C and compiling the C header files from source is quite cumbersome. Learning how to write protobuf code, on top of learning all of Runtime, is quite difficult, especially since there isn't much documentation of the protobuf-c library.

This issue is to consider changing the way that Runtime, Dawn, and Shepherd communicate with each other. Instead of using Google Protobuf, we simply use JSON, which has native support in Python and Javascript. C does not support it natively but the tools used to marshal / unmarshal JSON messages in C are tiny in comparison to those needed to work with Protobuf.

This would remove the last huge third-party dependency from Runtime and make it nearly completely self-contained. However, it would require a lot of coordination between all 3 of PiE's software projects to pull off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions