SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Coming to REST: Basic Stuff
@maxgoff
BIG SMART DATA
Coming to REST:
BIG SMART DATA
⁻ What is REST
⁻ REST Design Principles
⁻ REST Architecture Components
⁻ REST Design Guidelines
What is REST?
̵ Representational State Transfer
̵ Web Services Design Principles
̵ Focus: System’s Resources
̵ Simple HTTP transfer
̵ Lightweight alternative to RPC and
Web Services (SOAP, WSDL)
̵ Effectively replaced SOAP and WSDL
BIG SMART DATA
REST Origin: Doctoral Dissertation of Roy Thomas Fielding, PhD
What is REST?
̵ Platform Independent
̵ Language Independent
̵ Standards Based (HTTP)
̵ Can be used in the presence of firewalls
̵ REST is NOT a “standard”
BIG SMART DATA
Someone Special
345 Some Address
Some URL, WWW
127.0.0.1
Some Sender
012 Traceback Street
Some URL, WWW
198.168.1.1
Someone Special
345 Some Address
Some URL, WWW
127.0.0.1
REST vs SOAP
⁻ No envelope
⁻ Easier to handle
⁻ Waste less resources
BUT as secure(able) as SOAP
What is REST?
Four Basic Design Principles:
1) Use HTTP methods explicitly
2) Be stateless
3) Expose directory structure-like URLs
4) Transfer: XML, JSON, or both
BIG SMART DATA
REST Design Principles
Explicit HTTP methods:
BIG SMART DATA
CRUD Operation ≈ HTTP method ≈ SQL Equivalent
CREATE (resource on server) POST INSERT
READ (retrieve resource) GET SELECT
UPDATE (change or modify) PUT UPDATE
DELETE (destroy resource) DELETE DELETE
REST Design Principles
NOT a standard but a good idea
Be stateless:
BIG SMART DATA
Fig 1. Stateful design = bad
Source: http://www.ibm.com/developerworks/webservices/library/ws-restful
REST Design Principles
Be stateless:
BIG SMART DATA
Fig 2. Stateless design = good
Source: http://www.ibm.com/developerworks/webservices/library/ws-restful
Stateless design shifts the responsibility of maintaining
application state to the client
REST Design Principles
Expose directory structure-like URIs:
BIG SMART DATA
⁻ URI should be intuitive
⁻ Ideally, a self-documenting interface
⁻ Hierarchical, rooted at a single path
⁻ Design Affordance
REST Design Principles
Key components of REST architecture:
BIG SMART DATA
⁻ Resources
⁻ A web of resources
⁻ Client-server
⁻ No connection state
⁻ Resources should be cacheable
⁻ Proxy server friendly
REST Architecture Components
Resources:
BIG SMART DATA
⁻ Logical URLs: universally addressable
⁻ Key element of a true RESTful design
as opposed to “methods” or “services”
⁻ View object data as a resource
⁻ Resource contains all required information
or links to it
REST Architecture Components
A Web of Resources:
BIG SMART DATA
⁻ An arbitrary resource ought not be excessively
large and contain too fine-grained details
⁻ A resource ought to contain links to
additional information, just like a web page
REST Architecture Components
Client-Server:
BIG SMART DATA
⁻ Simple client-server assumption
⁻ One component’s server can be another
component’s client
REST Architecture Components
No Connection State:
BIG SMART DATA
⁻ Interaction is stateless
⁻ Servers and resources can be stateful
⁻ Each request carries all required information
⁻ No reliance on previous interactions
REST Architecture Components
Cacheable:
BIG SMART DATA
⁻ Resources should be cacheable
(when possible)
⁻ Protocols must allow server to specify
⁻ HTTP/HTTPS universally used
REST Architecture Components
Proxy servers:
⁻ Any standard HTTP proxy can be used
BIG SMART DATA
⁻ URLs
⁻ Queries
⁻ Documentation
⁻ GET v POST
⁻ Best Practices
REST Design Guidelines
BIG SMART DATA
⁻ Do not use “physical” URLs
⁻ Use logical URLs
REST Design Guidelines
URLs:
http://www.bigsmartdata.com/inventory/product123.xml
http://www.bigsmartdata.com/inventory/product/123
BIG SMART DATA
⁻ Should not return an overload of data
⁻ If needed, provide a paging mechanism:
eg: a “product list” GET request
returns the first N products
with next/prev links
REST Design Guidelines
Queries:
BIG SMART DATA
⁻ REST response can be anything, but …
⁻ APIs should be well documented
⁻ Do not change output format lightly
⁻ REMEMBER: Non-human clients
⁻ If output is XML, document with
schema or DTD
REST Design Guidelines
Documentation:
BIG SMART DATA
⁻ GET requests should never cause
a state change
⁻ Anything causing server state change
should be POST or other HTTP verbs
REST Design Guidelines
GET v POST:
BIG SMART DATA
⁻ Returns Include Actual URLs
⁻ instead of:
http://bigsmartdata.com/product/PRODUCT_ID
⁻ return:
http://bigsmartdata.com/product/012345 ...
REST Design Guidelines
Best Practices:
Output is larger but clients are more
easily directed to new URLs as needed
BIG SMART DATA
⁻ Keep Things Simple
⁻ Use 2 Base URLs per resource
⁻ Two fundamental abstractions:
⁻ Collections (Collection Resource)
⁻ Elements within Collections
(Instance Resource)
⁻ Use Ordinal Numbers for Versions
REST Design Guidelines
Best Practices:
BIG SMART DATA
⁻ Nouns are the new verbs
⁻ Use a noun to describe the action
⁻ The noun is the resource:
REST Design Guidelines
Best Practices:
Verb based Noun based
The project is validated by owner A project validation is created
The user deactivates the account A user account activation is deleted
A user subscribes to a group A subscription is created
RESTful Resources
Tutorials:
Pearson College “Learn REST”:
http://www.restapitutorial.com
Apigee YouTube Channel:
http://www.youtube.com/user/apigee
Learn REST:
http://rest.elkstein.org/
Resources:
IBM Developer Works:
http://www.ibm.com/developerworks/webservices/library/ws-restful/
HTTP Status Codes:
http://httpstatus.es/
Original Dissertation:
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
BIG SMART DATA
http://about.me/maxgoff
http://linkedin.com/in/maxgoff
http://bigsmartdata.com
@maxgoff
BIG SMART DATA

