Answers
- RPC stands for Remote Procedure Call. A client can call an exposed procedure on a remote server, which is just like calling a local procedure, but it gets executed on a remote server. An RPC is best suited for inter-service communication in connected systems.
- gRPC is based on the client-server architecture, whereas this is not true for REST. gRPC also supports full-duplex streaming communication in contrast to REST. gRPC performs better than REST as it uses static paths and a single source of the request payload.
A REST response error depends on HTTP status codes, whereas gRPC has formalized the set of errors to make it well aligned with APIs. gRPC has also been built to support and handle call cancellations, load balancing, and failovers. For more information, please refer to the REST versus gRPC subsection.
- You should use the server-streaming RPC method because you want to receive the latest messages from the server, such as tweets.