What does “Representational State Transfer” mean in REST API

 What does “Representational State Transfer” mean in REST API

Representational State Transfer. what does that mean?

Photo by Zh haris on Unsplash

Your back-end service has 10 containers running on the ECS (Elastic Container Service). You open an UI of the shopping website, you apply a discount coupon, session on one of the container is created where it maintains the information on that back-end service container. While making payment, you client UI may hit api on another container, in that case state that the user applied discount coupon resides on previous container, right final amount of that product wont be considered. State that the user applied coupon code is not lost.

Do not store the state on the of the user of applying coupon code on in the context of backed service, but store it on the database. So that whatever container UI hits at the time of making payment, the state can be retrieved from DB and then right payment amount can be considered.

In other words, state of the user to be stored on DB and not in the context of backed service or REST API. That is the reason, the REST API is said to be stateless which does not store the state of the user.

Instead, it transfers the state from the DB and considers for processing. Meaning the Representational State Transfer, the REST.

I hope you now exactly know what Representational State Transfer mean.

Feel free to reach out on LinkedIn for networking.

Previous Post Next Post