SlideShare a Scribd company logo
1 of 17
Mobile APIs In Practice
November 2013
Tyler Singletary, Director of Platform
tyler@klout.com ; @harmophone
When Klout Started Thinking Mobile
Klout’s Partner API in
2010-2011:

Klout’s API Strategy in
2012+:

• Not Mobile Optimized
• Not Used on Klout.com
• Not Extensible.
• XML and JSON response
• No Mobile Web Experience
• Easy Data in 1 Call

• Acquired Blockboard
• Redesigned Central API
• Entitlement System for
Klout.com, Mobile, Partners
• Mobile Web
• JSON Only
• Easy Data in 2 Calls for
Partners

2
Tradeoffs at Klout
•

•

•

We redesigned APIs for
Klout.com and our 1stparty mobile App first.
The Partner API drove
some of the
requirements, but always
would be based on the
Master API (with hidden
data)
The Mobile API payloads
are optimized for mobile
and its specific functions.

Partner API
• Crowdsourced
Mobile Apps
• CRM, Enterprise
• Consumer

Master
API
Mobile API
• Official Klout App
• Cinch

Klout.com
• Mobile Klout.com

3
Klout Mobile

All data in one
payload.

{
response: {
user: {
kloutId: "478569",
nick: "harmophone",
name: {
firstName: "devty",
lastName: "T"
},
image: {
network: {
identifier: "tw",
number: 1
},
urlTiny:
"http://a0.twimg.com/profile_images/23083
33289/7s7abq8j02kuxf84g7ig_normal.jpeg",
urlSmall:
"http://a0.twimg.com/profile_images/23083
33289/7s7abq8j02kuxf84g7ig_reasonably_s
mall.jpeg",
urlMedium:
"http://a0.twimg.com/profile_images/23083
33289/7s7abq8j02kuxf84g7ig_reasonably_s
mall.jpeg",
urlLarge:
"http://a0.twimg.com/profile_images/23083
33289/7s7abq8j02kuxf84g7ig.jpeg",
networkImage:
"http://a0.twimg.com/profile_images/23083
33289/7s7abq8j02kuxf84g7ig_normal.jpeg"
},

bio: "Adagio assai. Klout Devangelist.",
bioSource: "tw",
score: {
score: 47.620975824983596,
trueReach: 537
},
scoreDeltas: {
dayChange: -0.16153993062354743,
weekChange: -0.5384216786696854,
monthChange: -1.8510836286192287
},
connectedNetworks: [
{
id: “",
network: "tw"
}
],
hasMobile: true
},
topics: […],
sourceOfInfluence: {
myInfluencers: […],
myInfluencees: […],
},
preferences: {},
scoreHistory: {},
stats: { },
networkContributions: { }
},
responseTime: 44
}

4
Klout’s Cinch APIs

View-oriented
payloads

5
What We Should Have Done
•

•

