Wk-notes-02-27-API-design-(g)RPC-REST-etc

API design: Servers communitaions

https://nordicapis.com/when-to-use-what-rest-graphql-webhooks-grpc/

GraphQL is an option to extend an API, and gRPC is a re-tooling to a classical approach,

REST

Stateless, Reliable, Scalable, HATEOAS, which means it's better/meant to be used with hypermedia(with hypertexts, namely links to other resources)

(g)RPC

gRPC is actually a new take on an old approach known as RPC, or Remote Procedure Call.

Custom contracted communications based on non-standard contract, defined by client-server relationship, but largely defined by the resources themselves(server). It gives much power(responsibility) to client.

Popular in IoT for low-power devices.

gRPC

Protobufs:

Protobufs are language and platform neutral systems used to serialize data, meaning that these communications can be efficiently serialized and communicated in an effective manner.

Auth:

Strong authentication system that utilizes SSL/TLS through Google’s token-based system.

GraphQL

A reversal of the traditional relationship, where client defines the data and format they retrieve.

An awesome way to decouple client and server.

Webhooks

No client pull, it is a server push (callback) model.

Last updated