SlideShare a Scribd company logo
1 of 34
Download to read offline
being in a state of REST
             Aslam Khan
              @aslamkhn
            aslamkhan.net
       aslam.khan@factor10.com
What’s not on the agenda

          sniper shots

grenades strapped to chest rants

         mass hypnosis
Let’s take a few steps back
I did do this...create quote

        POST /quoteService
        <QuoteRequestMessage ...


                                    quote
                                   service



             200 OK
             <Quote ...
and this … accept quote
      POST /quoteService
      <AcceptQuoteMessage ...


                                 quote
                                service



       200 OK
       <StatusMessage ...
and this … exceptions
     POST /quoteService
     <AcceptQuoteMessage ...


                                quote
                               service



        200 OK
        <Error ...
REST(0)
POST /quoteService
<QuoteRequestMessage ...




                                       slinging XML
                            quote
                           service



      200 OK
      <Quote ...

POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service
                                          RPC == true
  200 OK




                                        REST == false
  <StatusMessage ...
POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service




   200 OK
   <Error ...




            no uniformity => accidental complexity
We should use
standards, right?
enter WS_*



   do contract first
xml schema + wsdl + soap + ...
   ptaaanngg!! ... oops … sniper shot

    feels like static typing in a dynamic world
WS-*
POST /quoteService
<QuoteRequestMessage ...




                                      slinging XML
                            quote
                           service



      200 OK
      <Quote ...

POST /quoteService
<AcceptQuoteMessage ...




                                        with envelopes
                            quote
                           service



  200 OK
  <StatusMessage ...



                                      Complex remote access protocol
POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service




   200 OK
   <Error ...




     toolsets are symptomatic of the complexity
This is not my idea of software development
Next attempt … many endpoints
       POST /customer/176202?fromDate...

                                /customer

              200 OK
              <Quote id="Q91827"


       POST /quote?ref=Q91827

                                /quote

              200 OK
              <Policy...
same thing … just friendly
     POST <FindQuote fromDate="...

                             /customer/176202

           200 OK
           <Quote id="Q91827"


     POST <AcceptQuote

                             /quote/Q91827

           200 OK
           <Policy...
but I can almost imagine the model
            customer

        findQuote(...)


                         *
                               quote

              policy         accept(...)
REST(1)



resources
addressability


oo-ish but no uniformity
How about this … verb idioms
    GET /customer/176202/quotes?from...

                                 /customer

              200 OK
              <Quote id="Q91827"


        POST /quote/Q91827
        <Acceptance ...

                                /quote

         201 OK
         Location: /policy/PX81730Z9...
         <Policy id="PX81730Z9...
Predictability is more important than
               GET          retrieve
                POST         create

                 PUT         update

          DELETE             delete

          don’t be dogmatic, be pragmatic
       think safe vs unsafe and side-effects
Again, being predictable

         201        created

        409         conflict

         401        unauthorised
         ...        ...

   uniformity is a powerful force
REST(2)



  HTTP Verbs
       +response codes


uniformity + unsafe vs safe operations
    but dumping a ton of URI’s on your friends is not very nice
This is the next step
    GET /customer/176202

                            /customer

200 OK
<Customer id="Q91827" ...
 <links>
   <link rel='find quotes'
         uri='/quotes/176202"/>
   <link rel='policy' uri='/policy/PX81730Z9"/>
and so on ...
    GET /quotes/Q91827




200 OK
<Quotes customer="176202" ...
 <quote id="Q91827"
   <links>
    <link rel='accept quote'
         uri='/blahblah?id="Q91827"/>
    <link rel='cancel quote'
         uri='/ushoqwbyw/198n392/>
state changed?
    GET /quotes/Q91827




200 OK
<Quotes customer="176202" ...
 <quote id="Q91827"
   <links>
    <link rel="self" uri='/quote/Q91827"/>
   </link>
REST(3)



      Hypermedia
           (HATEOS)


HTTP idioms + media-types + hypermedia
REST(0)

REST(1)

REST(2)
          }   vanilla Rails somewhere here




                 Richard
REST(3)
                                     son
                 maturity
                                 model
this is the signal
  in the noise!
  But it is always about design.

  How do you design when REST
  is your architectural style?

  REST is not the end goal, it is
  actually your starting position.

  And it’s not for everything.
REST(0)

REST(1)
               This is a
REST(2)     design choice.
          ranges from exploiting HTTP
               to honoring HTTP
REST(3)
Some context first

Design, for me, is just answering two questions.


   1. Does that thing express its intention?

   2. Where should I put that thing?
