API Decision Tree
Problem
I wanted to figure out when I should use certain API technologies, specifically:
- Representational State Transfer (REST/ReST/RESTful)
- Graph Query Language (GraphQL)
- gRPC Remote Procedure Calls (gRPC)
- Server Sent Events (SSE)
- Websocket
Solution
I searched the web and read a handful of “versus” articles & “getting started” tutorials and wanted to capture my naive and over-simplistic decision process/tree here, just in case I forget what I had learned in the future.
I have not tried all of these different technologies so I cannot say for certain, but the following would be my “80/20 rule”/”rule-of-thumb” guideline, should a project present a need to choose a API design/architecture.
TL;DR
Pull/Poll or Push
If API needs to support Pull/Poll, then prefer REST or GraphQL.
If API needs to support Push, then prefer gRPC, SSE, or websocket.
Starting Out/Simple or On Going/Complex
Given API needs to support Pulling/Polling data: