| My preferred approach for a microservice architecture: - Contract-first API development - All API contract definition files (OpenAPI/Swagger, .proto, .wsdl...) in a single repo, which has a CICD pipeline to bundle them into artifacts for various platforms (Maven, Nuget, NPM, gem...) - Consumers and producers import the "api-contracts" dependency; this is the only coupling between components - Consumers and producers both generate necessary code (server stubs, client libraries) at build time IMHO, if your service clients have dependencies on implementations of APIs rather than just the definitions, you're not realizing the key benefit of microservices (or SOA). |