Search code examples
typescriptnestjsmicroservicesgrpc

Organising Proto Schemas Microservices Architecture (gRPC communication protocol)


How to organize multiple Proto Schemas in a Microservice Architecture?

Current state: I have multiple APIs and one shared repo for storing all common files including Proto Schemas.

Question: Is it a good idea to individually store the Proto schemas in every Microservice? What are the pros and cons of every approach?

Info I'm using NestJs as framework.


Solution

  • I personally prefer to use a common repository to store IDLs(proto files). Since these IDLs are language agnostic it becomes easier for Microservice written in any language to import this IDL repository and getting started.

    In this way, we know Source of Truth for any SLA is this IDL repository.