Skip navigation
Eight API styles on one frame, and every card draws the SAME picture: a client on the left, a server…
0:00

Eight API styles on one frame, and every card draws the SAME picture: a client on the left, a server…

#api #rest #graphql

Eight API styles on one frame, and every card draws the SAME picture: a client on the left, a server on the right, and the traffic between them. That is the whole point - an API style IS the shape of the traffic on that rail. 1 REST · 2 GraphQL · 3 gRPC · 4 SOAP · 5 WebSocket · 6 Webhooks · 7 SSE · 8 Long Polling The four people mix up are 5 to 8, because drawn carelessly all four are "a line with a dot moving along it". Three facts separate them, and no two agree on all three: WEBSOCKET - client opens it, data flows BOTH ways, connection persists. WEBHOOKS - the SERVER opens it. There is no client request first. If your client asked for it, that is polling, not a webhook. Your endpoint is the thing with a URL. SSE - client opens it once, then server-to-client only, forever. One request, a stream of events. LONG POLLING - client opens it, the request is HELD, and when the data arrives the connection CLOSES and the client has to ask again. The quiet gap is the mechanism. Two more worth stopping on: REST - the status follows the VERB. POST returns 201 because something was created. DELETE returns 204 - No Content - which means there is genuinely no body, not an empty one. And the path moves with the verb: POST hits the collection, PUT and DELETE address one item. SOAP - a fault comes back as HTTP 500, not a 200 carrying an error. The envelope itself failed validation, so the request never really happened. Save this one. Full interactive lab → #api #rest #graphql #systemdesign #backend Music: "Wholesome" by Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 4.0

Comments

Comments from the original post on Instagram

No comments yet