#note #networking
quick take:
- grpc over http, rest over http, and graphql over http are protocols for data retreival from servers. Websockets are a low-level protocol from 2011 that can be supported more natively than, eg. gRPC, in the browser, for bidirectional streaming.
- Use grpc for featureful bidirectional streaming, when the client doesn't need to be http1.1 compatible (eg. in browsers)
- Use websockets for low-level bidirectional streaming from the browser, or else set up a grpc-web proxy server.
- Use graphql for complex, flexible database queries, especially useful in front-ends.
- Use REST for simplicity, and because libraries make it easy.
- skip to the end for some notes on the upcoming HTTP3, which communicates over UDP instead of TCP, and claims to reduce communication complexity.