We should have branched another
“Mobile Partner API” to ease in partner
development of mobile apps utilizing
our API.
November 2013 Update:
– We still haven’t done this. :(

Partner API
• CRM, Enterprise
• Consumer

Klout.com

Master
API

Mobile API
• Official Klout App
• Cinch

Mobile Partner
API
• Appboy

6
Division of Labor
Server

Client/App

• Talks to all external
APIs
• Proxy and repackage
content exactly how
the app needs it
• Truth

• Talks only to
Server, except for
auth (but even
then…)
• Temporary storage for
UX and rendering
• Maybe Truth
7
Problems With Any API in Mobile
Data transfer rate is typically
slower

Delivering data to a device
costs the consumer money

Any one or more requests
can fail. And will.

Apps collecting from multiple
sources will be slow.
Latency.

Device diversity, processing
power, multitasking, storage

Mobile development has a
slower cycle due to App
Publishing

APIs Change. Apps change.
Not always in sync.

8
The Main Conflict
Larger
Data
Payload

• Quick bursts of dense
information
• Just the facts
• But extensible

Less
Requests
9
How Do You Protect Against These?
Remove
extraneous
data

Deliver large
payloads, fewe
r requests

Try, try, again.
But not too
much.

Real work
should be done
on the server

Graceful
Degregation
10
Failure is Routine. Plan for it.

Requests
User
Detail
Twitter Stream

Server

User
Detail
Twitter Stream

App – 3G
User
Deta--------------tream

It’s a race against time!

11
The Problem With SOAP
•
•
•
•

Tons of Extraneous Data.
Big payload.
Processing response holds UI latency.
Out of fashion for big data, social, web at
large.

The Good:
• Type safety!
• Fast Infoset standard. “The GZIP for
XML!”
12
The Problem With REST and JSON
•
•
•
•
•

Resource collections and objects aren’t always best
Non-optimized APIs require tons of individual requests
Various interpretations of what REST is and isn’t
Error Handling gets weird with arrays/collections and mobile nuance
While not strictly part of REST, typically JSON.

13
Best Practices
• Envelopes are an essential way to control and react to change, impress an
update.
• Default to POST and PUT with arrays, even for single record updates.
• Reference both URLs to resources as well as content_ids
• GZIP or compress responses whenever possible
• OAuth/xAuth for authentication. Don’t roll your own.
• Return collections with reasonable limits. Employ params or headers.
• Version on a per-endpoint basis. Adopt easy, programmatic versioning.
• Clients should identify themselves thoroughly. Version, platform, etc. It’s
shipped software. The API needs to know who it’s talking to.
• Be able to specify a “critical read” -> indicating acceptance of longer latency
or bypassing cache responses

14
Just one more thing… (about errors)
• Use HTTP status when appropriate
• Server-side errors need clarity and extensibility, like exceptions.
– Utilize custom schemes (-10, -11, etc.)
– Use 500-504, but provide codified directive error messages inside.

• Require server to return a handshake at the end of Writes: in addition to
positive status codes, return a positive ACK that a server handled the write.
• Potential Standards: vnd.error : https://github.com/blongden/vnd.error

15
Summary
Master API -> Partner API
Mobile API, Mobile Partner API

Design for Mobile APIs:
• both internal and external

Mobile payloads:
• data rich, extensible, lean on the
DDL and extras. Low # of calls.
{

Mobile Envelope:
• should become a standard way of
change management

"response":{},
"responseTime":26,
"interstitial":{
"url": "http://m.klout.com/upgrade",
}
}
16
Mobile APIs In Practice
November 2013
Tyler Singletary, Director of Platform
tyler@klout.com ; @harmophone

More Related Content

What's hot

Business Applications Integration In The Cloud
Business Applications Integration In The CloudBusiness Applications Integration In The Cloud
Business Applications Integration In The CloudAnna Brzezińska
 
Developing Mobile Applications for iOS and Android the Oracle way
Developing Mobile Applications for iOS and Android the Oracle wayDeveloping Mobile Applications for iOS and Android the Oracle way
Developing Mobile Applications for iOS and Android the Oracle wayToronto-Oracle-Users-Group
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013SharePointRadi
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople
 
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...Sencha
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersChris O'Brien
 
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...Sencha
 
API design principles for accelerated development
API design principles for accelerated developmentAPI design principles for accelerated development
API design principles for accelerated developmentJonathan LeBlanc
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemMitch Colleran
 
Restful api design
Restful api designRestful api design
Restful api designMizan Riqzia
 
Replicating One Billion Records with Minimal API Usage
Replicating One Billion Records with Minimal API UsageReplicating One Billion Records with Minimal API Usage
Replicating One Billion Records with Minimal API UsageSalesforce Developers
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredJason Himmelstein
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Railshasan2000
 
Patrick Debois - From Serverless to Servicefull
Patrick Debois - From Serverless to ServicefullPatrick Debois - From Serverless to Servicefull
Patrick Debois - From Serverless to ServicefullServerlessConf
 
RESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web APIRESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web API💻 Spencer Schneidenbach
 

What's hot (20)

Business Applications Integration In The Cloud
Business Applications Integration In The CloudBusiness Applications Integration In The Cloud
Business Applications Integration In The Cloud
 
Developing Mobile Applications for iOS and Android the Oracle way
Developing Mobile Applications for iOS and Android the Oracle wayDeveloping Mobile Applications for iOS and Android the Oracle way
Developing Mobile Applications for iOS and Android the Oracle way
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
 
Huge: Running an API at Scale
Huge: Running an API at ScaleHuge: Running an API at Scale
Huge: Running an API at Scale
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
 
API ARU-ARU
API ARU-ARUAPI ARU-ARU
API ARU-ARU
 
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
 
Realm 研究
Realm 研究Realm 研究
Realm 研究
 
API design principles for accelerated development
API design principles for accelerated developmentAPI design principles for accelerated development
API design principles for accelerated development
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API Ecosystem
 
Restful api design
Restful api designRestful api design
Restful api design
 
Replicating One Billion Records with Minimal API Usage
Replicating One Billion Records with Minimal API UsageReplicating One Billion Records with Minimal API Usage
Replicating One Billion Records with Minimal API Usage
 
Building real-time-collaborative-web-applications
Building real-time-collaborative-web-applicationsBuilding real-time-collaborative-web-applications
Building real-time-collaborative-web-applications
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot Remastered
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Patrick Debois - From Serverless to Servicefull
Patrick Debois - From Serverless to ServicefullPatrick Debois - From Serverless to Servicefull
Patrick Debois - From Serverless to Servicefull
 
RESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web APIRESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web API
 

Similar to Mobile APIs In Practice: Designing for Performance and Reliability

Building A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryBuilding A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryProgrammableWeb
 
Mobile First (or maybe second) API Development
Mobile First (or maybe second) API DevelopmentMobile First (or maybe second) API Development
Mobile First (or maybe second) API DevelopmentTyler Singletary
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile appsMugunth Kumar
 
Architectural considerations when building an API
Architectural considerations when building an APIArchitectural considerations when building an API
Architectural considerations when building an APIRod Hemphill
 
WSO2Con US 2013 - Connected Business - making it happen
WSO2Con US 2013 - Connected Business - making it happenWSO2Con US 2013 - Connected Business - making it happen
WSO2Con US 2013 - Connected Business - making it happenWSO2
 
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...MongoDB
 
App_Engine_PPT..........................
App_Engine_PPT..........................App_Engine_PPT..........................
App_Engine_PPT..........................HassamShahid2
 
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveAPI Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveNiall Roche
 
The New IT - Your Milestone Plan
The New IT - Your Milestone Plan The New IT - Your Milestone Plan
The New IT - Your Milestone Plan WSO2
 
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ ApigeeAPI Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ ApigeeAnil Sagar
 
REST and REST-fulness
REST and REST-fulnessREST and REST-fulness
REST and REST-fulnessDavid Waite
 
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...NITHIN S.S
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1Kay Kim
 
Google Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductGoogle Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductSergey Smetanin
 

Similar to Mobile APIs In Practice: Designing for Performance and Reliability (20)

Building A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryBuilding A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
 
Mobile First (or maybe second) API Development
Mobile First (or maybe second) API DevelopmentMobile First (or maybe second) API Development
Mobile First (or maybe second) API Development
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile apps
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Architectural considerations when building an API
Architectural considerations when building an APIArchitectural considerations when building an API
Architectural considerations when building an API
 
WSO2Con US 2013 - Connected Business - making it happen
WSO2Con US 2013 - Connected Business - making it happenWSO2Con US 2013 - Connected Business - making it happen
WSO2Con US 2013 - Connected Business - making it happen
 
Anypoint Data Graphs
Anypoint Data GraphsAnypoint Data Graphs
Anypoint Data Graphs
 
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
 
App_Engine_PPT.ppt
App_Engine_PPT.pptApp_Engine_PPT.ppt
App_Engine_PPT.ppt
 
App_Engine_PPT.ppt
App_Engine_PPT.pptApp_Engine_PPT.ppt
App_Engine_PPT.ppt
 
App_Engine_PPT.ppt
App_Engine_PPT.pptApp_Engine_PPT.ppt
App_Engine_PPT.ppt
 
App_Engine_PPT..........................
App_Engine_PPT..........................App_Engine_PPT..........................
App_Engine_PPT..........................
 
REST APIs
REST APIsREST APIs
REST APIs
 
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveAPI Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
 
The New IT - Your Milestone Plan
The New IT - Your Milestone Plan The New IT - Your Milestone Plan
The New IT - Your Milestone Plan
 
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ ApigeeAPI Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
 
REST and REST-fulness
REST and REST-fulnessREST and REST-fulness
REST and REST-fulness
 
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1
 
Google Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductGoogle Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your Product
 

More from Tyler Singletary

APIs as a Venture Capital Model
APIs as a Venture Capital ModelAPIs as a Venture Capital Model
APIs as a Venture Capital ModelTyler Singletary
 
APIs are for humans (defrag-con)
APIs are for humans   (defrag-con)APIs are for humans   (defrag-con)
APIs are for humans (defrag-con)Tyler Singletary
 
Klout as an Example Application of Topics-oriented NLP APIs
Klout as an Example Application of Topics-oriented NLP APIsKlout as an Example Application of Topics-oriented NLP APIs
Klout as an Example Application of Topics-oriented NLP APIsTyler Singletary
 
Ouroburos As A Service - Klout
Ouroburos As A Service - KloutOuroburos As A Service - Klout
Ouroburos As A Service - KloutTyler Singletary
 
Big Data - Small Print (proposal version)
Big Data - Small Print (proposal version)Big Data - Small Print (proposal version)
Big Data - Small Print (proposal version)Tyler Singletary
 

More from Tyler Singletary (7)

HOWTO: Shut It Down
HOWTO: Shut It DownHOWTO: Shut It Down
HOWTO: Shut It Down
 
APIs as a Venture Capital Model
APIs as a Venture Capital ModelAPIs as a Venture Capital Model
APIs as a Venture Capital Model
 
APIs are for humans (defrag-con)
APIs are for humans   (defrag-con)APIs are for humans   (defrag-con)
APIs are for humans (defrag-con)
 
Klout as an Example Application of Topics-oriented NLP APIs
Klout as an Example Application of Topics-oriented NLP APIsKlout as an Example Application of Topics-oriented NLP APIs
Klout as an Example Application of Topics-oriented NLP APIs
 
Ouroburos As A Service - Klout
Ouroburos As A Service - KloutOuroburos As A Service - Klout
Ouroburos As A Service - Klout
 
Big data; small print.
Big data; small print.Big data; small print.
Big data; small print.
 
Big Data - Small Print (proposal version)
Big Data - Small Print (proposal version)Big Data - Small Print (proposal version)
Big Data - Small Print (proposal version)
 

Recently uploaded

Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Recently uploaded (20)

Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Mobile APIs In Practice: Designing for Performance and Reliability

  • 1. Mobile APIs In Practice November 2013 Tyler Singletary, Director of Platform tyler@klout.com ; @harmophone
  • 2. When Klout Started Thinking Mobile Klout’s Partner API in 2010-2011: Klout’s API Strategy in 2012+: • Not Mobile Optimized • Not Used on Klout.com • Not Extensible. • XML and JSON response • No Mobile Web Experience • Easy Data in 1 Call • Acquired Blockboard • Redesigned Central API • Entitlement System for Klout.com, Mobile, Partners • Mobile Web • JSON Only • Easy Data in 2 Calls for Partners 2
  • 3. Tradeoffs at Klout • • • We redesigned APIs for Klout.com and our 1stparty mobile App first. The Partner API drove some of the requirements, but always would be based on the Master API (with hidden data) The Mobile API payloads are optimized for mobile and its specific functions. Partner API • Crowdsourced Mobile Apps • CRM, Enterprise • Consumer Master API Mobile API • Official Klout App • Cinch Klout.com • Mobile Klout.com 3
  • 4. Klout Mobile All data in one payload. { response: { user: { kloutId: "478569", nick: "harmophone", name: { firstName: "devty", lastName: "T" }, image: { network: { identifier: "tw", number: 1 }, urlTiny: "http://a0.twimg.com/profile_images/23083 33289/7s7abq8j02kuxf84g7ig_normal.jpeg", urlSmall: "http://a0.twimg.com/profile_images/23083 33289/7s7abq8j02kuxf84g7ig_reasonably_s mall.jpeg", urlMedium: "http://a0.twimg.com/profile_images/23083 33289/7s7abq8j02kuxf84g7ig_reasonably_s mall.jpeg", urlLarge: "http://a0.twimg.com/profile_images/23083 33289/7s7abq8j02kuxf84g7ig.jpeg", networkImage: "http://a0.twimg.com/profile_images/23083 33289/7s7abq8j02kuxf84g7ig_normal.jpeg" }, bio: "Adagio assai. Klout Devangelist.", bioSource: "tw", score: { score: 47.620975824983596, trueReach: 537 }, scoreDeltas: { dayChange: -0.16153993062354743, weekChange: -0.5384216786696854, monthChange: -1.8510836286192287 }, connectedNetworks: [ { id: “", network: "tw" } ], hasMobile: true }, topics: […], sourceOfInfluence: { myInfluencers: […], myInfluencees: […], }, preferences: {}, scoreHistory: {}, stats: { }, networkContributions: { } }, responseTime: 44 } 4
  • 6. What We Should Have Done • • We should have branched another “Mobile Partner API” to ease in partner development of mobile apps utilizing our API. November 2013 Update: – We still haven’t done this. :( Partner API • CRM, Enterprise • Consumer Klout.com Master API Mobile API • Official Klout App • Cinch Mobile Partner API • Appboy 6
  • 7. Division of Labor Server Client/App • Talks to all external APIs • Proxy and repackage content exactly how the app needs it • Truth • Talks only to Server, except for auth (but even then…) • Temporary storage for UX and rendering • Maybe Truth 7
  • 8. Problems With Any API in Mobile Data transfer rate is typically slower Delivering data to a device costs the consumer money Any one or more requests can fail. And will. Apps collecting from multiple sources will be slow. Latency. Device diversity, processing power, multitasking, storage Mobile development has a slower cycle due to App Publishing APIs Change. Apps change. Not always in sync. 8
  • 9. The Main Conflict Larger Data Payload • Quick bursts of dense information • Just the facts • But extensible Less Requests 9
  • 10. How Do You Protect Against These? Remove extraneous data Deliver large payloads, fewe r requests Try, try, again. But not too much. Real work should be done on the server Graceful Degregation 10
  • 11. Failure is Routine. Plan for it. Requests User Detail Twitter Stream Server User Detail Twitter Stream App – 3G User Deta--------------tream It’s a race against time! 11
  • 12. The Problem With SOAP • • • • Tons of Extraneous Data. Big payload. Processing response holds UI latency. Out of fashion for big data, social, web at large. The Good: • Type safety! • Fast Infoset standard. “The GZIP for XML!” 12
  • 13. The Problem With REST and JSON • • • • • Resource collections and objects aren’t always best Non-optimized APIs require tons of individual requests Various interpretations of what REST is and isn’t Error Handling gets weird with arrays/collections and mobile nuance While not strictly part of REST, typically JSON. 13
  • 14. Best Practices • Envelopes are an essential way to control and react to change, impress an update. • Default to POST and PUT with arrays, even for single record updates. • Reference both URLs to resources as well as content_ids • GZIP or compress responses whenever possible • OAuth/xAuth for authentication. Don’t roll your own. • Return collections with reasonable limits. Employ params or headers. • Version on a per-endpoint basis. Adopt easy, programmatic versioning. • Clients should identify themselves thoroughly. Version, platform, etc. It’s shipped software. The API needs to know who it’s talking to. • Be able to specify a “critical read” -> indicating acceptance of longer latency or bypassing cache responses 14
  • 15. Just one more thing… (about errors) • Use HTTP status when appropriate • Server-side errors need clarity and extensibility, like exceptions. – Utilize custom schemes (-10, -11, etc.) – Use 500-504, but provide codified directive error messages inside. • Require server to return a handshake at the end of Writes: in addition to positive status codes, return a positive ACK that a server handled the write. • Potential Standards: vnd.error : https://github.com/blongden/vnd.error 15
  • 16. Summary Master API -> Partner API Mobile API, Mobile Partner API Design for Mobile APIs: • both internal and external Mobile payloads: • data rich, extensible, lean on the DDL and extras. Low # of calls. { Mobile Envelope: • should become a standard way of change management "response":{}, "responseTime":26, "interstitial":{ "url": "http://m.klout.com/upgrade", } } 16
  • 17. Mobile APIs In Practice November 2013 Tyler Singletary, Director of Platform tyler@klout.com ; @harmophone

Editor's Notes

  1. A Note On My Perspective:Klout builds consumer experiences. We measure influence on social networks.I manage all partner relations in regards to data in and out, as well as managed the development of our new API and how it was divided for Mobile.My experience is primarily in this context.
  2. We broke one cardinal rule for easily getting to data on Mobile: we made it require two calls. Our data model shifted from being keyed off of Twitter to being keyed off of internal Ids.Internal IDs are translated from social services, like Twitter, Google+, etc.Data is then accessed via those IDsPeople are influential about TopicsTopics are named entities, but also have unique identifiers referenced by RESTful routes and IDs.
  3. Here’s where I get super opinionated.This applies to web as well.
  4. In our mobile API protocol: interstitial can return a URL to a webview in case of a change to invaldiate or redirect a client.Deal with versioning clients to gracefully escape users to the newest versions
  5. Cancel/Retry modals on Failure – usual.Write autoretry or store the POST for future use (always let the user know)Timers on state
  6. Be able to specify a “critical read” -> indicating acceptance of longer latency or bypassing cache responses
  7. If something like a “notif” object exists, include shortened versions of Actor and Subject objects in the payload, rather than reference them for future lookup.
  8. Require server to return a handshake at the end of Writes: in addition to positive status codes, return a positive ACK that a server handled the write.Envelope the error messages – present user-readable error messages in the error response (in addition to developer responses)API endpoint that is a config file : apps local config file to manange features :
  9. A Note On My Perspective:Klout builds consumer experiences. We measure influence on social networks.I manage all partner relations in regards to data in and out, as well as managed the development of our new API and how it was divided for Mobile.My experience is primarily in this context.