Skip to content

Separation of Client and Server

We have stablished that our interest lies in software solutions that conform to the Client-Server architecture.

A common practice to separate the Client and Server is Representational State Transfer, or REST architecture style. In this style, the implementation of the client and the server are done independently without each knowing about the other. This means that the code on the client/server side can be changed at any time without affecting the other side.

RESTful

REST-compliant systems, often called RESTful systems.

REST is stateless!

It is said that RESTful systems are stateless. In the Client-Server architecture, stateless means the server does not need to know anything about what state the client is in and vice versa.

So then how does client and server collaborate (communicate)? They do so through sending "messages" to one another. Statelessness of REST means the server and the client must understand any message received, without seeing previous messages.

Communication between Client and Server

As long as each side knows what format of messages to send to the other, they can communicate with one another. The messages send in between are generally categorized into request and response messages. And, the most common protocol for communication is HTTP.

What is HTTP?

HTTP stands for Hypertext Transfer Protocol and is used to structure requests and responses over the internet.

There are 4 basic HTTP verbs (operation) we use in requests to interact with server:

  • GET — retrieve a specific resource (by id) or a collection of resources
  • POST — create a new resource
  • PUT — update a specific resource (by id)
  • DELETE — remove a specific resource by id

A HTTP request, in addition to an HTTP verb, typically consists of:

  • a header, which allows the client to pass along information about the request
  • a path to a resource
  • an optional message body containing data

What is RESTful API?

Application Program Interface (API) permits the interaction between two systems. A RESTful API is an API that conforms to REST style and establishes what functionalities the server provides to the client and how it provides them.

What is API Endpoint?

HTTP requires data to be transferred from one point to another over the network. An API endpoint is the point of entry in a communication channel when client and server interacting.

We will next develop a few API endpoints for CourseReVU app. But first, we need a framework to help with the implementation!