HACKER Q&A
📣 billconan

Field Guide for Backward Compatible Protocol Design


Imagine a client-server system where the server is managed by the developer, but the clients are in the hands of customers who may or may not choose to upgrade.

How can you handle protocol changes in a backward-compatible way?

While solutions like Protobuf can mitigate this issue to some extent, they don't solve the problem completely. For instance, the type of a field might remain the same, but the way it is interpreted could change. An integer's valid range might shift, or its unit might change from centimeters to inches, etc.

This introduces a significant amount of logic to support data conversion. As the system ages, this becomes a substantial burden.

Is there a good solution to this?