SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Integrating Restfully
       Srihari Srinivasan

       ThoughtWorks
Web 2.0

Platform for software development
1   :   3
Primer on REST



 • REST - Representational State Transfer
 • Term coined by Roy Fielding in his Ph.d thesis
Principled Architecture / Design

               of


Large Scale Distributed Systems
Primer on REST



•   Architectural style followed by the Web

•   Its Generic, can be used to build other web-like systems
Qualities


 •   Performance, Scalability, Interoperability

 •   Simplicity, Extensibility

 •   Visibility of Interactions

 •   Reliability
REST intentionally places
Constraints on the system to achieve Desired Properties
REST - What it is not


 •   Not a standard, an architectural style

 •   Standards based on this style - HTTP, ATOM

 •   Ignores implementation details of components and protocol syntax
REST - What it is not

•   Not the ONLY style for governing network interactions.

    •   Event Driven Architectures

    •   Message Oriented Architecture

    •   and good old RPC...

•   Most large systems have hybrid styles, one style may dominate though!
REST Constraints
REST Constraints
•   Client-Server

•   Statelessness

•   Caching

•   Layered System

•   Uniform Interface

•   Code on Demand (optional)
Client-Server Style of Interactions


•   Based on the principle of separation of concerns

•   Client and Server can be developed, maintained and scaled independently

•   Desired Properties : Simplicity, Scalability, Portability of user interfaces
Uniform Interface


•   The central/distinguishing feature of REST

•   Most Controversial !
Uniform Interfaces are opposed to Specialized Interfaces
Specialized Interfaces
Employee Service
                          createEmployee(....)

                          updateEmployee(....)

                    getEmployeeDetails(identifier)

                   transferEmployee(identifier, to, ...)

                      deleteEmployee(identifier)
What happens when lots of such special interfaces
          float in a distributed system ?
Specialization Consequences
 •   Clients have to know

     •   Method names, parameters

     •   Semantics of the methods

     •   Possibly the order of method calls

 •   Each service interface is a new custom application protocol

 •   Clients cannot be generic
Specialization Consequences


 •   RPC style tries to map local computing notions to distribute operations

 •   Leads to data specialization

 •   Therefore couples format of the data to the interface
How does the Uniform Interface constraint help ?
Consequences of Specializing

 •   RPC/Service style interfaces promote specialization along two
     dimensions

      •   Operations

      •   Data
More Constraints
REST discourages sending ad hoc messages,
    invoking special purpose functions
Resources

•   Key Abstraction, Basic Unit of information

•   Can be anything interesting

    •   spreadsheet, image, xml file, transaction etc

•   Uniquely identifiable via a URI
Resources

•   Manipulated using representations - quot;Pass-by-valuequot; semantics

•   All resources manipulated via a limited set of standard functions/
    operations

    •   In HTTP we have GET, POST, PUT & DELETE with well defined
        semantics for each
Resources

•   Representations can be in any format

•   Self describing messages help specify preferred formats

•   Clients can even negotiate on formats with servers
How can a limited number of interfaces suffice
              to perform many
       domain specific operations ?
Resources
•   REST promotes replacing the quot;do somethingquot; concept with a quot;make
    something soquot; concept

•   “What” and not “How”

•   Think Declarative, instead of Imperative
Hypermedia as the engine of application state
Hypermedia

•   Representations must contain next steps/transitions a resource can
    make from the current state

•   Use hyperlinks to define these transitions
Resource Orientation
 •   HTTP GET from http://server.com/employees/name

 •   HTTP POST to http://server.coms/employees

 •   HTTP PUT to http://server.com/employees/name

 •   HTTP POST to http://server.com/employees/name/transfer

 •   HTTP DELETE to http://server.com/employees/name
Resource Orientation
•   Model Resources, instead of services

•   Assign identifiers to resources

•   Expose uniform operations on resources based on your chosen
    protocol/framework

•   Support multiple formats - “One size does not fit all”

•   Leverage hypermedia to traverse through finite states
Summary

•   REST tries to reveal the distribution in distributed systems

•   Popularizes HTTP outside the browser

•   Reminds us that HTTP is not a transport protocol

•   The ideas of REST have merit even if you are doing classic SOA

•   Not easy to grok, requires unlearning and relearning!
</presentation>

Contenu connexe

Tendances

Web Services
Web ServicesWeb Services
Web ServicesRTigger
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesBhavendra Chavan
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
Sql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldSql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldQuest Software
 