5 Design things to think about
resource overloading is not reuse
   doubling up a resource to serve more than
   its single purpose is more likely to introduce
   accidental complexity than visible benefit.

                               +

   there is no cost to having lots of resources
            (if there is, you have a bigger problem)




        the set of resources is open ended
Refer to self is important
        POST /customer
        <customer> ... </customer>



        200 OK
        <customer id=194839>
          ...
          <links>
            <link rel=”self” uri=”/customer/194839>
          </links>
        </customer>


no need to expose /customer/{customer_id}


            reduce URI explosions
Jou ma se State!

    customer

findQuote(...)


                 *
                       quote

      policy         accept(...)




  domain state                          resource state         application state




                                   app state can be inferred
Search

     /policy                /claim             /customer




Find all resources where         Find all claims that are
there is an email address        approved but unpaid and
“aslam.khan@factor10.com”       where the policy is paid up

    create another resource for the result … and then?
Domain : Resource Impedance
                                                      GET /lastmovement/CA28382
vehicle
                                                       { registration : Ca28382,
                                                         last_movement: {
                                         ?                 odo: 78282,
           *
                                                           lat: ...
                  movement
                                                          }
position                                                  links { ... }
                                                       }

           aggregates ==
                 resources?
               entities == resources?
                   not necessarily
               it is still a bi-directional mapping
                          no domain model?
                              problem
                             where should we model
                                   behavior?
Thanks, and so long

def valuable?(signal, noise)
  (signal.power/noise.power) > 1
end

valuable?(hype, design).should == false
valuable?(design, hype).should == true




        obligatory ruby code slide

More Related Content

Viewers also liked

Hybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-PaperHybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-PaperNguyen Nguyen
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Managerconnectwebex
 
Economic environment unit6
Economic environment unit6Economic environment unit6
Economic environment unit6UNBFS
 
Respeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumRespeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumUniversity of Warsaw
 
Special quadrilaterals proofs ans constructions
Special quadrilaterals  proofs ans constructions Special quadrilaterals  proofs ans constructions
Special quadrilaterals proofs ans constructions cristufer
 
Bao cao thuc tap
Bao cao thuc tapBao cao thuc tap
Bao cao thuc tapmrcuong1389
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kayeCee Saliendrez
 
Top 10 Tips from Millionaires
Top 10 Tips from MillionairesTop 10 Tips from Millionaires
Top 10 Tips from Millionairesmaemis
 
Oracle 10g Reference
Oracle 10g  ReferenceOracle 10g  Reference
Oracle 10g ReferenceEdison
 
Thinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps MovingThinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps MovingLuke Brooker
 
Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Julia vbvvvhgcv
 
Unit 2 Communication
Unit 2 CommunicationUnit 2 Communication
Unit 2 Communicationnigelcollege
 
Time saver project template
Time saver project templateTime saver project template
Time saver project templateKim Cao
 
Nce2文本
Nce2文本Nce2文本
Nce2文本Qu Yi
 
Facebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should UseFacebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should UseFirebelly Marketing
 

Viewers also liked (17)

Hybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-PaperHybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-Paper
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
 
Economic environment unit6
Economic environment unit6Economic environment unit6
Economic environment unit6
 
Respeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumRespeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculum
 
Special quadrilaterals proofs ans constructions
Special quadrilaterals  proofs ans constructions Special quadrilaterals  proofs ans constructions
Special quadrilaterals proofs ans constructions
 
Bao cao thuc tap
Bao cao thuc tapBao cao thuc tap
Bao cao thuc tap
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kaye
 
Top 10 Tips from Millionaires
Top 10 Tips from MillionairesTop 10 Tips from Millionaires
Top 10 Tips from Millionaires
 
Oracle 10g Reference
Oracle 10g  ReferenceOracle 10g  Reference
Oracle 10g Reference
 
Thinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps MovingThinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps Moving
 
Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)
 
Unit 2 Communication
Unit 2 CommunicationUnit 2 Communication
Unit 2 Communication
 
15 mei 2013
15 mei 201315 mei 2013
15 mei 2013
 
Time saver project template
Time saver project templateTime saver project template
Time saver project template
 
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
 
Nce2文本
Nce2文本Nce2文本
Nce2文本
 
Facebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should UseFacebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should Use
 

Similar to restful state changes

SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...Alessandro Nadalin
 
Service migration
Service migrationService migration
Service migrationBipin
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101IDERA Software
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfacesdeimos
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and SymfonyIgnacio Martín
 
Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...Alessandro Nadalin
 
