When we mention that we need to use the input framework to develop microservices behind the scenes, We have to make the REST services. 

 

Microservice: that exposes its business logic to other APIs or to external UI application with the help of Rest API. Using REST services, we can establish synchronous communication between multiple APIs or multiple services or multiple web applications.

 

Synchronous communication: means when a request comes from an external application to my microservice, the external application is going to wait for my response so that it can proceed to the next request.

 

ASynchronous communication: We can build asynchronous micro services by taking message queues and Kafka.

 

 

REST API: REST (Representational State Transfer) service works based upon Http protocol compared to soap based web services. 

  • REST services are very lightweight in nature because they can work with the help of lightweight data format, which is Json. That's why REST is the most commonly encountered approaches to establish communication between two web apps.
  • In REST APIs, our web application is going to expose certain endpoints which my client application can invoke by sending a request.
  • Different scenario where REST API can use
    • Mobile App Communication with Back end server
    • Communication Between 2 Backend Server
    • Communication between Front end applicaiton and Backend application
  • Operattions supported by REST  API
    • GET, POST, PATCH, PUT, DELETE
      • The difference between put and patch is if you are trying to update your entire record or major data inside your table record, then you should use put. Whereas if you're trying to update only a small set of information or a specific column, you should use Http patch method to support the update operation.

 

 

Document REST Services

  • Whenever you are building such large amount of APIs, it is a good idea or it is a good standard to document your REST services with the help of standards like Openapi specification, swagger

 

 


Related Question