SlideShare a Scribd company logo
REST(Representational State Transfer)
- SHAILESH SINGH
1. Why so REST FUL?
 Life before REST
 Challenges of HTTP ?
 RMI , SOAP , RPC and HTTP different famous technique to develop web services
2. What is REST? Defined in 2000
 Architects are Made, Not Born
 What REST father Roy Fielding says
 An architecture style is a coordinated set of architectural constraints that restricts the
roles and features of architectural elements . E.g. : UI layer and data layer segregation ,
statelessness , cacheability
 Uniform Interface : Overall system architecture is simplified and the visibility of
interactions is improved
Tradeoff : Degrades efficiency since Information is transferred in a standardised form
rather than one which is specific to application's needs
a. Uniform Interface
 Four interface constraints
● Identification of resources
● Manipulation of resources through representations
● Self descriptive messages
● Hypermedia as the engine of application state (HATEOAS)
b. What is resources
Another way to describe REST is ROA : Resource Oriented Architecture
 Any information that can be named is a resource
 A resource is a conceptual mapping to a set of entities not the entity itself. Such a
mapping can change over time.
 A resource can be a collection of entities too.
 Every resource has a name that uniquely identifies it – the URI
 Think of it like a primary key for each row in a database
 REST doesn't dictate URI choice. Leaves it to the application author.
c.What If?
/getAccount
/getAllAccounts
/searchAccounts
/createDirectory
/updateGroup
/updateGroupName
/findGroupsByDirectory
/verifyAccountEmailAddress
As you move from an action oriented design towards resource oriented design,
thinking of everything as nouns is one of the early challenges to overcome
Identification of Resources
Identification of Resources
d.The Answer
Fundamentally two types of resources:
Collection Resource
/applications
/books
/orders
Instance Resource
/applications/a1b2c3
/books/1235
/orders/abcdef
Question :
Guess REST equivalent for : Transaction.approve and Account.pay
TransactionApproval and AccountPayment
e.Behavior
POST, GET, PUT, DELETE
≠ 1:1
Create, Read, Update, Delete
f. PUT for Create
Identifier is known by the client:
PUT:
Used to create a resource, or overwrite it. While you specify the resources new URL.
For a new resource:
PUT /questions/<new_question> HTTP/1.1
Host: www.example.com/
To overwrite an existing resource:
PUT /questions/<existing_question> HTTP/1.1
Host: www.example.com/
PUT is Idempotent
g.POST as Create
 POST:
Used to modify and update a resource
POST /questions/<existing_question> HTTP/1.1
Host: www.example.com/
Note that the following is an error:
POST /questions/<new_question> HTTP/1.1
Host: www.example.com/
If the URL is not yet created, you should not be using POST to create it while specifying the name. This should result in a 'resource not found'
error because <new question> does not exist yet. You should PUT the <new question> resource on the server first.
You could though do something like this to create a resources using POST:
POST /applications
{
“name”: “Best App Ever”
}
Response:
201 Created
Location: https://api.singh.com/applications/a1b2c3
POST NOT Idempotent -> x++ vs. x=4
4.a. Example/case Studies
 Fine grained CRUD resources Vs Coarse Grained resources:
