Spring / Spring gRPC Interview Questions
What are some best practices for evolving gRPC service contracts in a Spring microservices system over time?
The most important rule is protobuf-specific: never reuse or renumber an existing field tag. Add new fields with fresh tag numbers instead of repurposing old ones, and mark retired tags/names as reserved so nobody accidentally reintroduces the mistake later.
At the API level, prefer additive changes - new optional fields, new RPC methods - over breaking ones. When a genuinely breaking change is unavoidable, introduce it as a new method, service, or versioned package (e.g. orderv2) rather than mutating the existing contract out from under active consumers, and deprecate the old one on a clear timeline instead of deleting it immediately.
Operationally, keeping .proto files in a shared, versioned repository (or a schema registry) - rather than copy-pasted per service - keeps client and server teams working from the exact same contract and catches incompatible changes at build or review time rather than in production.
More Related questions...