Más contenido relacionado

La actualidad más candente

Power BI For SharePointAdminsSLC
Power BI For SharePointAdminsSLCPower BI For SharePointAdminsSLC
Power BI For SharePointAdminsSLCSteve Pucelik
 
Amundsen at Brex and Looker integration
Amundsen at Brex and Looker integrationAmundsen at Brex and Looker integration
Amundsen at Brex and Looker integrationmarkgrover
 
REA Group's journey with Data Cataloging and Amundsen
REA Group's journey with Data Cataloging and AmundsenREA Group's journey with Data Cataloging and Amundsen
REA Group's journey with Data Cataloging and Amundsenmarkgrover
 
Apache atlas sydney 2017-v4
Apache atlas   sydney 2017-v4Apache atlas   sydney 2017-v4
Apache atlas sydney 2017-v4Nigel Jones
 
Metadata, Open Access and More: Crossref presentation
Metadata, Open Access and More: Crossref presentationMetadata, Open Access and More: Crossref presentation
Metadata, Open Access and More: Crossref presentationCrossref
 
A Complete BI Solution in About an Hour!
A Complete BI Solution in About an Hour!A Complete BI Solution in About an Hour!
A Complete BI Solution in About an Hour!Aaron King
 
No sql mongodb_publicsector2014_pp
No sql mongodb_publicsector2014_ppNo sql mongodb_publicsector2014_pp
No sql mongodb_publicsector2014_ppMongoDB
 