Like Operation on blog post (“/posts/{post_id}/likes”)
Comment Operation on blog post (“/posts/{post_id}/comments”)
vs
The single coarse grained resource “Post”(/posts/{post_id}” for “liking” or
“commenting”
4.b. Example/case Studies
 Change the Address:
We can update “Customer” address via “Customers/001/Address/KA001/” or
“Address/KA001/”
VS
Design the API around the resources that are based on the business processes and domain events . To
update an existing bank customer’s address, a POST request can be made to “ChangeOfAddress” resource.
Very important to distinguish between resources in REST API and domain entities in a
domain driven design.
4.c HATEOAS
 HATEOAS=Hypermedia As The Engine Of Application State
Path is the hierarchical and the query is the non-hierarchical part of the URIs.
! Magic awesome sauce to improve REST!
According to the HATEOAS constraint your client has to follow hyperlinks sent by
the service. Those hyperlinks must be annotated with metadata regarding the
semantics of them
HATEOAS constrain
 A REST client enters a REST application through a simple fixed URL. All future actions the client may take are discovered within resource representations
returned from the server.
 E.g:
Request
GET /account/12345
HTTP/1.1 Host: somebank.org
Accept: application/xml
Response:
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: ...
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<balance currency="usd">100.00</balance>
<link rel="deposit" href="https://somebank.org/account/12345/deposit" />
<link rel="withdraw" href="https://somebank.org/account/12345/withdraw" />
<link rel="transfer" href="https://somebank.org/account/12345/transfer" />
<link rel="close" href="https://somebank.org/account/12345/close" />
</account>
Later Response:
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: ...
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<balance currency="usd">-25.00</balance>
<link rel="deposit" href="https://somebank.org/account/12345/deposit" />
</account>
Book Flight Ticket
Get Flight Search Result
Confirm a Flight
Payment still Pending
Payment
Fetch E-Ticket
Worked examples
How to GET a Cup of Coffee by Jim Webber, Savas
Parastatidis & Ian Robinson Oct 02, 2008
http://www.infoq.com/articles/webber-rest-workflow
Questions
http://petstore.swagger.io/
http://start.spring.io/

More Related Content

What's hot (20)

REST API
REST APIREST API
REST API
Tofazzal Ahmed
 
Hypermedia APIs
Hypermedia APIsHypermedia APIs
Hypermedia APIs
Paulo Gandra de Sousa
 
Spring HATEOAS
Spring HATEOASSpring HATEOAS
Spring HATEOAS
Yoann Buch
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
Abhay Ananda Shukla
 
CSS Architecture: Writing Maintainable CSS
CSS Architecture: Writing Maintainable CSSCSS Architecture: Writing Maintainable CSS
CSS Architecture: Writing Maintainable CSS
Alexei Skachykhin
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
Chetan Gadodia
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
rporwal
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable links
Stephen Richard
 
Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
Amila Sampath
 
Benefits of Hypermedia API
Benefits of Hypermedia APIBenefits of Hypermedia API
Benefits of Hypermedia API
Paulo Gandra de Sousa
 
Introduction to Hydra
Introduction to HydraIntroduction to Hydra
Introduction to Hydra
Alejandro Inestal
 
Building Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRSBuilding Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRS
Derek Comartin
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
Patrick Savalle
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
rainynovember12
 
Rest http basics
Rest http basicsRest http basics
Rest http basics
Suresh Madhra
 
Standards of rest api
Standards of rest apiStandards of rest api
Standards of rest api
Maýur Chourasiya
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
Suresh Madhra
 
Rest Webservice
Rest WebserviceRest Webservice
Rest Webservice
Viyaan Jhiingade
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
Codemotion
 
Spring HATEOAS
Spring HATEOASSpring HATEOAS
Spring HATEOAS
Yoann Buch
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
Abhay Ananda Shukla
 
CSS Architecture: Writing Maintainable CSS
CSS Architecture: Writing Maintainable CSSCSS Architecture: Writing Maintainable CSS
CSS Architecture: Writing Maintainable CSS
Alexei Skachykhin
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
Chetan Gadodia
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
rporwal
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable links
Stephen Richard
 
Building Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRSBuilding Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRS
Derek Comartin
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
Patrick Savalle
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
Suresh Madhra
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
Codemotion
 

Viewers also liked (16)

Mamiferos
MamiferosMamiferos
Mamiferos
Star Butterfly
 
CV Zubair Aslam
CV Zubair AslamCV Zubair Aslam
CV Zubair Aslam
zubair aslam
 
SLICP Newsletter Supplement February 2017
SLICP Newsletter Supplement February 2017SLICP Newsletter Supplement February 2017
SLICP Newsletter Supplement February 2017
David Hains
 
Portfolio
PortfolioPortfolio
Portfolio
mink sarinya
 
Expansion en Bucaramanga
Expansion en BucaramangaExpansion en Bucaramanga
Expansion en Bucaramanga
jaideramador
 
Reto 2 - Propuesta narración digital
Reto 2 - Propuesta narración digital Reto 2 - Propuesta narración digital
Reto 2 - Propuesta narración digital
Mari Rodriguez
 
The Morthwest Ordinance
The Morthwest OrdinanceThe Morthwest Ordinance
The Morthwest Ordinance
reach
 
How to Successfully Work With a Recruiter
How to Successfully Work With a RecruiterHow to Successfully Work With a Recruiter
How to Successfully Work With a Recruiter
Elyse Turner
 
Gestión de-proyectos-informáticos
Gestión de-proyectos-informáticosGestión de-proyectos-informáticos
Gestión de-proyectos-informáticos
Víctor Gerardo
 
CV
CVCV
CV
RADHIKA TANDON
 
Microalgae cultivation in different pH, Temperature and Media
Microalgae cultivation in different pH, Temperature and MediaMicroalgae cultivation in different pH, Temperature and Media
Microalgae cultivation in different pH, Temperature and Media
Bir Bahadur Thapa
 
0004. blago crvene planine
0004. blago crvene planine0004. blago crvene planine
0004. blago crvene planine
zoran radovic
 
CompTIA Perks
CompTIA PerksCompTIA Perks
CompTIA Perks
CompTIA
 
Nombres de dominio de internet
Nombres de dominio de internetNombres de dominio de internet
Nombres de dominio de internet
Joha Paguay
 
Office365 education transformation collaboration using office 365
Office365 education transformation collaboration using office 365Office365 education transformation collaboration using office 365
Office365 education transformation collaboration using office 365
Sachin. Jung
 
SLICP Newsletter Supplement February 2017
SLICP Newsletter Supplement February 2017SLICP Newsletter Supplement February 2017
SLICP Newsletter Supplement February 2017
David Hains
 
Expansion en Bucaramanga
Expansion en BucaramangaExpansion en Bucaramanga
Expansion en Bucaramanga
jaideramador
 
Reto 2 - Propuesta narración digital
Reto 2 - Propuesta narración digital Reto 2 - Propuesta narración digital
Reto 2 - Propuesta narración digital
Mari Rodriguez
 
The Morthwest Ordinance
The Morthwest OrdinanceThe Morthwest Ordinance
The Morthwest Ordinance
reach
 
How to Successfully Work With a Recruiter
How to Successfully Work With a RecruiterHow to Successfully Work With a Recruiter
How to Successfully Work With a Recruiter
Elyse Turner
 
Gestión de-proyectos-informáticos
Gestión de-proyectos-informáticosGestión de-proyectos-informáticos
Gestión de-proyectos-informáticos
Víctor Gerardo
 
Microalgae cultivation in different pH, Temperature and Media
Microalgae cultivation in different pH, Temperature and MediaMicroalgae cultivation in different pH, Temperature and Media
Microalgae cultivation in different pH, Temperature and Media
Bir Bahadur Thapa
 
0004. blago crvene planine
0004. blago crvene planine0004. blago crvene planine
0004. blago crvene planine
zoran radovic
 
CompTIA Perks
CompTIA PerksCompTIA Perks
CompTIA Perks
CompTIA
 
Nombres de dominio de internet
Nombres de dominio de internetNombres de dominio de internet
Nombres de dominio de internet
Joha Paguay
 
Office365 education transformation collaboration using office 365
Office365 education transformation collaboration using office 365Office365 education transformation collaboration using office 365
Office365 education transformation collaboration using office 365
Sachin. Jung
 

Similar to REST Architecture with use case and example (20)

Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
Katy Slemon
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
TO THE NEW Pvt. Ltd.
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
Jean Michel
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
Sudheer Satyanarayana
 
Rest API Interview Questions PDF By ScholarHat
Rest API Interview Questions PDF By ScholarHatRest API Interview Questions PDF By ScholarHat
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
API Management and software services.pdf
API Management and software services.pdfAPI Management and software services.pdf
API Management and software services.pdf
Prowess Software Services Inc
 
Whitepaper-API-Design-Best-Practices. Prowess software services
Whitepaper-API-Design-Best-Practices. Prowess software servicesWhitepaper-API-Design-Best-Practices. Prowess software services
Whitepaper-API-Design-Best-Practices. Prowess software services
Prowess Software Services Inc
 
Whitepaper - A Guide to API Design Best Practices
Whitepaper - A Guide to API Design Best PracticesWhitepaper - A Guide to API Design Best Practices
Whitepaper - A Guide to API Design Best Practices
Prowess Software Services Inc
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
Bohdan Dovhań
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
Suresh Madhra
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
NamanVerma88
 
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
building-rest-api-with-spring-boot-in28minutes-presentation.pdfbuilding-rest-api-with-spring-boot-in28minutes-presentation.pdf
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
HarshitRaj774201
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
Rule_Financial
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Martin Necasky
 
O reilly sacon2018nyc - restful api design - master - v1.0
O reilly sacon2018nyc - restful api design - master - v1.0O reilly sacon2018nyc - restful api design - master - v1.0
O reilly sacon2018nyc - restful api design - master - v1.0
Tom Hofte
 
Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
Alexandros Marinos
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Gaurav Bhardwaj
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
Christian Guenther
 
Code-Camp-Rest-Principles
Code-Camp-Rest-PrinciplesCode-Camp-Rest-Principles
Code-Camp-Rest-Principles
Knoldus Inc.
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
Katy Slemon
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
TO THE NEW Pvt. Ltd.
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
Sudheer Satyanarayana
 
Rest API Interview Questions PDF By ScholarHat
Rest API Interview Questions PDF By ScholarHatRest API Interview Questions PDF By ScholarHat
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
Whitepaper-API-Design-Best-Practices. Prowess software services
Whitepaper-API-Design-Best-Practices. Prowess software servicesWhitepaper-API-Design-Best-Practices. Prowess software services
Whitepaper-API-Design-Best-Practices. Prowess software services
Prowess Software Services Inc
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
Suresh Madhra
 
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
building-rest-api-with-spring-boot-in28minutes-presentation.pdfbuilding-rest-api-with-spring-boot-in28minutes-presentation.pdf
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
HarshitRaj774201
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
Rule_Financial
 
O reilly sacon2018nyc - restful api design - master - v1.0
O reilly sacon2018nyc - restful api design - master - v1.0O reilly sacon2018nyc - restful api design - master - v1.0
O reilly sacon2018nyc - restful api design - master - v1.0
Tom Hofte
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Gaurav Bhardwaj
 
Code-Camp-Rest-Principles
Code-Camp-Rest-PrinciplesCode-Camp-Rest-Principles
Code-Camp-Rest-Principles
Knoldus Inc.
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 

Recently uploaded (20)

Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Build 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHSBuild 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHS
TECH EHS Solution
 
Social Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTechSocial Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTech
Steve Jonas
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Build 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHSBuild 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHS
TECH EHS Solution
 
Social Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTechSocial Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTech
Steve Jonas
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 

REST Architecture with use case and example

  • 2. 1. Why so REST FUL?  Life before REST  Challenges of HTTP ?  RMI , SOAP , RPC and HTTP different famous technique to develop web services
  • 3. 2. What is REST? Defined in 2000  Architects are Made, Not Born  What REST father Roy Fielding says  An architecture style is a coordinated set of architectural constraints that restricts the roles and features of architectural elements . E.g. : UI layer and data layer segregation , statelessness , cacheability  Uniform Interface : Overall system architecture is simplified and the visibility of interactions is improved Tradeoff : Degrades efficiency since Information is transferred in a standardised form rather than one which is specific to application's needs
  • 4. a. Uniform Interface  Four interface constraints ● Identification of resources ● Manipulation of resources through representations ● Self descriptive messages ● Hypermedia as the engine of application state (HATEOAS)
  • 5. b. What is resources Another way to describe REST is ROA : Resource Oriented Architecture  Any information that can be named is a resource  A resource is a conceptual mapping to a set of entities not the entity itself. Such a mapping can change over time.  A resource can be a collection of entities too.  Every resource has a name that uniquely identifies it – the URI  Think of it like a primary key for each row in a database  REST doesn't dictate URI choice. Leaves it to the application author.
  • 6. c.What If? /getAccount /getAllAccounts /searchAccounts /createDirectory /updateGroup /updateGroupName /findGroupsByDirectory /verifyAccountEmailAddress As you move from an action oriented design towards resource oriented design, thinking of everything as nouns is one of the early challenges to overcome
  • 9. d.The Answer Fundamentally two types of resources: Collection Resource /applications /books /orders Instance Resource /applications/a1b2c3 /books/1235 /orders/abcdef Question : Guess REST equivalent for : Transaction.approve and Account.pay TransactionApproval and AccountPayment
  • 10. e.Behavior POST, GET, PUT, DELETE ≠ 1:1 Create, Read, Update, Delete
  • 11. f. PUT for Create Identifier is known by the client: PUT: Used to create a resource, or overwrite it. While you specify the resources new URL. For a new resource: PUT /questions/<new_question> HTTP/1.1 Host: www.example.com/ To overwrite an existing resource: PUT /questions/<existing_question> HTTP/1.1 Host: www.example.com/ PUT is Idempotent
  • 12. g.POST as Create  POST: Used to modify and update a resource POST /questions/<existing_question> HTTP/1.1 Host: www.example.com/ Note that the following is an error: POST /questions/<new_question> HTTP/1.1 Host: www.example.com/ If the URL is not yet created, you should not be using POST to create it while specifying the name. This should result in a 'resource not found' error because <new question> does not exist yet. You should PUT the <new question> resource on the server first. You could though do something like this to create a resources using POST: POST /applications { “name”: “Best App Ever” } Response: 201 Created Location: https://api.singh.com/applications/a1b2c3 POST NOT Idempotent -> x++ vs. x=4
  • 13. 4.a. Example/case Studies  Fine grained CRUD resources Vs Coarse Grained resources: Like Operation on blog post (“/posts/{post_id}/likes”) Comment Operation on blog post (“/posts/{post_id}/comments”) vs The single coarse grained resource “Post”(/posts/{post_id}” for “liking” or “commenting”
  • 14. 4.b. Example/case Studies  Change the Address: We can update “Customer” address via “Customers/001/Address/KA001/” or “Address/KA001/” VS Design the API around the resources that are based on the business processes and domain events . To update an existing bank customer’s address, a POST request can be made to “ChangeOfAddress” resource. Very important to distinguish between resources in REST API and domain entities in a domain driven design.
  • 15. 4.c HATEOAS  HATEOAS=Hypermedia As The Engine Of Application State Path is the hierarchical and the query is the non-hierarchical part of the URIs. ! Magic awesome sauce to improve REST! According to the HATEOAS constraint your client has to follow hyperlinks sent by the service. Those hyperlinks must be annotated with metadata regarding the semantics of them
  • 16. HATEOAS constrain  A REST client enters a REST application through a simple fixed URL. All future actions the client may take are discovered within resource representations returned from the server.  E.g: Request GET /account/12345 HTTP/1.1 Host: somebank.org Accept: application/xml Response: HTTP/1.1 200 OK Content-Type: application/xml Content-Length: ... <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">100.00</balance> <link rel="deposit" href="https://somebank.org/account/12345/deposit" /> <link rel="withdraw" href="https://somebank.org/account/12345/withdraw" /> <link rel="transfer" href="https://somebank.org/account/12345/transfer" /> <link rel="close" href="https://somebank.org/account/12345/close" /> </account> Later Response: HTTP/1.1 200 OK Content-Type: application/xml Content-Length: ... <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">-25.00</balance> <link rel="deposit" href="https://somebank.org/account/12345/deposit" /> </account>
  • 23. Worked examples How to GET a Cup of Coffee by Jim Webber, Savas Parastatidis & Ian Robinson Oct 02, 2008 http://www.infoq.com/articles/webber-rest-workflow