Hello,
Creating a separate repository for your gRPC microservice is a good practice as it allows for better modularity, maintainability, and scalability. This way, the microservice can be developed, tested, and deployed independently from the primary codebase.
To enable communication between your primary server and the microservice, you can follow these steps: NCEdCloud Login
Define gRPC Protobufs: Create .proto files defining the gRPC service and messages.
Generate Code: Use protoc to generate Golang code from the .proto files.
Implement gRPC Service: Develop the microservice to handle image modification and S3 upload.
Configure gRPC Client: In the primary server, create a gRPC client to call the microservice.
Network Configuration: Ensure both services can communicate over the network, typically using service discovery or environment variables for endpoint configuration.
By doing this, your primary server can efficiently call the microservice, passing the necessary data and receiving responses.
It sounds like starting small might be the best call here. I’ve done separate repos before as well as putting a few tightly-coupled microservices in the same repo. I’ve also used workspaces pretty effectively. I would just start with one repo (because it sounds like they will be VERY tightly coupled in the early stages at least) and expand if/when you feel you need it.
Your project structure won’t dictate how your microservices communicate with each other. If you’re using gRPC, start here: