SlideShare a Scribd company logo
1 of 50
High Performance
APIs
Jacksonfdam
http://about.me/jacksonfdam
https://bitbucket.org/jacksonfdam
https://github.com/jacksonfdam
http://linkedin.com/in/jacksonfdam
@jacksonfdam
APIs: Windows To The Code
In the simplest terms, APIs are sets of requirements that govern
how one application can talk to another.
APIs: Windows To The Code
APIs do all this by exposing some of a program's internal
functions to the outside world in a limited fashion.
API Analogy
Every time you want to access a set of data from an application,
you have to call the API. But there is only a certain amount of
data the application will let you access, so you have to
communicate to the operator in a very specific language—a
language unique to each application.
API Analogy
A simple classification of APIs
Web service APIs
- SOAP
- XML-RPC and JSON-RPC
- REST
WebSocket APIs
Library-based APIs
- JavaScript
- TWAIN
Class-based APIs (object orientation)
- Java API
- Android API
OS functions and routines
- Access to file system
- Access to user interface
Object remoting APIs
- CORBA
- .NET
Remoting Hardware APIs
- Video acceleration
- Hard disk drives
- PCI buses
Webservices
A description of the communication methods allowed
• Requesting information
• Sending information
• Updating information
Webservices
Most often-used types of web service:
• SOAP
• XML-RPC
• JSON-RPC
• REST
Webservices
Most often-used types of web service:
• SOAP
• XML-RPC
• JSON-RPC
• REST
SOAP (Simple Object Access Protocol)
SOAP is a protocol that defines the communication method,
and the structure of the messages.
The data transfer format is XML.
A SOAP service publishes a definition of its interface in a
machine-readable document, using WSDL – Web Services
Definition Language.
XML-RPC
XML-RPC is an older protocol than SOAP. It uses a specific XML
format for data transfer, whereas SOAP allows a proprietary
XML format.
An XML-RPC call tends to be much simpler, and to use less
bandwidth, than a SOAP call. (SOAP is known to be “verbose”.)
SOAP and XML-RPC have different levels of support in various
libraries.
JSON-RPC
JSON-RPC is similar to XML-RPC, but uses JSON instead of
XML for data transfer.
REST (Representational state transfer)
REST is not a protocol, but rather a set of architectural
principles. The thing that differentiates a REST service from
other web services is its architecture. Some of the
characteristics required of a REST service include simplicity of
interfaces, identification of resources within the request, and
the ability to manipulate the resources via the interface. There
are a number of other, more fundamental architectural
requirements too.
REST Principles
It is these principles that characterize most of REST-based APIs
in use today:
• Precedence of the client-server relationship
• Requirement for stateless communication
• Implementation of cache constraints to engender efficiencies in network
communications
• Use of a uniform interface through standardized data elements such as
resources and representations
REST Principles
The common perception is that REST offers a lightweight alternative to
service-orientated mechanisms such as SOAP.
REST Principles
REST allows for the fine-grained control of objects through the use of
resources (expressed as URIs) that also allows for greater efficiency in
communications with the server (obviously important when implemented on
a mobile device).
XML and JSON
The growth of REST has been complemented by the increasing use of
JavaScript Object Notation (JSON) as the mechanism by which resources are
represented.
XML and JSON
Mobile apps driving the adoption of web APIs and the need for a compact
payloads over constrained communication links.
The consumption of web APIs by a web developer community and the
resonance of JSON-encoded data with this audience
XML and JSON
The use of JSON over XML is not a dichotomy. You will make design
decisions where you support one, both, or even other formats dependent on
the intended audience.
Layman terms
What is the difference between REST and SOAP?
Layman terms
What's the difference between MVC and HTTP?
Layman terms
MVC and REST are architectural patterns.
Layman terms
HTTP and SOAP are set of rules i.e. protocols.
Layman terms
In layman terms you are asking - What's the difference between a building
plan-map and building making process.
Layman terms
Building Plan map is deciding how you will place different things e.g.
Bathroom, dining room, doors, bed-room etc. in a particular geographical
area.
Layman terms
MVC is deciding how you will separate concerns regarding data, business
logic and controls.
Layman terms
REST is deciding how you will use different HTTP verbs to perform one of
CRUD operation on your data.
Layman terms
Building making process is following predefined steps like first create
foundation then walls and in the end go for roof.
Layman terms
HTTP is following predefined rules like you need to send request on port 80
which will consist of two parts: HTTP headers and HTTP body.
Layman terms
SOAP is following predefined set of rules how and where you can place
function to be called and various parameters to be passed in that function in
your XML SOAP request.
Layman terms
SOAP is rigid XML structure. XML is overwhelmed by data-size.
REST can use XML or JSON.
JSON is just key - value pairs.
Layman terms
Use SOAP:
1. when you have no other option provided by API exposer.
2. when your end user want to have only SOAP response.
3. Faster development. As tools Axis 2 and cxf exist. :)
Layman terms
Use REST(with JSON):
1. To have cleaner software architecture.
2. To save server resources (JSON is smaller to process).
3. To save network resources (JSON size is smaller than XML).
4. To save client side resources (JSON is much faster to parse).
RESTful API
http://social.yahooapis.com/v1/user/{guid}/profile
http://api.linkedin.com/v1/people/{guid}
RESTful API
<?xml version="1.0" encoding="UTF-8"?>
<person>
<id>111222</id>
<first-name>Jackson</first-name>
<last-name>Mafra</last-name>
<headline>Software Engineer</headline>
<connections total=”1776"> …
</person>
RESTful API
What’s Missing?
Ability to get exactly what you need (variety)
• If you need more, may require multiple API calls (if they exist)
• If you need less, resources are wasted
Consistency of responses (uniformity)
• “Same” object returned by different APIs may have different structure
• Once in production, hard to get consistent later
RESTful API
Multiple Calls to Get What You Need
Want to get user’s friend’s profile? Do this…
http://social.yahooapis.com/v1/user/123/connections
<connections yahoo:start="0" yahoo:count="1" yahoo:total="1">
<connection yahoo:uri="http://social.yahooapis.com/v1/user/123/connection/456? view=usercard">
<guid>456</guid>
<contactId>4</contactId>
</connection>
</connections>
RESTful API
Multiple Calls to Get What You Need
… then make second call to get friend’s profile:
http://social.yahooapis.com/v1/user/456/profile
<profile yahoo:uri="http://social.yahooapis.com/v1/user/456/profile">
<guid>456</guid>
<birthdate>3/3</birthdate>
<created>2008-08-4T17:13:56Z</created>
...
</profile>
- Latent, redundant data
- Optimization requires stickiness
RESTful API
Typical Solution
Variety versus Uniformity
- Solution: introduce another call
- Desire for variety of responses undermines uniformity of requests
- Leads to RPC-like REST APIs
- Many APIs + Great Documentation = Lots of Reading + Lack of Automation
RESTful API
Domain Model as Foundation
Sample Domain Model
/people : Person[] // collection of Person resources
/id : string // primary key
/name : string
/email : string // unique key
/photo : url
/best-friend : Person
/friends : Person[]
/jobs : Job[] // collection of Job resources
/company : Company
/title : string
/start-date : date
/end-date : date …
/companies : Company[]
/name : string
/ceo : Person
…
RESTful API
Domain Model as Foundation
Follow request URL to navigate through your model
To get a person’s profile: http://api.linkedin.com/v2/people/123
<person uri=“urn:linkedin:v2:people/123” key=“123”>
<id>123</id>
<name>Reid Hoffman</name>
<email>reid@linkedin.com</email>
<best-friend uri=“urn:linkedin:v2:people/456”/>
</person>
Conventional URL in request
Default representation in response
/people[/id=123]
/id
/name
/email
/photo
/best-friend
/friends
…
/jobs
/company
/title
/start-date
/end-date
…
/companies
/name
/ceo
…
RESTful API
Domain Model as Foundation
Fine-grained Request
What if you only need certain fields (e.g., name and photo)?
http://api.linkedin.com/v2/people/123:(name,photo)
<person>
<name>Reid Hoffman</name>
<photo>http://media.linkedin.com/photos/123.jpeg</photo>
</person> …
/people[/id=123]
/id
/name
/email
/photo
/best-friend
/friends
/jobs
/company
/title
/start-date
/end-date
…
RESTful API
Domain Model as Foundation
Fine-grained Request
To get names and photos of one’s friends and their best friends:
…/v2/people/456/friends:(name,photo,best-friend: (name,photo))
<friends total=“66” start=“0”>
<friend uri=“urn:linkedin:v2:people/123” key=“123”>
<name>Reid Hoffman</name>
<photo>http://media.linkedin.com/photos/123.jpeg</photo>
<best-friend uri=“urn:linkedin:v2:people/456” key=“456”>
<name>Brandon Duncan</name>
<photo>http://media.linkedin.com/photos/456.jpeg</photo>
</best-friend>
</friend>
<friend>…</friend>
</friends>
…
/people[/id=456]
/id
/name
/email
/photo
/best-friend
/friends
/123
/id
/name
/email
/photo
/best-friend
/name
/photo
/jobs
RESTful API
Domain Model as Foundation
Fine-grained Request
Allows client to construct custom calls
Better than digging for the closest matching API:
http://social...com/v1/user/123/profile
http://social...com/v1/user/123/profile/usercard
http://social...com/v1/user/123/profile/tinyusercard
Allows optimization on the backend
RESTful API
Domain Model as Foundation
Fine-grained Request
Benefits
- Provides a frame for both request and response semantics
- Still allows for flexible syntax
- Requests – path, query params, matrix params…
- Responses – JSON, XML…
- Helps to unify and automate many development tasks on both ends
- Request / response creation, parsing, marshalling
- Code (and documentation) generation
- Discovery services
RESTful API
Domain Model as Foundation
Fine-grained Request
Benefits
- Provides a frame for both request and response semantics
- Still allows for flexible syntax
- Requests – path, query params, matrix params…
- Responses – JSON, XML…
- Helps to unify and automate many development tasks on both ends
- Request / response creation, parsing, marshalling
- Code (and documentation) generation
- Discovery services
RESTful API
Examples of LinkedIn APIs HTTP GET - Read
…/people/email=brandon@gmail.com/friends?sort=name
…/people/123/friends;sort=name:(name,jobs;sort=start-date)
…/people:(id,name,photo)?name=page&company=google
…/people::(123,456)
…/people::(123,456):(name,photo)
RESTful API
Incentive System
• Multiple ways to get at the same data
• Partner can ask for exactly what they need
• Associate cost with resources, system of accounting creates incentives for
partners
• Throttling by resource rather than API
Thank you!
jacksonfdam@gmail.com
t
f
in
Email Socialmedia
@jacksonfdam
@mafra.jackson
@jacksonfdam

