Python in Plain English

New Python content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

REST: A Quick Guide to Building Scalable and Flexible Systems Using HTTP

The characteristics of a RESTful systems, HTTP methods used to interact with resources, and HTTP status codes.

Oleh Davymuka
Python in Plain English
7 min readMay 4, 2023

--

REST (Representational State Transfer) is an architectural style for building distributed hypermedia systems, such as the World Wide Web. It provides a set of principles for processing and transferring resource states over HTTP. A system that follows the REST principles is called a RESTful system. In this article, we will discuss the characteristics of a RESTful system, including client-server, stateless, cacheable, uniform interface, layered system, and code-on-demand. We will also cover the HTTP methods used to interact with resources, and HTTP status codes that indicate the status of a client's request. By following REST principles, you can create scalable and flexible systems that can be easily maintained and updated.

What is RESTful

For a distributed system to be considered built according to the REST (Restful) architecture, it must meet the following criteria:

  1. Client-Server. The system must be divided into clients and servers. Separation of interfaces means, for example, that clients are not tied to data storage, which remains within each server, so client code mobility is improved. Servers are not tied to the user interface or state, so servers can be simpler and more scalable. Servers and clients can be replaced and developed independently as long as the interface does not change.
  2. Stateless. The server should not store any information about clients. The request should contain all the necessary information for processing the request and, if necessary, identifying the client.
  3. Cache. Each response must be marked as cacheable or not to prevent clients from reusing outdated or incorrect data in response to subsequent requests.
  4. Uniform Interface. A single interface defines the interface between clients and servers, simplifying and separating the architecture and allowing each part to evolve independently.
    The four principles of a uniform interface:
    1. Identification of resources. In REST, a resource is anything that can be named, such as a user, an image, an…

--

--

Published in Python in Plain English

New Python content every day. Follow to join our 3.5M+ monthly readers.

No responses yet

Write a response