Yes, the main difference between the sync and async APIs is performance, both in terms of resources used (the sync API ties up threads while waiting for results, which can be avoided using the async API) and in terms of actual RPC performance (throughput, latency, etc). For some performance best-practices, see https://grpc.io/docs/guides/performance/.
The choice of sync vs. async API has no effect on the wire protocol. A client may choose the sync vs. async APIs, and a server may also choose the sync vs. async APIs, and no matter what either of them chooses, they will still be able to talk to each other. I hope this info is helpful! On Tue, Sep 20, 2022 at 3:43 PM Aggarwal Sre <[email protected]> wrote: > Hi, > > I am trying to correct my understanding of sync versus async handling of > the GRPC APIs particularly w.r.t C++ server. > > grpc/greeter_async_server.cc at v1.48.1 · grpc/grpc · GitHub > <https://github.com/grpc/grpc/blob/v1.48.1/examples/cpp/helloworld/greeter_async_server.cc> > grpc/greeter_server.cc at v1.48.1 · grpc/grpc · GitHub > <https://github.com/grpc/grpc/blob/v1.48.1/examples/cpp/helloworld/greeter_server.cc> > > I am assuming the benefit of using async server is performance. In > other words a server can serve more requests with less resource foot print. > > Secondly - it seems even if I use a* sync *server version, I can still > call the Async version of an API using *a c# grpc client*. Wondering, how > does this handling works? Does blocking of the call only happens on the > client side, based on which version of API is called. > > If Async is called for a server using Sync version, is it just the API > that might take longer to complete if the server is experiencing load? > > I would help, if someone could correct my understanding. > > Regards, > Vivek Aggarwal > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/CABsnPP%2BLGJiBDimHFiULU5RZPwDf26mO10Tc6iVZfwPYwv-U1g%40mail.gmail.com > <https://groups.google.com/d/msgid/grpc-io/CABsnPP%2BLGJiBDimHFiULU5RZPwDf26mO10Tc6iVZfwPYwv-U1g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- Mark D. Roth <[email protected]> Software Engineer Google, Inc. -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAJgPXp70_YJtJZC7NtFvZaBq8n%3DRDvzP1Bc9vD9stcewJt2%3DvQ%40mail.gmail.com.
