Backward and forward compatibility
Backward compatibility is a design that is compatible with older versions of itself. Similarly, forward compatibility is a design that is compatible with newer versions of itself. While this is simple, let’s see an example to reinforce the idea.
Backward compatibility
Let’s suppose that we have the following schema (proto/v1/id.proto
):
syntax = "proto3"; message Id { Â Â uint32 value = 1; }
Previously, this message was doing its job. But after monitoring our use of its values, we noticed that we are getting close to the limit of a uint32 (4,294,967,295). We now need to update the type of value
so that it includes more values. But we also need to make sure that previous messages with a uint32 ID are still handled properly.
Let’s see what this means by creating a new version of our schema (proto/v2/id.proto
):
syntax = "proto3"; message Id { Â Â uint64 value = 1; }
Now, we can...