Man in the Middle Attack on Banks
Man in the Middle Attack on BanksMan in the Middle Attack on Banks
Man in the Middle Attack on BanksMarko Elezović
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development Cprime
 
The vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQLThe vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQLLukas Eder
 
MongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB
 
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...Chris Richardson
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsBernd Ruecker
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Coupa Software
 
Apache O D E Apache Con E U2008
Apache O D E  Apache Con E U2008Apache O D E  Apache Con E U2008
Apache O D E Apache Con E U2008elliando dias
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsReturn on Intelligence
 

Similar to restful state changes (20)

SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
 
Service migration
Service migrationService migration
Service migration
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...
 
Man in the Middle Attack on Banks
Man in the Middle Attack on BanksMan in the Middle Attack on Banks
Man in the Middle Attack on Banks
 
Good code
Good codeGood code
Good code
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development
 
The vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQLThe vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQL
 
MongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB Stitch Tutorial
MongoDB Stitch Tutorial
 
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
 
Rails and security
Rails and securityRails and security
Rails and security
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
 
Ws rest
Ws restWs rest
Ws rest
 
Apache O D E Apache Con E U2008
Apache O D E  Apache Con E U2008Apache O D E  Apache Con E U2008
Apache O D E Apache Con E U2008
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic Conditions
 

More from Aslam Khan

The Humble Programmer
The Humble ProgrammerThe Humble Programmer
The Humble ProgrammerAslam Khan
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in ReasoningAslam Khan
 
Do we care rubyfuza 2019
Do we care   rubyfuza 2019Do we care   rubyfuza 2019
Do we care rubyfuza 2019Aslam Khan
 
Agile Rabbit Holes
Agile Rabbit HolesAgile Rabbit Holes
Agile Rabbit HolesAslam Khan
 
How to get open data into the hands of activists
How to get open data into the hands of activistsHow to get open data into the hands of activists
How to get open data into the hands of activistsAslam Khan
 
Beyond Apartheid and Democracy
Beyond Apartheid and DemocracyBeyond Apartheid and Democracy
Beyond Apartheid and DemocracyAslam Khan
 
Not Quite Object Oriented
Not Quite Object OrientedNot Quite Object Oriented
Not Quite Object OrientedAslam Khan
 
Lean in Software Development
Lean in Software DevelopmentLean in Software Development
Lean in Software DevelopmentAslam Khan
 
Product Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarProduct Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarAslam Khan
 
Yet another building metaphor
Yet another building metaphorYet another building metaphor
Yet another building metaphorAslam Khan
 
Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)Aslam Khan
 
Collaboration: TRC
Collaboration: TRCCollaboration: TRC
Collaboration: TRCAslam Khan
 

More from Aslam Khan (12)

The Humble Programmer
The Humble ProgrammerThe Humble Programmer
The Humble Programmer
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in Reasoning
 
Do we care rubyfuza 2019
Do we care   rubyfuza 2019Do we care   rubyfuza 2019
Do we care rubyfuza 2019
 
Agile Rabbit Holes
Agile Rabbit HolesAgile Rabbit Holes
Agile Rabbit Holes
 
How to get open data into the hands of activists
How to get open data into the hands of activistsHow to get open data into the hands of activists
How to get open data into the hands of activists
 
Beyond Apartheid and Democracy
Beyond Apartheid and DemocracyBeyond Apartheid and Democracy
Beyond Apartheid and Democracy
 
Not Quite Object Oriented
Not Quite Object OrientedNot Quite Object Oriented
Not Quite Object Oriented
 
Lean in Software Development
Lean in Software DevelopmentLean in Software Development
Lean in Software Development
 
Product Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarProduct Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile Webinar
 
Yet another building metaphor
Yet another building metaphorYet another building metaphor
Yet another building metaphor
 
Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)
 
Collaboration: TRC
Collaboration: TRCCollaboration: TRC
Collaboration: TRC
 

Recently uploaded

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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 

Recently uploaded (20)

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)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 