IndexedDB - An Efficient Way to Manage Data
IndexedDB - An Efficient Way to Manage DataIndexedDB - An Efficient Way to Manage Data
IndexedDB - An Efficient Way to Manage Datasara stanford
 
Original Working Draft of Bancha Project
Original Working Draft of Bancha ProjectOriginal Working Draft of Bancha Project
Original Working Draft of Bancha ProjectRolandSchuetz
 
All Aboard the Boxcar! Going Beyond the Basics of REST
All Aboard the Boxcar! Going Beyond the Basics of RESTAll Aboard the Boxcar! Going Beyond the Basics of REST
All Aboard the Boxcar! Going Beyond the Basics of RESTPat Patterson
 
Hap clojure berlin 2015
Hap clojure berlin 2015Hap clojure berlin 2015
Hap clojure berlin 2015alexanderkiel
 
Semi Structured Data
Semi Structured DataSemi Structured Data
Semi Structured DataMariaDB plc
 
From discovering to trusting data
From discovering to trusting dataFrom discovering to trusting data
From discovering to trusting datamarkgrover
 
Toronto OpenRefine MeetUp Nov 2015
Toronto OpenRefine MeetUp Nov 2015Toronto OpenRefine MeetUp Nov 2015
Toronto OpenRefine MeetUp Nov 2015Martin Magdinier
 
Heuristics for Fixing Common Errors in Deployed schema.org Microdata
Heuristics for Fixing Common Errors in Deployed schema.org MicrodataHeuristics for Fixing Common Errors in Deployed schema.org Microdata
Heuristics for Fixing Common Errors in Deployed schema.org MicrodataRobert Meusel
 

La actualidad más candente (19)

Power BI For SharePointAdminsSLC
Power BI For SharePointAdminsSLCPower BI For SharePointAdminsSLC
Power BI For SharePointAdminsSLC
 
Amundsen at Brex and Looker integration
Amundsen at Brex and Looker integrationAmundsen at Brex and Looker integration
Amundsen at Brex and Looker integration
 
REA Group's journey with Data Cataloging and Amundsen
REA Group's journey with Data Cataloging and AmundsenREA Group's journey with Data Cataloging and Amundsen
REA Group's journey with Data Cataloging and Amundsen
 
Apache atlas sydney 2017-v4
Apache atlas   sydney 2017-v4Apache atlas   sydney 2017-v4
Apache atlas sydney 2017-v4
 
Metadata, Open Access and More: Crossref presentation
Metadata, Open Access and More: Crossref presentationMetadata, Open Access and More: Crossref presentation
Metadata, Open Access and More: Crossref presentation
 
A Complete BI Solution in About an Hour!
A Complete BI Solution in About an Hour!A Complete BI Solution in About an Hour!
A Complete BI Solution in About an Hour!
 
No sql mongodb_publicsector2014_pp
No sql mongodb_publicsector2014_ppNo sql mongodb_publicsector2014_pp
No sql mongodb_publicsector2014_pp
 
Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
 
Reasoned SPARQL
Reasoned SPARQLReasoned SPARQL
Reasoned SPARQL
 
IndexedDB - An Efficient Way to Manage Data
IndexedDB - An Efficient Way to Manage DataIndexedDB - An Efficient Way to Manage Data
IndexedDB - An Efficient Way to Manage Data
 
Original Working Draft of Bancha Project
Original Working Draft of Bancha ProjectOriginal Working Draft of Bancha Project
Original Working Draft of Bancha Project
 
All Aboard the Boxcar! Going Beyond the Basics of REST
All Aboard the Boxcar! Going Beyond the Basics of RESTAll Aboard the Boxcar! Going Beyond the Basics of REST
All Aboard the Boxcar! Going Beyond the Basics of REST
 
Hap clojure berlin 2015
Hap clojure berlin 2015Hap clojure berlin 2015
Hap clojure berlin 2015
 
Semi Structured Data
Semi Structured DataSemi Structured Data
Semi Structured Data
 
