SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Dernier (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

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