More Related Content

What's hot

ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesJean-Sebastien Delfino
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyJean-Sebastien Delfino
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingChristopher Pecoraro
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldGraham Weldon
 
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...webhostingguy
 
2021.laravelconf.tw.slides1
2021.laravelconf.tw.slides12021.laravelconf.tw.slides1
2021.laravelconf.tw.slides1LiviaLiaoFontech
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7Damien Seguy
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Shahrzad Peyman
 
Laravel 5 New Features
Laravel 5 New FeaturesLaravel 5 New Features
Laravel 5 New FeaturesJoe Ferguson
 
Asynchronous reading and writing http r equest
Asynchronous reading and writing http r equestAsynchronous reading and writing http r equest
Asynchronous reading and writing http r equestPragyanshis Patnaik
 
Have Some Rest Building Web2.0 Apps And Services
Have Some Rest   Building Web2.0 Apps And ServicesHave Some Rest   Building Web2.0 Apps And Services
Have Some Rest Building Web2.0 Apps And ServicesNenad Nikolic
 

What's hot (20)

ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA RuntimesApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
 
Cakephp
CakephpCakephp
Cakephp
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routing
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your world
 
PHP programmimg
PHP programmimgPHP programmimg
PHP programmimg
 
Intro to flask2
Intro to flask2Intro to flask2
Intro to flask2
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Cakephp manual-11
Cakephp manual-11Cakephp manual-11
Cakephp manual-11
 
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...Application Note APLX-LMW-0403: Interfacing the Apache Web ...
Application Note APLX-LMW-0403: Interfacing the Apache Web ...
 
Soap
SoapSoap
Soap
 
2021.laravelconf.tw.slides1
2021.laravelconf.tw.slides12021.laravelconf.tw.slides1
2021.laravelconf.tw.slides1
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
 
Laravel 5 New Features
Laravel 5 New FeaturesLaravel 5 New Features
Laravel 5 New Features
 
Asynchronous reading and writing http r equest
Asynchronous reading and writing http r equestAsynchronous reading and writing http r equest
Asynchronous reading and writing http r equest
 
Introduction to CakePHP
Introduction to CakePHPIntroduction to CakePHP
Introduction to CakePHP
 
Have Some Rest Building Web2.0 Apps And Services
Have Some Rest   Building Web2.0 Apps And ServicesHave Some Rest   Building Web2.0 Apps And Services
Have Some Rest Building Web2.0 Apps And Services
 
Swoole Love PHP
Swoole Love PHPSwoole Love PHP
Swoole Love PHP
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 

Viewers also liked

SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meeting
SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG MeetingSOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meeting
SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meetingjtreague
 
2015.07.17 新人報告(2)
2015.07.17 新人報告(2)2015.07.17 新人報告(2)
2015.07.17 新人報告(2)Chih-Wei Chuang
 
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...Stefan Bergstein
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTPradeep Kumar
 

Viewers also liked (8)

iKariera 2015
iKariera 2015iKariera 2015
iKariera 2015
 
SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meeting
SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG MeetingSOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meeting
SOA Monitoring & Administration Tips and Tricks - Spring 2014 FDUG Meeting
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
2015.07.17 新人報告(2)
2015.07.17 新人報告(2)2015.07.17 新人報告(2)
2015.07.17 新人報告(2)
 
Meet the expert
Meet the expertMeet the expert
Meet the expert
 
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...
Service Oriented Architectures (SOA) Monitoring and Management with HP OpenVi...
 
SOAP vs REST
SOAP vs RESTSOAP vs REST
SOAP vs REST
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 

Similar to High Performance APIs

Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Charlin Agramonte
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About RESTJeremy Brown
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About RESTMike Wilcox
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni InturiSreeni I
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Serverswebhostingguy
 
A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended VersionJeremy Brown
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Kevin Lee
 

Similar to High Performance APIs (20)

APIs enabling IoT
APIs enabling IoT APIs enabling IoT
APIs enabling IoT
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Unit 2
Unit 2Unit 2
Unit 2
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended Version
 
Day03 api
Day03   apiDay03   api
Day03 api
 
RIA Data and Security, 2007
RIA Data and Security, 2007RIA Data and Security, 2007
RIA Data and Security, 2007
 
WIT UNIT-5.pdf
WIT UNIT-5.pdfWIT UNIT-5.pdf
WIT UNIT-5.pdf
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
 

More from Jackson F. de A. Mafra

PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...
PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...
PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...Jackson F. de A. Mafra
 
Phprs meetup - deploys automatizados com gitlab
Phprs   meetup - deploys automatizados com gitlabPhprs   meetup - deploys automatizados com gitlab
Phprs meetup - deploys automatizados com gitlabJackson F. de A. Mafra
 
O que você precisa saber sobre chatbots
O que você precisa saber sobre chatbotsO que você precisa saber sobre chatbots
O que você precisa saber sobre chatbotsJackson F. de A. Mafra
 
WCPOA2019 - WordPress como um backend de seus aplicativos
WCPOA2019  - WordPress como um backend de seus aplicativosWCPOA2019  - WordPress como um backend de seus aplicativos
WCPOA2019 - WordPress como um backend de seus aplicativosJackson F. de A. Mafra
 