Html 5 Overview
Html 5 OverviewHtml 5 Overview
Html 5 Overview
 
From discovering to trusting data
From discovering to trusting dataFrom discovering to trusting data
From discovering to trusting data
 
Toronto OpenRefine MeetUp Nov 2015
Toronto OpenRefine MeetUp Nov 2015Toronto OpenRefine MeetUp Nov 2015
Toronto OpenRefine MeetUp Nov 2015
 
Introducing Xapian
Introducing XapianIntroducing Xapian
Introducing Xapian
 
Heuristics for Fixing Common Errors in Deployed schema.org Microdata
Heuristics for Fixing Common Errors in Deployed schema.org MicrodataHeuristics for Fixing Common Errors in Deployed schema.org Microdata
Heuristics for Fixing Common Errors in Deployed schema.org Microdata
 

Similar a Coming to REST

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanJexia
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Pete Morano
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Serverswebhostingguy
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Ana Ivanchikj
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesKyle Banerjee
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013Jerome Louvel
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesRestlet
 
Introduction server Construction
Introduction server ConstructionIntroduction server Construction
Introduction server ConstructionJisu Park
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 

Similar a Coming to REST (20)

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
 
Unerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIsUnerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIs
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
Rest api design
Rest api designRest api design
Rest api design
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
HDP Next: Governance
HDP Next: GovernanceHDP Next: Governance
HDP Next: Governance
 
Rest introduction
Rest introductionRest introduction
Rest introduction
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web Sites
 
