Why One .proto File Should Be the Single Source of Truth for Service Contracts

Software engineer Anton, working on migrating a PHP monolith to Go microservices, argues that every service-to-service interface should be declared solely in a single .proto schema file stored in a shared contract repository. The schema generates typed clients, servers, and HTTP specifications automatically, eliminating the need for separately maintained documents like OpenAPI files. Anton draws on experience with environment variables and metrics, where hand-written descriptions silently drifted from actual code until machine-derived artifacts replaced them. Drift is now enforced as a build failure rather than a review convention, with a generator running in check mode on every relevant file change. The core principle is that any description written by hand will eventually diverge, while one that is derived and automatically checked will not.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in