WordPress como um backend de seus aplicativos
WordPress como um backend de seus aplicativosWordPress como um backend de seus aplicativos
WordPress como um backend de seus aplicativosJackson F. de A. Mafra
 
The Ultimate Guide to Development in WordPress
The Ultimate Guide to Development in WordPressThe Ultimate Guide to Development in WordPress
The Ultimate Guide to Development in WordPressJackson F. de A. Mafra
 
Precisamos de um barco maior introdução ao dimensionamento de aplicações
Precisamos de um barco maior introdução ao dimensionamento de aplicaçõesPrecisamos de um barco maior introdução ao dimensionamento de aplicações
Precisamos de um barco maior introdução ao dimensionamento de aplicaçõesJackson F. de A. Mafra
 
Hangout Tempo Real Eventos - ChatOps (ChatBots e DevOps) - Como bots podem ...
Hangout  Tempo Real Eventos - ChatOps (ChatBots e DevOps)  - Como bots podem ...Hangout  Tempo Real Eventos - ChatOps (ChatBots e DevOps)  - Como bots podem ...
Hangout Tempo Real Eventos - ChatOps (ChatBots e DevOps) - Como bots podem ...Jackson F. de A. Mafra
 
Hangout Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...
Hangout  Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...Hangout  Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...
Hangout Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...Jackson F. de A. Mafra
 
Hangout Tempo Real Eventos - Javascript - Os Primeiros Passos
Hangout  Tempo Real Eventos - Javascript - Os Primeiros PassosHangout  Tempo Real Eventos - Javascript - Os Primeiros Passos
Hangout Tempo Real Eventos - Javascript - Os Primeiros PassosJackson F. de A. Mafra
 
Hangout Tempo Real Eventos - Nodejs - Os Primeiros Passos
Hangout  Tempo Real Eventos - Nodejs - Os Primeiros PassosHangout  Tempo Real Eventos - Nodejs - Os Primeiros Passos
Hangout Tempo Real Eventos - Nodejs - Os Primeiros PassosJackson F. de A. Mafra
 
Conexao kinghost - Vendas inteligentes com intelibots
Conexao kinghost - Vendas inteligentes com intelibotsConexao kinghost - Vendas inteligentes com intelibots
Conexao kinghost - Vendas inteligentes com intelibotsJackson F. de A. Mafra
 
TDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensTDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensJackson F. de A. Mafra
 

More from Jackson F. de A. Mafra (20)

PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...
PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...
PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...
 
PHP SSO no Zentyal
PHP SSO no ZentyalPHP SSO no Zentyal
PHP SSO no Zentyal
 
Phprs meetup - deploys automatizados com gitlab
Phprs   meetup - deploys automatizados com gitlabPhprs   meetup - deploys automatizados com gitlab
Phprs meetup - deploys automatizados com gitlab
 
O que você precisa saber sobre chatbots
O que você precisa saber sobre chatbotsO que você precisa saber sobre chatbots
O que você precisa saber sobre chatbots
 
WCPOA2019 - WordPress como um backend de seus aplicativos
WCPOA2019  - WordPress como um backend de seus aplicativosWCPOA2019  - WordPress como um backend de seus aplicativos
WCPOA2019 - WordPress como um backend de seus aplicativos
 
WordPress como um backend de seus aplicativos
WordPress como um backend de seus aplicativosWordPress como um backend de seus aplicativos
WordPress como um backend de seus aplicativos
 
The Ultimate Guide to Development in WordPress
The Ultimate Guide to Development in WordPressThe Ultimate Guide to Development in WordPress
The Ultimate Guide to Development in WordPress
 
Precisamos de um barco maior introdução ao dimensionamento de aplicações
Precisamos de um barco maior introdução ao dimensionamento de aplicaçõesPrecisamos de um barco maior introdução ao dimensionamento de aplicações
Precisamos de um barco maior introdução ao dimensionamento de aplicações
 