Hypermedia APIs: The Rest of REST
Hypermedia APIs: The Rest of RESTHypermedia APIs: The Rest of REST
Hypermedia APIs: The Rest of RESTChris Marinos
 
[WSO2Con EU 2017] Ballerina: Exploring Data Integration
[WSO2Con EU 2017] Ballerina: Exploring Data Integration[WSO2Con EU 2017] Ballerina: Exploring Data Integration
[WSO2Con EU 2017] Ballerina: Exploring Data IntegrationWSO2
 
Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web servicesNitin Kumar Yadav
 
SQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by MicrosoftSQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by Microsoftsara stanford
 
[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to BallerinaWSO2
 
Introduction to REST
Introduction to RESTIntroduction to REST
Introduction to RESTkumar gaurav
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCdigitalsonic
 

Tendances (20)

Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
Web Services
Web ServicesWeb Services
Web Services
 
Web Services
Web ServicesWeb Services
Web Services
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Sql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldSql Server Service Broker In The Real World
Sql Server Service Broker In The Real World
 
Hypermedia APIs: The Rest of REST
Hypermedia APIs: The Rest of RESTHypermedia APIs: The Rest of REST
Hypermedia APIs: The Rest of REST
 
SQL Server Service Brokers
SQL Server Service BrokersSQL Server Service Brokers
SQL Server Service Brokers
 
[WSO2Con EU 2017] Ballerina: Exploring Data Integration
[WSO2Con EU 2017] Ballerina: Exploring Data Integration[WSO2Con EU 2017] Ballerina: Exploring Data Integration
[WSO2Con EU 2017] Ballerina: Exploring Data Integration
 
Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web services
 
Web services
Web servicesWeb services
Web services
 
SQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by MicrosoftSQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by Microsoft
 
[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina[WSO2Con EU 2017] Introduction to Ballerina
[WSO2Con EU 2017] Introduction to Ballerina
 
Rest vs Soap
Rest vs SoapRest vs Soap
Rest vs Soap
 
Introduction to REST
Introduction to RESTIntroduction to REST
Introduction to REST
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
Wcf v1-day1
Wcf v1-day1Wcf v1-day1
Wcf v1-day1
 
Java web services
Java web servicesJava web services
Java web services
 
Web services for banks
Web services for banksWeb services for banks
Web services for banks
 

Similaire à Integrating RESTfully

ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawnozten
 
Rest Reuse And Serendipity
Rest Reuse And SerendipityRest Reuse And Serendipity
Rest Reuse And SerendipityQConLondon2008
 
RESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationRESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationKirkWylie
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipitydeimos
 
Applications of the REST Principle
Applications of the REST PrincipleApplications of the REST Principle
Applications of the REST Principleelliando dias
 
Enterprise Data Services for Strategic SOA
Enterprise Data Services for Strategic SOAEnterprise Data Services for Strategic SOA
Enterprise Data Services for Strategic SOAsumedha.r
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIPankaj Bajaj
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introductionDaniel Toader
 
Service Oriented Architecture
Service Oriented Architecture Service Oriented Architecture
Service Oriented Architecture Prabhat gangwar
 
Remote Procedure Call over DDS - London Connext DDS Conference
Remote Procedure Call over DDS - London Connext DDS Conference Remote Procedure Call over DDS - London Connext DDS Conference
Remote Procedure Call over DDS - London Connext DDS Conference Gerardo Pardo-Castellote
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 

Similaire à Integrating RESTfully (20)

ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawn
 
Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289
 
Rest Reuse And Serendipity
Rest Reuse And SerendipityRest Reuse And Serendipity
Rest Reuse And Serendipity
 
RESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationRESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems Integration
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipity
 
Applications of the REST Principle
Applications of the REST PrincipleApplications of the REST Principle
Applications of the REST Principle
 
Enterprise Data Services for Strategic SOA
Enterprise Data Services for Strategic SOAEnterprise Data Services for Strategic SOA
Enterprise Data Services for Strategic SOA
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
 
Rest api design
Rest api designRest api design
Rest api design
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introduction
 
Service Oriented Architecture
Service Oriented Architecture Service Oriented Architecture
Service Oriented Architecture
 
Remote Procedure Call over DDS - London Connext DDS Conference
Remote Procedure Call over DDS - London Connext DDS Conference Remote Procedure Call over DDS - London Connext DDS Conference
Remote Procedure Call over DDS - London Connext DDS Conference
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
Five API Styles
Five API StylesFive API Styles
Five API Styles
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 

Dernier

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 

Integrating RESTfully

  • 1. Integrating Restfully Srihari Srinivasan ThoughtWorks
  • 2. Web 2.0 Platform for software development
  • 3.
  • 4.
  • 5. 1 : 3
  • 6. Primer on REST • REST - Representational State Transfer • Term coined by Roy Fielding in his Ph.d thesis
  • 7.
  • 8. Principled Architecture / Design of Large Scale Distributed Systems
  • 9. Primer on REST • Architectural style followed by the Web • Its Generic, can be used to build other web-like systems
  • 10. Qualities • Performance, Scalability, Interoperability • Simplicity, Extensibility • Visibility of Interactions • Reliability
  • 11. REST intentionally places Constraints on the system to achieve Desired Properties
  • 12. REST - What it is not • Not a standard, an architectural style • Standards based on this style - HTTP, ATOM • Ignores implementation details of components and protocol syntax
  • 13. REST - What it is not • Not the ONLY style for governing network interactions. • Event Driven Architectures • Message Oriented Architecture • and good old RPC... • Most large systems have hybrid styles, one style may dominate though!
  • 15. REST Constraints • Client-Server • Statelessness • Caching • Layered System • Uniform Interface • Code on Demand (optional)
  • 16. Client-Server Style of Interactions • Based on the principle of separation of concerns • Client and Server can be developed, maintained and scaled independently • Desired Properties : Simplicity, Scalability, Portability of user interfaces
  • 17. Uniform Interface • The central/distinguishing feature of REST • Most Controversial !
  • 18. Uniform Interfaces are opposed to Specialized Interfaces
  • 19. Specialized Interfaces Employee Service createEmployee(....) updateEmployee(....) getEmployeeDetails(identifier) transferEmployee(identifier, to, ...) deleteEmployee(identifier)
  • 20. What happens when lots of such special interfaces float in a distributed system ?
  • 21. Specialization Consequences • Clients have to know • Method names, parameters • Semantics of the methods • Possibly the order of method calls • Each service interface is a new custom application protocol • Clients cannot be generic
  • 22. Specialization Consequences • RPC style tries to map local computing notions to distribute operations • Leads to data specialization • Therefore couples format of the data to the interface
  • 23. How does the Uniform Interface constraint help ?
  • 24. Consequences of Specializing • RPC/Service style interfaces promote specialization along two dimensions • Operations • Data
  • 26. REST discourages sending ad hoc messages, invoking special purpose functions
  • 27. Resources • Key Abstraction, Basic Unit of information • Can be anything interesting • spreadsheet, image, xml file, transaction etc • Uniquely identifiable via a URI
  • 28. Resources • Manipulated using representations - quot;Pass-by-valuequot; semantics • All resources manipulated via a limited set of standard functions/ operations • In HTTP we have GET, POST, PUT & DELETE with well defined semantics for each
  • 29. Resources • Representations can be in any format • Self describing messages help specify preferred formats • Clients can even negotiate on formats with servers
  • 30. How can a limited number of interfaces suffice to perform many domain specific operations ?
  • 31. Resources • REST promotes replacing the quot;do somethingquot; concept with a quot;make something soquot; concept • “What” and not “How” • Think Declarative, instead of Imperative
  • 32. Hypermedia as the engine of application state
  • 33. Hypermedia • Representations must contain next steps/transitions a resource can make from the current state • Use hyperlinks to define these transitions
  • 34. Resource Orientation • HTTP GET from http://server.com/employees/name • HTTP POST to http://server.coms/employees • HTTP PUT to http://server.com/employees/name • HTTP POST to http://server.com/employees/name/transfer • HTTP DELETE to http://server.com/employees/name
  • 35. Resource Orientation • Model Resources, instead of services • Assign identifiers to resources • Expose uniform operations on resources based on your chosen protocol/framework • Support multiple formats - “One size does not fit all” • Leverage hypermedia to traverse through finite states
  • 36. Summary • REST tries to reveal the distribution in distributed systems • Popularizes HTTP outside the browser • Reminds us that HTTP is not a transport protocol • The ideas of REST have merit even if you are doing classic SOA • Not easy to grok, requires unlearning and relearning!