Introduction server Construction
Introduction server ConstructionIntroduction server Construction
Introduction server Construction
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Coming to REST

  • 1. Coming to REST: Basic Stuff @maxgoff BIG SMART DATA
  • 2. Coming to REST: BIG SMART DATA ⁻ What is REST ⁻ REST Design Principles ⁻ REST Architecture Components ⁻ REST Design Guidelines
  • 3. What is REST? ̵ Representational State Transfer ̵ Web Services Design Principles ̵ Focus: System’s Resources ̵ Simple HTTP transfer ̵ Lightweight alternative to RPC and Web Services (SOAP, WSDL) ̵ Effectively replaced SOAP and WSDL BIG SMART DATA REST Origin: Doctoral Dissertation of Roy Thomas Fielding, PhD
  • 4. What is REST? ̵ Platform Independent ̵ Language Independent ̵ Standards Based (HTTP) ̵ Can be used in the presence of firewalls ̵ REST is NOT a “standard” BIG SMART DATA
  • 5. Someone Special 345 Some Address Some URL, WWW 127.0.0.1 Some Sender 012 Traceback Street Some URL, WWW 198.168.1.1 Someone Special 345 Some Address Some URL, WWW 127.0.0.1 REST vs SOAP ⁻ No envelope ⁻ Easier to handle ⁻ Waste less resources BUT as secure(able) as SOAP What is REST?
  • 6. Four Basic Design Principles: 1) Use HTTP methods explicitly 2) Be stateless 3) Expose directory structure-like URLs 4) Transfer: XML, JSON, or both BIG SMART DATA REST Design Principles
  • 7. Explicit HTTP methods: BIG SMART DATA CRUD Operation ≈ HTTP method ≈ SQL Equivalent CREATE (resource on server) POST INSERT READ (retrieve resource) GET SELECT UPDATE (change or modify) PUT UPDATE DELETE (destroy resource) DELETE DELETE REST Design Principles NOT a standard but a good idea
  • 8. Be stateless: BIG SMART DATA Fig 1. Stateful design = bad Source: http://www.ibm.com/developerworks/webservices/library/ws-restful REST Design Principles
  • 9. Be stateless: BIG SMART DATA Fig 2. Stateless design = good Source: http://www.ibm.com/developerworks/webservices/library/ws-restful Stateless design shifts the responsibility of maintaining application state to the client REST Design Principles
  • 10. Expose directory structure-like URIs: BIG SMART DATA ⁻ URI should be intuitive ⁻ Ideally, a self-documenting interface ⁻ Hierarchical, rooted at a single path ⁻ Design Affordance REST Design Principles
  • 11. Key components of REST architecture: BIG SMART DATA ⁻ Resources ⁻ A web of resources ⁻ Client-server ⁻ No connection state ⁻ Resources should be cacheable ⁻ Proxy server friendly REST Architecture Components
  • 12. Resources: BIG SMART DATA ⁻ Logical URLs: universally addressable ⁻ Key element of a true RESTful design as opposed to “methods” or “services” ⁻ View object data as a resource ⁻ Resource contains all required information or links to it REST Architecture Components
  • 13. A Web of Resources: BIG SMART DATA ⁻ An arbitrary resource ought not be excessively large and contain too fine-grained details ⁻ A resource ought to contain links to additional information, just like a web page REST Architecture Components
  • 14. Client-Server: BIG SMART DATA ⁻ Simple client-server assumption ⁻ One component’s server can be another component’s client REST Architecture Components
  • 15. No Connection State: BIG SMART DATA ⁻ Interaction is stateless ⁻ Servers and resources can be stateful ⁻ Each request carries all required information ⁻ No reliance on previous interactions REST Architecture Components
  • 16. Cacheable: BIG SMART DATA ⁻ Resources should be cacheable (when possible) ⁻ Protocols must allow server to specify ⁻ HTTP/HTTPS universally used REST Architecture Components Proxy servers: ⁻ Any standard HTTP proxy can be used
  • 17. BIG SMART DATA ⁻ URLs ⁻ Queries ⁻ Documentation ⁻ GET v POST ⁻ Best Practices REST Design Guidelines
  • 18. BIG SMART DATA ⁻ Do not use “physical” URLs ⁻ Use logical URLs REST Design Guidelines URLs: http://www.bigsmartdata.com/inventory/product123.xml http://www.bigsmartdata.com/inventory/product/123
  • 19. BIG SMART DATA ⁻ Should not return an overload of data ⁻ If needed, provide a paging mechanism: eg: a “product list” GET request returns the first N products with next/prev links REST Design Guidelines Queries:
  • 20. BIG SMART DATA ⁻ REST response can be anything, but … ⁻ APIs should be well documented ⁻ Do not change output format lightly ⁻ REMEMBER: Non-human clients ⁻ If output is XML, document with schema or DTD REST Design Guidelines Documentation:
  • 21. BIG SMART DATA ⁻ GET requests should never cause a state change ⁻ Anything causing server state change should be POST or other HTTP verbs REST Design Guidelines GET v POST:
  • 22. BIG SMART DATA ⁻ Returns Include Actual URLs ⁻ instead of: http://bigsmartdata.com/product/PRODUCT_ID ⁻ return: http://bigsmartdata.com/product/012345 ... REST Design Guidelines Best Practices: Output is larger but clients are more easily directed to new URLs as needed
  • 23. BIG SMART DATA ⁻ Keep Things Simple ⁻ Use 2 Base URLs per resource ⁻ Two fundamental abstractions: ⁻ Collections (Collection Resource) ⁻ Elements within Collections (Instance Resource) ⁻ Use Ordinal Numbers for Versions REST Design Guidelines Best Practices:
  • 24. BIG SMART DATA ⁻ Nouns are the new verbs ⁻ Use a noun to describe the action ⁻ The noun is the resource: REST Design Guidelines Best Practices: Verb based Noun based The project is validated by owner A project validation is created The user deactivates the account A user account activation is deleted A user subscribes to a group A subscription is created
  • 25. RESTful Resources Tutorials: Pearson College “Learn REST”: http://www.restapitutorial.com Apigee YouTube Channel: http://www.youtube.com/user/apigee Learn REST: http://rest.elkstein.org/ Resources: IBM Developer Works: http://www.ibm.com/developerworks/webservices/library/ws-restful/ HTTP Status Codes: http://httpstatus.es/ Original Dissertation: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm BIG SMART DATA