Hangout Tempo Real Eventos - ChatOps (ChatBots e DevOps) - Como bots podem ...
Hangout  Tempo Real Eventos - ChatOps (ChatBots e DevOps)  - Como bots podem ...Hangout  Tempo Real Eventos - ChatOps (ChatBots e DevOps)  - Como bots podem ...
Hangout Tempo Real Eventos - ChatOps (ChatBots e DevOps) - Como bots podem ...
 
Hangout Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...
Hangout  Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...Hangout  Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...
Hangout Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...
 
Hangout Tempo Real Eventos - Javascript - Os Primeiros Passos
Hangout  Tempo Real Eventos - Javascript - Os Primeiros PassosHangout  Tempo Real Eventos - Javascript - Os Primeiros Passos
Hangout Tempo Real Eventos - Javascript - Os Primeiros Passos
 
Hangout Tempo Real Eventos - Nodejs - Os Primeiros Passos
Hangout  Tempo Real Eventos - Nodejs - Os Primeiros PassosHangout  Tempo Real Eventos - Nodejs - Os Primeiros Passos
Hangout Tempo Real Eventos - Nodejs - Os Primeiros Passos
 
Desmistificando o DialogFlow
Desmistificando o DialogFlowDesmistificando o DialogFlow
Desmistificando o DialogFlow
 
ChatOps (ChatBots + DevOps)
ChatOps (ChatBots + DevOps) ChatOps (ChatBots + DevOps)
ChatOps (ChatBots + DevOps)
 
Conexao kinghost - Vendas inteligentes com intelibots
Conexao kinghost - Vendas inteligentes com intelibotsConexao kinghost - Vendas inteligentes com intelibots
Conexao kinghost - Vendas inteligentes com intelibots
 
Dev Heroes
Dev HeroesDev Heroes
Dev Heroes
 
Trilha Android - Android Evolved
Trilha Android - Android EvolvedTrilha Android - Android Evolved
Trilha Android - Android Evolved
 
TDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensTDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit Happens
 
Material design
Material designMaterial design
Material design
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 

Recently uploaded

Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 

