gRPC or REST

 





I have designed and implemented many REST API's over years. If I have to do them now I would have chosen gRPC for more than half of those scenario's. REST (REpresentational state transfer) was developed early 2000's. It took off and replaced SOAP API's quickly. While gRPC is developed pretty recently in 2015.

A quick comparison

gRPC

REST

Uses HTTP/2

Uses HTTP/1.1

Protocol Buffer

JSON or XML

Limited browser support through proxy layer

Universal browser support

Client - response model. 

Bidirectional support.

Request - response model

7x faster



If you do not consume the API's directly in your browser you should go gRPC. If your use case needs your browser to make API calls then REST is the option for you. I do not have the performance numbers of gRPC with a proxy like Envoy. I will update the article soon with that.

All other aspects are comparable and give advantage to gRPC. If you want more details these are my references:


Comments

Popular posts from this blog

Greedy computing with API

ChatGPT for cavemen

Event driven architecture for micro services