restful state changes

  • 1. being in a state of REST Aslam Khan @aslamkhn aslamkhan.net aslam.khan@factor10.com
  • 2. What’s not on the agenda sniper shots grenades strapped to chest rants mass hypnosis
  • 3. Let’s take a few steps back
  • 4. I did do this...create quote POST /quoteService <QuoteRequestMessage ... quote service 200 OK <Quote ...
  • 5. and this … accept quote POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <StatusMessage ...
  • 6. and this … exceptions POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ...
  • 7. REST(0) POST /quoteService <QuoteRequestMessage ... slinging XML quote service 200 OK <Quote ... POST /quoteService <AcceptQuoteMessage ... quote service RPC == true 200 OK REST == false <StatusMessage ... POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ... no uniformity => accidental complexity
  • 9. enter WS_* do contract first xml schema + wsdl + soap + ... ptaaanngg!! ... oops … sniper shot feels like static typing in a dynamic world
  • 10. WS-* POST /quoteService <QuoteRequestMessage ... slinging XML quote service 200 OK <Quote ... POST /quoteService <AcceptQuoteMessage ... with envelopes quote service 200 OK <StatusMessage ... Complex remote access protocol POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ... toolsets are symptomatic of the complexity
  • 11. This is not my idea of software development
  • 12. Next attempt … many endpoints POST /customer/176202?fromDate... /customer 200 OK <Quote id="Q91827" POST /quote?ref=Q91827 /quote 200 OK <Policy...
  • 13. same thing … just friendly POST <FindQuote fromDate="... /customer/176202 200 OK <Quote id="Q91827" POST <AcceptQuote /quote/Q91827 200 OK <Policy...
  • 14. but I can almost imagine the model customer findQuote(...) * quote policy accept(...)
  • 16. How about this … verb idioms GET /customer/176202/quotes?from... /customer 200 OK <Quote id="Q91827" POST /quote/Q91827 <Acceptance ... /quote 201 OK Location: /policy/PX81730Z9... <Policy id="PX81730Z9...
  • 17. Predictability is more important than GET retrieve POST create PUT update DELETE delete don’t be dogmatic, be pragmatic think safe vs unsafe and side-effects
  • 18. Again, being predictable 201 created 409 conflict 401 unauthorised ... ... uniformity is a powerful force
  • 19. REST(2) HTTP Verbs +response codes uniformity + unsafe vs safe operations but dumping a ton of URI’s on your friends is not very nice
  • 20. This is the next step GET /customer/176202 /customer 200 OK <Customer id="Q91827" ... <links> <link rel='find quotes' uri='/quotes/176202"/> <link rel='policy' uri='/policy/PX81730Z9"/>
  • 21. and so on ... GET /quotes/Q91827 200 OK <Quotes customer="176202" ... <quote id="Q91827" <links> <link rel='accept quote' uri='/blahblah?id="Q91827"/> <link rel='cancel quote' uri='/ushoqwbyw/198n392/>
  • 22. state changed? GET /quotes/Q91827 200 OK <Quotes customer="176202" ... <quote id="Q91827" <links> <link rel="self" uri='/quote/Q91827"/> </link>
  • 23. REST(3) Hypermedia (HATEOS) HTTP idioms + media-types + hypermedia
  • 24. REST(0) REST(1) REST(2) } vanilla Rails somewhere here Richard REST(3) son maturity model
  • 25. this is the signal in the noise! But it is always about design. How do you design when REST is your architectural style? REST is not the end goal, it is actually your starting position. And it’s not for everything.
  • 26. REST(0) REST(1) This is a REST(2) design choice. ranges from exploiting HTTP to honoring HTTP REST(3)
  • 27. Some context first Design, for me, is just answering two questions. 1. Does that thing express its intention? 2. Where should I put that thing?
  • 28. 5 Design things to think about
  • 29. resource overloading is not reuse doubling up a resource to serve more than its single purpose is more likely to introduce accidental complexity than visible benefit. + there is no cost to having lots of resources (if there is, you have a bigger problem) the set of resources is open ended
  • 30. Refer to self is important POST /customer <customer> ... </customer> 200 OK <customer id=194839> ... <links> <link rel=”self” uri=”/customer/194839> </links> </customer> no need to expose /customer/{customer_id} reduce URI explosions
  • 31. Jou ma se State! customer findQuote(...) * quote policy accept(...) domain state resource state application state app state can be inferred
  • 32. Search /policy /claim /customer Find all resources where Find all claims that are there is an email address approved but unpaid and “aslam.khan@factor10.com” where the policy is paid up create another resource for the result … and then?
  • 33. Domain : Resource Impedance GET /lastmovement/CA28382 vehicle { registration : Ca28382, last_movement: { ? odo: 78282, * lat: ... movement } position links { ... } } aggregates == resources? entities == resources? not necessarily it is still a bi-directional mapping no domain model? problem where should we model behavior?
  • 34. Thanks, and so long def valuable?(signal, noise) (signal.power/noise.power) > 1 end valuable?(hype, design).should == false valuable?(design, hype).should == true obligatory ruby code slide