High Performance APIs

  • 3. APIs: Windows To The Code In the simplest terms, APIs are sets of requirements that govern how one application can talk to another.
  • 4. APIs: Windows To The Code APIs do all this by exposing some of a program's internal functions to the outside world in a limited fashion.
  • 5. API Analogy Every time you want to access a set of data from an application, you have to call the API. But there is only a certain amount of data the application will let you access, so you have to communicate to the operator in a very specific language—a language unique to each application.
  • 7. A simple classification of APIs Web service APIs - SOAP - XML-RPC and JSON-RPC - REST WebSocket APIs Library-based APIs - JavaScript - TWAIN Class-based APIs (object orientation) - Java API - Android API OS functions and routines - Access to file system - Access to user interface Object remoting APIs - CORBA - .NET Remoting Hardware APIs - Video acceleration - Hard disk drives - PCI buses
  • 8. Webservices A description of the communication methods allowed • Requesting information • Sending information • Updating information
  • 9. Webservices Most often-used types of web service: • SOAP • XML-RPC • JSON-RPC • REST
  • 10. Webservices Most often-used types of web service: • SOAP • XML-RPC • JSON-RPC • REST
  • 11. SOAP (Simple Object Access Protocol) SOAP is a protocol that defines the communication method, and the structure of the messages. The data transfer format is XML. A SOAP service publishes a definition of its interface in a machine-readable document, using WSDL – Web Services Definition Language.
  • 12. XML-RPC XML-RPC is an older protocol than SOAP. It uses a specific XML format for data transfer, whereas SOAP allows a proprietary XML format. An XML-RPC call tends to be much simpler, and to use less bandwidth, than a SOAP call. (SOAP is known to be “verbose”.) SOAP and XML-RPC have different levels of support in various libraries.
  • 13. JSON-RPC JSON-RPC is similar to XML-RPC, but uses JSON instead of XML for data transfer.
  • 14. REST (Representational state transfer) REST is not a protocol, but rather a set of architectural principles. The thing that differentiates a REST service from other web services is its architecture. Some of the characteristics required of a REST service include simplicity of interfaces, identification of resources within the request, and the ability to manipulate the resources via the interface. There are a number of other, more fundamental architectural requirements too.
  • 15. REST Principles It is these principles that characterize most of REST-based APIs in use today: • Precedence of the client-server relationship • Requirement for stateless communication • Implementation of cache constraints to engender efficiencies in network communications • Use of a uniform interface through standardized data elements such as resources and representations
  • 16. REST Principles The common perception is that REST offers a lightweight alternative to service-orientated mechanisms such as SOAP.
  • 17. REST Principles REST allows for the fine-grained control of objects through the use of resources (expressed as URIs) that also allows for greater efficiency in communications with the server (obviously important when implemented on a mobile device).
  • 18. XML and JSON The growth of REST has been complemented by the increasing use of JavaScript Object Notation (JSON) as the mechanism by which resources are represented.
  • 19. XML and JSON Mobile apps driving the adoption of web APIs and the need for a compact payloads over constrained communication links. The consumption of web APIs by a web developer community and the resonance of JSON-encoded data with this audience
  • 20. XML and JSON The use of JSON over XML is not a dichotomy. You will make design decisions where you support one, both, or even other formats dependent on the intended audience.
  • 21. Layman terms What is the difference between REST and SOAP?
  • 22. Layman terms What's the difference between MVC and HTTP?
  • 23. Layman terms MVC and REST are architectural patterns.
  • 24. Layman terms HTTP and SOAP are set of rules i.e. protocols.
  • 25. Layman terms In layman terms you are asking - What's the difference between a building plan-map and building making process.
  • 26. Layman terms Building Plan map is deciding how you will place different things e.g. Bathroom, dining room, doors, bed-room etc. in a particular geographical area.
  • 27. Layman terms MVC is deciding how you will separate concerns regarding data, business logic and controls.
  • 28. Layman terms REST is deciding how you will use different HTTP verbs to perform one of CRUD operation on your data.
  • 29. Layman terms Building making process is following predefined steps like first create foundation then walls and in the end go for roof.
  • 30. Layman terms HTTP is following predefined rules like you need to send request on port 80 which will consist of two parts: HTTP headers and HTTP body.
  • 31. Layman terms SOAP is following predefined set of rules how and where you can place function to be called and various parameters to be passed in that function in your XML SOAP request.
  • 32. Layman terms SOAP is rigid XML structure. XML is overwhelmed by data-size. REST can use XML or JSON. JSON is just key - value pairs.
  • 33. Layman terms Use SOAP: 1. when you have no other option provided by API exposer. 2. when your end user want to have only SOAP response. 3. Faster development. As tools Axis 2 and cxf exist. :)
  • 34. Layman terms Use REST(with JSON): 1. To have cleaner software architecture. 2. To save server resources (JSON is smaller to process). 3. To save network resources (JSON size is smaller than XML). 4. To save client side resources (JSON is much faster to parse).
  • 36. RESTful API <?xml version="1.0" encoding="UTF-8"?> <person> <id>111222</id> <first-name>Jackson</first-name> <last-name>Mafra</last-name> <headline>Software Engineer</headline> <connections total=”1776"> … </person>
  • 37. RESTful API What’s Missing? Ability to get exactly what you need (variety) • If you need more, may require multiple API calls (if they exist) • If you need less, resources are wasted Consistency of responses (uniformity) • “Same” object returned by different APIs may have different structure • Once in production, hard to get consistent later
  • 38. RESTful API Multiple Calls to Get What You Need Want to get user’s friend’s profile? Do this… http://social.yahooapis.com/v1/user/123/connections <connections yahoo:start="0" yahoo:count="1" yahoo:total="1"> <connection yahoo:uri="http://social.yahooapis.com/v1/user/123/connection/456? view=usercard"> <guid>456</guid> <contactId>4</contactId> </connection> </connections>
  • 39. RESTful API Multiple Calls to Get What You Need … then make second call to get friend’s profile: http://social.yahooapis.com/v1/user/456/profile <profile yahoo:uri="http://social.yahooapis.com/v1/user/456/profile"> <guid>456</guid> <birthdate>3/3</birthdate> <created>2008-08-4T17:13:56Z</created> ... </profile> - Latent, redundant data - Optimization requires stickiness
  • 40. RESTful API Typical Solution Variety versus Uniformity - Solution: introduce another call - Desire for variety of responses undermines uniformity of requests - Leads to RPC-like REST APIs - Many APIs + Great Documentation = Lots of Reading + Lack of Automation
  • 41. RESTful API Domain Model as Foundation Sample Domain Model /people : Person[] // collection of Person resources /id : string // primary key /name : string /email : string // unique key /photo : url /best-friend : Person /friends : Person[] /jobs : Job[] // collection of Job resources /company : Company /title : string /start-date : date /end-date : date … /companies : Company[] /name : string /ceo : Person …
  • 42. RESTful API Domain Model as Foundation Follow request URL to navigate through your model To get a person’s profile: http://api.linkedin.com/v2/people/123 <person uri=“urn:linkedin:v2:people/123” key=“123”> <id>123</id> <name>Reid Hoffman</name> <email>reid@linkedin.com</email> <best-friend uri=“urn:linkedin:v2:people/456”/> </person> Conventional URL in request Default representation in response /people[/id=123] /id /name /email /photo /best-friend /friends … /jobs /company /title /start-date /end-date … /companies /name /ceo …
  • 43. RESTful API Domain Model as Foundation Fine-grained Request What if you only need certain fields (e.g., name and photo)? http://api.linkedin.com/v2/people/123:(name,photo) <person> <name>Reid Hoffman</name> <photo>http://media.linkedin.com/photos/123.jpeg</photo> </person> … /people[/id=123] /id /name /email /photo /best-friend /friends /jobs /company /title /start-date /end-date …
  • 44. RESTful API Domain Model as Foundation Fine-grained Request To get names and photos of one’s friends and their best friends: …/v2/people/456/friends:(name,photo,best-friend: (name,photo)) <friends total=“66” start=“0”> <friend uri=“urn:linkedin:v2:people/123” key=“123”> <name>Reid Hoffman</name> <photo>http://media.linkedin.com/photos/123.jpeg</photo> <best-friend uri=“urn:linkedin:v2:people/456” key=“456”> <name>Brandon Duncan</name> <photo>http://media.linkedin.com/photos/456.jpeg</photo> </best-friend> </friend> <friend>…</friend> </friends> … /people[/id=456] /id /name /email /photo /best-friend /friends /123 /id /name /email /photo /best-friend /name /photo /jobs
  • 45. RESTful API Domain Model as Foundation Fine-grained Request Allows client to construct custom calls Better than digging for the closest matching API: http://social...com/v1/user/123/profile http://social...com/v1/user/123/profile/usercard http://social...com/v1/user/123/profile/tinyusercard Allows optimization on the backend
  • 46. RESTful API Domain Model as Foundation Fine-grained Request Benefits - Provides a frame for both request and response semantics - Still allows for flexible syntax - Requests – path, query params, matrix params… - Responses – JSON, XML… - Helps to unify and automate many development tasks on both ends - Request / response creation, parsing, marshalling - Code (and documentation) generation - Discovery services
  • 47. RESTful API Domain Model as Foundation Fine-grained Request Benefits - Provides a frame for both request and response semantics - Still allows for flexible syntax - Requests – path, query params, matrix params… - Responses – JSON, XML… - Helps to unify and automate many development tasks on both ends - Request / response creation, parsing, marshalling - Code (and documentation) generation - Discovery services
  • 48. RESTful API Examples of LinkedIn APIs HTTP GET - Read …/people/email=brandon@gmail.com/friends?sort=name …/people/123/friends;sort=name:(name,jobs;sort=start-date) …/people:(id,name,photo)?name=page&company=google …/people::(123,456) …/people::(123,456):(name,photo)
  • 49. RESTful API Incentive System • Multiple ways to get at the same data • Partner can ask for exactly what they need • Associate cost with resources, system of accounting creates incentives for partners • Throttling by resource rather than API

Editor's Notes

  1. Building plan-map – Planta Baixa