int32
and int64
are both communicated as "varint" (wire-type zero) - they are already wire compatible. So: as long as neither client nor server is currently sending 64-bit values, you can update each end independently - just change the .proto
to use int64
instead of int32
and re-generate the generated code, and get it deployed. The data is wire compatible and will not change the seriaization format.
Note: you should not actually use values in the 64-bit range until both ends have been updated.
If you were changing from fixed32
/sfixed32
to fixed64
/sfixed64
, then this would represent a much bigger change and would require careful thought, usually involving introducing a new field (with a new number) for the 64-bit value, and migrating to it - probably putting the 32-bit value into both fields until both ends are deployed, then removing the old field and using just the 64-bit field.