SlideShare a Scribd company logo
RPC to  Hypermedia
       REST
          

Concrete case on Payments API


       @andreineculau
RPC - Making a Remote Procedure Call

 1   client imagines :
 2       server . translate ’ Hello ’ , ’sv ’
 3
 4
 5   client sends :
 6       POST / rpc
 7        Content - Type : application / json
 8       {
 9            method :  translate  ,
10            args :    [ Hello  ,  sv ]
11       }


                                      1    server expects :
                                      2        app . post ’/ rpc ’ ,        ( req , res ) -
                                      3              fun = req . body . method # translate
                                      4              args = req . body . args #  Hello  ,  sv 
                                      5              call fun , args            #  Hej 
                                      6
                                      7
                                      8    server sends :
                                      9         200 OK
                                     10         Content - Type : application / json
                                     11        {
                                     12             result :  Hej 
                                     13        }
REST - Making a HTTP request

 1   client imagines :
 2       server . translate ’ Hello ’ , ’sv ’
 3
 4
 5   client sends :
 6       POST / translate
 7        Content - Type : application / json
 8       {
 9            text :  Hello  ,
10            language :  sv 
11       }


                                      1    server expects :
                                      2        app . post ’/ translate ’ , ( req , res ) -
                                      3              fun = ’ translate ’       # translate
                                      4              args = req . body         #  Hello  ,  sv 
                                      5              call fun , args           #  Hej 
                                      6
                                      7
                                      8    server sends :
                                      9         200 OK
                                     10         Content - Type : application / json
                                     11        {
                                     12             result :  Hej 
                                     13        }
RPC to REST
RPC to REST
RPC to REST
Look around you. It’s not just you.
Perspectives. Hypermedia vs REST
Klarna
Journey of an API




      envision
      spec
      mock
      serve
      consume
Serving uniform HTTP
serve: Webmachine
serve: JeSSE




               schema
Journey of an API




      envision
      spec
      mock
      serve
      consume
envision: RESTgraph
spec: RESTpi for machines
spec: RESTpi by humans for humans
mock: Apiary.io
consume: RESTit



      1 URI as the only runtime requirement
      Centered around resources
      Simplify representations
      Transfer Protocol Layer
      Hypermedia Layer
      Hooks
      Sugar
consume: RESTit


