Backward and Forward compatibility (API)

Showcase API (in protobuf)

message User {
  string name = 1;
  int32 id = 2;
}

Backward compatibility
If you ever build against an API, it will work for all future API versions as well.

Example

message User {
  string name = 1;
  int32 id = 2 [deprecated = true];
  uint32 id_v2 = 3;
}

Forward compatibility
If you ever build against an API, it will work for all past API versions as well.

Example

message User {
  string name = 1;
  int32 id = 2;
  string email = 3 [optional = true];
}