The Backend Engineering Show with Hussein Nasser

Episode 104 - REST API - The Good, the Bad and the Ugly


Listen Later

 

REST stands for Representational state transfer its is an architecture that became very popular in build web APIs. It was the dissertation of Roy Fielding. In this video we discuss what makes an API RESTFUL, the REST APIs constrains, ill the show you an example of a RESTFUL api in github. 

Representation and State transfer 

Representational 

The resource is a representation or meta data, but the actual backend could be something else and stored differently. An 

Example, could be a user resource could be represented as a JSON object but it is stored on the backend as relation DBMS tables such as postgres. 

State transfer

The application server is stateless, and when we want communicate we transfer the current state of with each request. Thus the state transfer.  

Example, lets say you are uploading a 5MB file in 5 chunks each is 1 MB in size and assemble it on the backend. The REST api end point takes the content along with a upload sequence, then persist it on a storage backend such as S3. Each chunk request could hit a completely different stateless server and the transfer will work fine since we are transferring the state (upload sequence) with every request. The client maintains the state in this case. 

Rest constraints

Client/server architecture

Is there separation of concern? Can you upgrade your server without upgrading client? Can you upgrade the server without upgrading the client? 

Statelessness

Is your api stateless? Can you restart your backend server and clients of your api resume working normally without failing? Can you add a non sticky load balancer and transfer the load between the servers without the client breaking?

Cachablity 

Can resources that can be cached be cached with your api? And is there a way to identify stale resources? 

Layered systems

Can I insert gateways and proxies and firewalls silently without this architecture breaking? Load balancers 

Uniform interface

Resource identification (uri) 

Resource Representation (json) 

HATEOAS

Hypermedia as an engine to application state

Initial link can link to the rest ( github) 

Github 

Emojis 

...more
View all episodesView all episodes
Download on the App Store

The Backend Engineering Show with Hussein NasserBy Hussein Nasser

  • 4.9
  • 4.9
  • 4.9
  • 4.9
  • 4.9

4.9

40 ratings


More shows like The Backend Engineering Show with Hussein Nasser

View all
Freakonomics Radio by Freakonomics Radio + Stitcher

Freakonomics Radio

32,264 Listeners

Software Engineering Radio - the podcast for professional software developers by team@se-radio.net (SE-Radio Team)

Software Engineering Radio - the podcast for professional software developers

273 Listeners

Risky Business by Patrick Gray

Risky Business

373 Listeners

Science Vs by Spotify Studios

Science Vs

12,177 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

990 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,103 Listeners

Practical AI by Practical AI LLC

Practical AI

213 Listeners

Within Reason by Alex J O'Connor

Within Reason

1,659 Listeners

All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

All-In with Chamath, Jason, Sacks & Friedberg

10,225 Listeners

Dwarkesh Podcast by Dwarkesh Patel

Dwarkesh Podcast

551 Listeners

Big Technology Podcast by Alex Kantrowitz

Big Technology Podcast

514 Listeners

Hard Fork by The New York Times

Hard Fork

5,553 Listeners

The AI Daily Brief: Artificial Intelligence News and Analysis by Nathaniel Whittemore

The AI Daily Brief: Artificial Intelligence News and Analysis

661 Listeners

Prof G Markets by Vox Media Podcast Network

Prof G Markets

1,471 Listeners

The Pragmatic Engineer by Gergely Orosz

The Pragmatic Engineer

74 Listeners