1   it ’ should enter the store and look around ’ , ( done ) -
2     re$ = RESTit (). re$
3     re$ ( ’ http :// starbucks . apiary . io ’)
4     . read ()
5     . callback ( err , resp ) -
6        return done err if err
7        resp [0]. statusCode . should . equal 200
8        done ()


                                   1   it ’ should see what can be done with orders ’ , ( done ) -
                                   2     re$ = RESTit (). re$
                                   3
                                   4     re$ ( ’ http :// starbucks . apiary . io ’)
                                   5     . read ()
                                   6     . follow ( ’/ rels / orders ’)
                                   7     . options ()
                                   8     . callback ( err , resp ) -
                                   9        return done err if err
                                  10        resp [0]. statusCode . should . equal 200
                                  11        resp [0]. canPOST . should . equal true
                                  12        should . not . equal resp [0]. canDELETE , true # undefined
                                  13        done ()
consume: RESTit

 1   it ’ should place an order and then update it ’ , ( done ) -
 2     re$ = RESTit (). re$
 3
 4     re$ ( ’ http :// starbucks . apiary . io ’)
 5     . read ()
 6     . follow ( ’/ rels / orders ’)
 7     . create ({ representation :{ drink : ’ espresso ’}})
 8     . fo llowLocation ()
 9     . read ()
10     . callback ( err , resp ) -
11        return done err if err
12        resp [0]. statusCode . should . equal 200
13        @ [0]. bookmarkAs ’ myOrder ’
14        changeMyMind ()
15
16     changeMyMind = () -
17       re$ ( ’ myOrder ’)
18       . update ({ representation :{ ammend_drink : ’ with cream ’}})
19       . callback ( err , resp ) -
20          return done err if err
21          return done ()
22          resp [0]. statusCode . should . equal 200
23          resp [0]. representation . get ( ’. drink ’). should . equal ’ espresso con panna ’
24          done ()
consume: RESTit




 1   it ’ should smuggle an order ’ , ( done ) -
 2     re$ = RESTit (). re$
 3
 4     re$ ( ’ myOrder ’)
 5     . go ( ’ smuggle ’ , { representation :{ drink : ’ latte ’}})
 6     . callback ( err , resp ) -
 7        return done err if err
 8        resp [0]. statusCode . should . equal 200
 9        resp [0]. representation . get ( ’. drink ’). should . equal ’ latte ’
10        done ()
tools
simpler, safer  more fun
KITT
 KISS
RPC to  Hypermedia
       REST
          

Concrete case on Payments API


       @andreineculau




December 3-4, 2012, APIdays.io
Credits




          Scott Brinker, Marketing Technology Landscape Supergraphic
          Adam DuVander/Programmable Web, 5000 APIs: Facebook, Google, Twitter are changing the
          web
          Google Trends: Architecture styles
          Simon Dongle, Good Morning 2012
          Alan Dean, HTTP/1.1 activity diagram
          Philipp Meier, Liberator
          Data-Driven Documents
          sigma.js

More Related Content

What's hot

関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
yiditushe
 
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitetKubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Per Bernhardt
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
morgoth
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
sickill
 
SVN Hook
SVN HookSVN Hook
SVN Hook
Thomas Weinert
 
Ajax basics
Ajax basicsAjax basics
Application Layer in PHP
Application Layer in PHPApplication Layer in PHP
Application Layer in PHP
Per Bernhardt
 
More to RoC weibo
More to RoC weiboMore to RoC weibo
More to RoC weibo
shaokun
 
OWASP Proxy
OWASP ProxyOWASP Proxy
OWASP Proxy
Security B-Sides
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
Jeen Lee
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
D
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
guoqing75
 
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter KriensHow to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
mfrancis
 
Server Side? Swift
Server Side? SwiftServer Side? Swift
Server Side? Swift
Takaaki Tanaka
 
Rails web api 开发
Rails web api 开发Rails web api 开发
Rails web api 开发
shaokun
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
jimi-c
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
Tony Fabeen
 
Wykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w LaraveluWykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w Laravelu
Laravel Poland MeetUp
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-liners
daoswald
 

What's hot (20)

関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitetKubernetes: Wie Chefkoch.de mit Containern arbeitet
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
 
SVN Hook
SVN HookSVN Hook
SVN Hook
 
Ajax basics
Ajax basicsAjax basics
Ajax basics
 
Application Layer in PHP
Application Layer in PHPApplication Layer in PHP
Application Layer in PHP
 
More to RoC weibo
More to RoC weiboMore to RoC weibo
More to RoC weibo
 
OWASP Proxy
OWASP ProxyOWASP Proxy
OWASP Proxy
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter KriensHow to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
 
Server Side? Swift
Server Side? SwiftServer Side? Swift
Server Side? Swift
 
Rails web api 开发
Rails web api 开发Rails web api 开发
Rails web api 开发
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Wykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w LaraveluWykorzystanie form request przy implementacji API w Laravelu
Wykorzystanie form request przy implementacji API w Laravelu
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-liners
 

Similar to RPC to REST (Hypermedia)

node.js workshop- node.js basics
node.js workshop- node.js basicsnode.js workshop- node.js basics
node.js workshop- node.js basics
Qiong Wu
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)
Yuichiro MASUI
 
node.js workshop- node.js middleware
node.js workshop- node.js middlewarenode.js workshop- node.js middleware
node.js workshop- node.js middleware
Qiong Wu
 
OSC2007-niigata - mashup
OSC2007-niigata - mashupOSC2007-niigata - mashup
OSC2007-niigata - mashup
Yuichiro MASUI
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
Marc Gear
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.js
jubilem
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconf
Michele Orselli
 
Real Time App with Node.js
Real Time App with Node.jsReal Time App with Node.js
Real Time App with Node.js
Jxck Jxck
 
Real World React Native & ES7
Real World React Native & ES7Real World React Native & ES7
Real World React Native & ES7
joestanton1
 
PSR-7, middlewares e o futuro dos frameworks
PSR-7, middlewares e o futuro dos frameworksPSR-7, middlewares e o futuro dos frameworks
PSR-7, middlewares e o futuro dos frameworks
Elton Minetto
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 
Sibelius Seraphini - Relay Modern
Sibelius Seraphini - Relay ModernSibelius Seraphini - Relay Modern
Sibelius Seraphini - Relay Modern
React Conf Brasil
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
Vladimir Kostyukov
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
delagoya
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
nickmbailey
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
Rusty Klophaus
 
REST API for your WP7 App
REST API for your WP7 AppREST API for your WP7 App
REST API for your WP7 App
Agnius Paradnikas
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbit
Redis Labs
 

Similar to RPC to REST (Hypermedia) (20)

node.js workshop- node.js basics
node.js workshop- node.js basicsnode.js workshop- node.js basics
node.js workshop- node.js basics
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)
 
node.js workshop- node.js middleware
node.js workshop- node.js middlewarenode.js workshop- node.js middleware
node.js workshop- node.js middleware
 
OSC2007-niigata - mashup
OSC2007-niigata - mashupOSC2007-niigata - mashup
OSC2007-niigata - mashup
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.js
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconf
 
Real Time App with Node.js
Real Time App with Node.jsReal Time App with Node.js
Real Time App with Node.js
 
Real World React Native & ES7
Real World React Native & ES7Real World React Native & ES7
Real World React Native & ES7
 
PSR-7, middlewares e o futuro dos frameworks
PSR-7, middlewares e o futuro dos frameworksPSR-7, middlewares e o futuro dos frameworks
PSR-7, middlewares e o futuro dos frameworks
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Sibelius Seraphini - Relay Modern
Sibelius Seraphini - Relay ModernSibelius Seraphini - Relay Modern
Sibelius Seraphini - Relay Modern
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
REST API for your WP7 App
REST API for your WP7 AppREST API for your WP7 App
REST API for your WP7 App
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbit
 

Recently uploaded

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

RPC to REST (Hypermedia)

  • 1.
  • 2. RPC to Hypermedia REST Concrete case on Payments API @andreineculau
  • 3. RPC - Making a Remote Procedure Call 1 client imagines : 2 server . translate ’ Hello ’ , ’sv ’ 3 4 5 client sends : 6 POST / rpc 7 Content - Type : application / json 8 { 9 method : translate , 10 args : [ Hello , sv ] 11 } 1 server expects : 2 app . post ’/ rpc ’ , ( req , res ) - 3 fun = req . body . method # translate 4 args = req . body . args # Hello , sv 5 call fun , args # Hej 6 7 8 server sends : 9 200 OK 10 Content - Type : application / json 11 { 12 result : Hej 13 }
  • 4. REST - Making a HTTP request 1 client imagines : 2 server . translate ’ Hello ’ , ’sv ’ 3 4 5 client sends : 6 POST / translate 7 Content - Type : application / json 8 { 9 text : Hello , 10 language : sv 11 } 1 server expects : 2 app . post ’/ translate ’ , ( req , res ) - 3 fun = ’ translate ’ # translate 4 args = req . body # Hello , sv 5 call fun , args # Hej 6 7 8 server sends : 9 200 OK 10 Content - Type : application / json 11 { 12 result : Hej 13 }
  • 8. Look around you. It’s not just you.
  • 11. Journey of an API envision spec mock serve consume
  • 14. serve: JeSSE schema
  • 15.
  • 16. Journey of an API envision spec mock serve consume
  • 18. spec: RESTpi for machines
  • 19. spec: RESTpi by humans for humans
  • 21. consume: RESTit 1 URI as the only runtime requirement Centered around resources Simplify representations Transfer Protocol Layer Hypermedia Layer Hooks Sugar
  • 22. consume: RESTit 1 it ’ should enter the store and look around ’ , ( done ) - 2 re$ = RESTit (). re$ 3 re$ ( ’ http :// starbucks . apiary . io ’) 4 . read () 5 . callback ( err , resp ) - 6 return done err if err 7 resp [0]. statusCode . should . equal 200 8 done () 1 it ’ should see what can be done with orders ’ , ( done ) - 2 re$ = RESTit (). re$ 3 4 re$ ( ’ http :// starbucks . apiary . io ’) 5 . read () 6 . follow ( ’/ rels / orders ’) 7 . options () 8 . callback ( err , resp ) - 9 return done err if err 10 resp [0]. statusCode . should . equal 200 11 resp [0]. canPOST . should . equal true 12 should . not . equal resp [0]. canDELETE , true # undefined 13 done ()
  • 23. consume: RESTit 1 it ’ should place an order and then update it ’ , ( done ) - 2 re$ = RESTit (). re$ 3 4 re$ ( ’ http :// starbucks . apiary . io ’) 5 . read () 6 . follow ( ’/ rels / orders ’) 7 . create ({ representation :{ drink : ’ espresso ’}}) 8 . fo llowLocation () 9 . read () 10 . callback ( err , resp ) - 11 return done err if err 12 resp [0]. statusCode . should . equal 200 13 @ [0]. bookmarkAs ’ myOrder ’ 14 changeMyMind () 15 16 changeMyMind = () - 17 re$ ( ’ myOrder ’) 18 . update ({ representation :{ ammend_drink : ’ with cream ’}}) 19 . callback ( err , resp ) - 20 return done err if err 21 return done () 22 resp [0]. statusCode . should . equal 200 23 resp [0]. representation . get ( ’. drink ’). should . equal ’ espresso con panna ’ 24 done ()
  • 24. consume: RESTit 1 it ’ should smuggle an order ’ , ( done ) - 2 re$ = RESTit (). re$ 3 4 re$ ( ’ myOrder ’) 5 . go ( ’ smuggle ’ , { representation :{ drink : ’ latte ’}}) 6 . callback ( err , resp ) - 7 return done err if err 8 resp [0]. statusCode . should . equal 200 9 resp [0]. representation . get ( ’. drink ’). should . equal ’ latte ’ 10 done ()
  • 27. RPC to Hypermedia REST Concrete case on Payments API @andreineculau December 3-4, 2012, APIdays.io
  • 28. Credits Scott Brinker, Marketing Technology Landscape Supergraphic Adam DuVander/Programmable Web, 5000 APIs: Facebook, Google, Twitter are changing the web Google Trends: Architecture styles Simon Dongle, Good Morning 2012 Alan Dean, HTTP/1.1 activity diagram Philipp Meier, Liberator Data-Driven Documents sigma.js