DEV Community

Ateeb Hussain
Ateeb Hussain

Posted on

REST v/s other APIs

Most thinks it's all REST, it's not !!

While it's most REST, it's still not one-size fits all thingy.

REST API is the most basic and useful method that still powers 90% of the applications around the world. But, it is not that useful in some cases.

There are several API methods around, namely

  • REST
  • SOAP
  • GraphQL
  • gRPC
  • Webhooks
  • Web Sockets
  • WebRTC

REST API, the most basic and useful of all, uses http/1.1 method for communication. It works like this:

You make a call ---> Server accepts ---> Server do the stuff and sends a response ---> You get the response

Another task? Make the call and Repeat.
While REST provides separate methods like GET, PUT, POST, DELETE and PATCH, it can be insecure and inefficient in some scenarios.

That's where SOAP steps in, SOAP or Simple Object Access Protocol.
SOAP wraps the entire request inside an envelope containing header and payload/body information.

SOAP is relatively more secure than REST. Often used by banking systems and government transactions. (You know, the top-secret stuff?)

REST can be overwhelming if you need too many routes for data, that is where GraphQL steps in. You define the data you need, all done in a single route. Facebook/Meta uses GraphQL.

gRPC developed by google is a game-changer, especially when you want speed. gRPC communicates data simultaneously as Protocol Buffers (Protobuf) reducing size of data and required time.

gRPC is mainly used for micro-services and real-time data.

Since REST solves 90% of the problems, it is still the first approach and the kind of API method most developers expect in your messy codebase.

So, DON'T LET AI RUIN YOUR CODEBASES JUST BECAUSE REST IS BASIC.

Did I wrote something wrong? Point it out or just slam some words of appreciation (or even hate) in the comments.

(it increases visibility you see.)

Top comments (0)