
I work as a Tech Arch Senior Manager at Accenture and am a mother to two wonderful kids who test my patience and inspire me to be curious. I love cooking, reading, and painting.
Search for a command to run...

I work as a Tech Arch Senior Manager at Accenture and am a mother to two wonderful kids who test my patience and inspire me to be curious. I love cooking, reading, and painting.
No comments yet. Be the first to comment.
A Tale of Protocol Quirks, JSON Wrestling, and the Joy of Finding the Bug

In 2018, OpenAI pledged its "primary fiduciary duty is to humanity." Seven years later, the company launches erotic AI companions while families testify in courtrooms about children who never came home. We're conducting the largest unregulated behavi...

Did you know that 68% of organizations now identify data silos as their top operational concern? A 7% increase from 2023, according to a 2024 DATAVERSITY® Trends in Data Management Survey. In today's hyper-personalized business landscape, enterprises...

The Changing Search Paradigm This week, OpenAI introduced shopping capabilities within ChatGPT's search feature, coinciding with Mastercard unveiling Agent Pay, a new payment approach that enables AI agents to securely complete purchases. These devel...

The Reality of AI Hallucinations: Recent Examples Last week, the AI coding assistant tool Cursor encountered a crisis when its front-line AI support bot named “Sam” confidently provided a user with a completely fabricated policy. The user raised a su...

REST is a very common term that you will hear in the programming world and so in your technical interviews. This blog post will focus on what REST is and what does it mean to have a RESTful API?
REST is an acronym for Representative State Transfer. It is an architectural pattern or you can say a development style that is used to build interactive applications. Ok, that means REST is not a technology or a language but more a style in which you should develop your applications. And, this can be done by following the REST principles and constraints.
Now before we deep dive into those parts of the REST architecture, it is important to understand why do we need this architecture pattern.
Before 2000, developers integrating with APIs(Application Programming Interface) used SOAP (Simple Object Access Protocol) for communicating between the sender and the receiver systems. This required too many lines of code in XML format and then adding the SOAP envelope to the end-point.
The most frustrating thing I find with the SOAP apart from the complex coding is the complexity in troubleshooting an issue. It involves too many calls to trace back the communication made between the systems.
Ok, so we had APIs which are interacting with SOAP which sounds more complex, unlike its name. Then came Roy Fielding in 2000 who along with his colleagues came up with a standard in a doctoral dissertation. This standard's main goal is to provide a set of constraints(rules) that will simplify the communication between one server and another. The best thing is the interaction uses the HTTP syntax. The birth of these constraints is referred to as REST and when you build an API that follows these constraints, it is known as building a true RESTful API.
Simplifying the solution into a client-server architecture. Separating the solution user interface from the data storage side of logic can assist in moving the user interface to different platforms and scaling the server components.
This is inspired by the HTTP context where the client makes a request to the server. The request will contain all the information required to process the request on the server-side. The server side will not store any information related to the HTTP request and each request will be treated as a new one. That is the state of the request is managed at the client-end only.
Caching is an important concept in today's user interactions. The ability to cache a resource when applicable will reduce the number of client-server interactions because the client can re-use the same response. Caching can be applied on either side of the client-server architecture and should mark the resource to be cacheable.
REST allows you to build applications that follow a layered architecture. In this architecture, the servers will only have knowledge of the intermediary servers there by the client interacting will never know which server has responded to their request. Let's take a simple web form that stores information on a database server. On top of the server, we can add a load balancer, a security layer that authorizes the requests made to the database server. The ability to build an application in this layered style will help in separating the business logic from the security logic and also makes scaling the servers an easy job.
It is important to apply a generality where the end-point provides the ability to interact with related or additional data using the same URI. This simplifies the interaction and improves the visibility of the resources. It is said if the user knows how to interact with one of your APIs, they should be able to follow the same approach for the remaining APIs. This is achieved through 4 architecture constraints:
This is an optional constraint that allows your API to send executable code to the client system on demand. For example, Java applets or javascript to run a widget.
The key take-aways are:
Now that you got the hang of the REST architecture, you should give it a go!
Enjoy my blog? For more such awesome blog articles - follow, subscribe and let's connect.