Suppose you run a ride-hailing app with five services: trip, dispatch, location, pricing, and payments.
The trip service owns each ride. Dispatch matches riders to nearby drivers. Location tracks driver positions.
Pricing quotes the fare. Payments charges the card.
When a rider taps Find a ride, the trip service calls dispatch to find a driver. The first version of that call is hand-written JSON. Build a URL, encode JSON, set a content type, parse the response, and repeat that code in every service that calls dispatch.
Then the dispatch service renames driver_id to driver_ref. The trip service still compiles. At runtime the field is missing, dispatch checks the field, rejects the request, and the ride fails.
gRPC starts from the contract instead of the HTTP call. You define the service and its messages in one file.…