We are currently implementing a high throughput spring boot application using grpc-starter package https://github.com/yidongnan/grpc-spring-boot-starter, this is a client server based application. We are migrating our legacy REST end points CRUD operations to GRPC. For having best design for this service, we need help with following questions:
If a single immutable GRPC blocking stub client instance is accessed by multiple threads, will this be a blocking call i.e. only one RPC call is executed at any given time.
As per the google GRPC IO docs it is recommended not to use blocking stub to parallelize RPC call. Is this highlighting the case of multiple RPC call on same client object. https://grpc.io/docs/guides/performance/
Will the blocking stub use new TCP connection for every call or same TCP connection is reused.
Each blocking RPC consumes a thread
- Does this mean, if my concurrency is higher than number of threads, I should always use non-blocking stub? – Levantine