SlideShare a Scribd company logo
1 of 27
Tyler Singletary, Director of Platform
tyler@klout.com ; @harmophone
Mobile First… or maybe second.
APICon 2014
Thinking about mobile means
thinking about APIs
2
(but I don’t have to tell you that)
How Klout Evolved Its APIs
3
Klout’s Partner API in
2010-2011:
• Not Mobile Optimized
• Not Used on Klout.com
• Not Extensible.
• XML and JSON response
• No Mobile Web Experience
• Easy Data in 1 Call
Klout’s API Strategy in
2012+:
• Acquired Blockboard
• Redesigned Central API
• Entitlement System for
Klout.com, Mobile, Partners
• Mobile Web
• JSON Only
• Easy Data in 2 Calls for
Partners
Any product is full of tradeoffs.
• We redesigned APIs for
Klout.com and our 1st-
party 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.
4
Master
API
Partner API
• Crowdsourced
Mobile Apps
• CRM,
Enterprise
• Consumer
Klout.com
• Mobile
Klout.com
Mobile API
• Official Klout
App
• Cinch
Let’s try Mobile Second (sort of)
5
Different use cases… same API
/user.json/1
• Klout.com can make several calls, and has expanded feature set. Fullest
payloads. Complete user profile!
• Partner API needs a very sanitized, limited payload. Just the user’s score.
• Mobile API needs this current user, but also should get all other users
6
Entitlements
• Can be implemented by header, query parameter, or other means.
• No need to build second endpoint for each use case
• Requires dedicated engineering rigor to be consistent
7
Klout Mobile iOS 1.0
8
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
}
Let’s try Mobile First! (and only!)
9
Klout’s Cinch APIs
10
View-oriented
payloads
Let’s get balanced
11
Optimizing APIs for both allows UX to
dominate
Web Mobile 2.0 iOS/Android
Serve not only yourself, but others…
• We should have branched another
“Mobile Partner API” to ease in partner
development of mobile apps utilizing
our API.
13
Master
API
Partner API
• CRM,
Enterprise
• Consumer
Mobile API
• Official Klout
App
• Cinch
Mobile
Partner API
• Appboy
Klout.com
November 2013 Update:
We still haven’t done this. 
May 2014 Update:
We still haven’t done this. :(
I feel like this is all so familiar.
14
Classic Client Server Design Principles
Server
• Talks to all external
APIs
• Proxy and repackage
content exactly how
the app needs it
• Truth
Client/App
• Talks only to Server,
except for auth (but
even then…)
• Temporary storage for
UX and rendering
• Maybe Truth
15
Mobile Clients and Hardware Dictate Challenges
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.
16
The Main Conflict
17
Larger
Data
Payload
Less
Requests
• Quick bursts of dense
information
• Just the facts
• But extensible
Lessons Learned
18
How Do You Protect Against These Challenges?
Remove
extraneous
data
Deliver large
payloads,
fewer requests
Real work
should be done
on the server
Try, try, again.
But not too
much.
Graceful
Degregation
19
Classic Client Server Principles
Failure is Routine. Plan for it.
20
Requests
User
Detail
Twitter Stream
Server
User
Detail
Twitter Stream
App – 3G
User
Deta-
------
------
----tream
It’s a race against time!
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!”
21
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.
22
Best Practices
• Envelopes are an essential way to control and react to change, impress an
update.
• Entitlements allow you to reform and segment your API for use cases
• Default to POST and PUT with arrays, even for single record updates.
• Reference both URLs to resources as well as content_ids
23
More Best Practices
• 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
24
Error states and hypermedia
• 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 (Hypermedia to the rescue!):
– Bon Longden’s vnd.error : https://github.com/blongden/vnd.error
25
Summary
Design for Mobile APIs:
• both internal and external
• Use entitlements and API Management
Mobile payloads:
• data rich, extensible, lean on the DDL
and extras. Low # of calls.
Mobile Envelope:
• should become a standard way of
change management
26
{
"response":{},
"responseTime":26,
"interstitial":{
"url": "http://m.klout.com/upgrade",
}
}
Master API -> Partner API
Mobile API, Mobile Partner API
Tyler Singletary, Director of Platform
tyler@klout.com ; @harmophone
Mobile First… or maybe second.
APICon 2014

More Related Content

What's hot

apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...apidays
 
Session on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementSession on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementpqrs1234
 
Api complete life cycle with api security
Api complete life cycle with api securityApi complete life cycle with api security
Api complete life cycle with api securitypqrs1234
 
Wmq wmb dist migration v1 030310
Wmq wmb dist migration v1 030310Wmq wmb dist migration v1 030310
Wmq wmb dist migration v1 030310karthickmsit
 
MuleSoft Anypoint Platform and Three Tier Architecture
MuleSoft Anypoint  Platform and Three Tier ArchitectureMuleSoft Anypoint  Platform and Three Tier Architecture
MuleSoft Anypoint Platform and Three Tier ArchitectureHarish Kumar
 
Best Practices: The Role of API Management
Best Practices: The Role of API ManagementBest Practices: The Role of API Management
Best Practices: The Role of API ManagementAkana
 
API Management For Building Software Applications Powerpoint Presentation Slides
API Management For Building Software Applications Powerpoint Presentation SlidesAPI Management For Building Software Applications Powerpoint Presentation Slides
API Management For Building Software Applications Powerpoint Presentation SlidesSlideTeam
 
Extend soa with api management Sangam18
Extend soa with api management Sangam18Extend soa with api management Sangam18
Extend soa with api management Sangam18Vinay Kumar
 
Cloud Foundry Marketplace
Cloud  Foundry MarketplaceCloud  Foundry Marketplace
Cloud Foundry MarketplaceLayne Peng
 
Who Cares About APIs? (NordicAPIS April 2014)
Who Cares About APIs? (NordicAPIS April 2014)Who Cares About APIs? (NordicAPIS April 2014)
Who Cares About APIs? (NordicAPIS April 2014)Nordic APIs
 
MuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationMuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationPace Integration
 
APIStrat Keynote: Lessons in Transforming the Enterprise to an API Platform
APIStrat Keynote: Lessons in Transforming the Enterprise to an API PlatformAPIStrat Keynote: Lessons in Transforming the Enterprise to an API Platform
APIStrat Keynote: Lessons in Transforming the Enterprise to an API PlatformLaunchAny
 
Introduction to mule soft
Introduction to mule softIntroduction to mule soft
Introduction to mule softrajnishjha29
 
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...apidays
 

What's hot (20)

apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
 
02 api gateway
02 api gateway02 api gateway
02 api gateway
 
Session on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementSession on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log management
 
Api complete life cycle with api security
Api complete life cycle with api securityApi complete life cycle with api security
Api complete life cycle with api security
 
Oracle api gateway overview
Oracle api gateway overviewOracle api gateway overview
Oracle api gateway overview
 
Wmq wmb dist migration v1 030310
Wmq wmb dist migration v1 030310Wmq wmb dist migration v1 030310
Wmq wmb dist migration v1 030310
 
MuleSoft Anypoint Platform and Three Tier Architecture
MuleSoft Anypoint  Platform and Three Tier ArchitectureMuleSoft Anypoint  Platform and Three Tier Architecture
MuleSoft Anypoint Platform and Three Tier Architecture
 
Best Practices: The Role of API Management
Best Practices: The Role of API ManagementBest Practices: The Role of API Management
Best Practices: The Role of API Management
 
API Management For Building Software Applications Powerpoint Presentation Slides
API Management For Building Software Applications Powerpoint Presentation SlidesAPI Management For Building Software Applications Powerpoint Presentation Slides
API Management For Building Software Applications Powerpoint Presentation Slides
 
Extend soa with api management Sangam18
Extend soa with api management Sangam18Extend soa with api management Sangam18
Extend soa with api management Sangam18
 
API Façade Pattern
API Façade PatternAPI Façade Pattern
API Façade Pattern
 
CA API Developer Portal
CA API Developer PortalCA API Developer Portal
CA API Developer Portal
 
Cloud Foundry Marketplace
Cloud  Foundry MarketplaceCloud  Foundry Marketplace
Cloud Foundry Marketplace
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
Who Cares About APIs? (NordicAPIS April 2014)
Who Cares About APIs? (NordicAPIS April 2014)Who Cares About APIs? (NordicAPIS April 2014)
Who Cares About APIs? (NordicAPIS April 2014)
 
MuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationMuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP Integration
 
Api manager
Api managerApi manager
Api manager
 
APIStrat Keynote: Lessons in Transforming the Enterprise to an API Platform
APIStrat Keynote: Lessons in Transforming the Enterprise to an API PlatformAPIStrat Keynote: Lessons in Transforming the Enterprise to an API Platform
APIStrat Keynote: Lessons in Transforming the Enterprise to an API Platform
 
Introduction to mule soft
Introduction to mule softIntroduction to mule soft
Introduction to mule soft
 
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...
apidays LIVE Jakarta - REST the events: REST APIs for Event-Driven Architectu...
 

Viewers also liked

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
 
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
 
APIs as a Venture Capital Model
APIs as a Venture Capital ModelAPIs as a Venture Capital Model
APIs as a Venture Capital ModelTyler Singletary
 
Ouroburos As A Service - Klout
Ouroburos As A Service - KloutOuroburos As A Service - Klout
Ouroburos As A Service - KloutTyler Singletary
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsJohn Musser
 
Numbers that Actually Matter. Finding Your North Star
Numbers that Actually Matter. Finding Your North Star Numbers that Actually Matter. Finding Your North Star
Numbers that Actually Matter. Finding Your North Star Mamoon Hamid
 

Viewers also liked (9)

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
 
APIs are for humans (defrag-con)
APIs are for humans   (defrag-con)APIs are for humans   (defrag-con)
APIs are for humans (defrag-con)
 
Big data; small print.
Big data; small print.Big data; small print.
Big data; small print.
 
APIs as a Venture Capital Model
APIs as a Venture Capital ModelAPIs as a Venture Capital Model
APIs as a Venture Capital Model
 
Mobile APIs in Practice
Mobile APIs in PracticeMobile APIs in Practice
Mobile APIs in Practice
 
Ouroburos As A Service - Klout
Ouroburos As A Service - KloutOuroburos As A Service - Klout
Ouroburos As A Service - Klout
 
HOWTO: Shut It Down
HOWTO: Shut It DownHOWTO: Shut It Down
HOWTO: Shut It Down
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOps
 
Numbers that Actually Matter. Finding Your North Star
Numbers that Actually Matter. Finding Your North Star Numbers that Actually Matter. Finding Your North Star
Numbers that Actually Matter. Finding Your North Star
 

Similar to Mobile First (or maybe second) API Development

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
 
Creating Effective Mobile Applications with IBM Bluemix
Creating Effective Mobile Applications with IBM BluemixCreating Effective Mobile Applications with IBM Bluemix
Creating Effective Mobile Applications with IBM BluemixAndrew Ferrier
 
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
 
Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016ProjectAcom
 
EduID Mobile App - Use-Cases, Concepts and Implementation
EduID Mobile App - Use-Cases, Concepts and ImplementationEduID Mobile App - Use-Cases, Concepts and Implementation
EduID Mobile App - Use-Cases, Concepts and ImplementationChristian Glahn
 
Top 7 wrong common beliefs about Enterprise API implementation
Top 7 wrong common beliefs about Enterprise API implementationTop 7 wrong common beliefs about Enterprise API implementation
Top 7 wrong common beliefs about Enterprise API implementationOCTO Technology
 
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
 
MuleSoft Madrid Meetup #3 slides 2nd July 2020
MuleSoft Madrid Meetup #3 slides 2nd July 2020MuleSoft Madrid Meetup #3 slides 2nd July 2020
MuleSoft Madrid Meetup #3 slides 2nd July 2020Ieva Navickaite
 
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...Amazon Web Services
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
REST and REST-fulness
REST and REST-fulnessREST and REST-fulness
REST and REST-fulnessDavid Waite
 
What's New in IBM Streams V4.2
What's New in IBM Streams V4.2What's New in IBM Streams V4.2
What's New in IBM Streams V4.2lisanl
 
Kochi Mulesoft Meetup #6
Kochi Mulesoft Meetup #6Kochi Mulesoft Meetup #6
Kochi Mulesoft Meetup #6sumitahuja94
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to MicroservicesKyle Brown
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1Kay Kim
 
IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018Chris Phillips
 

Similar to Mobile First (or maybe second) API Development (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
 
Creating Effective Mobile Applications with IBM Bluemix
Creating Effective Mobile Applications with IBM BluemixCreating Effective Mobile Applications with IBM Bluemix
Creating Effective Mobile Applications with IBM Bluemix
 
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
 
Bring api manager into your stack
Bring api manager into your stackBring api manager into your stack
Bring api manager into your stack
 
Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016Lightening Talk @Symfony Conference 2016
Lightening Talk @Symfony Conference 2016
 
EduID Mobile App - Use-Cases, Concepts and Implementation
EduID Mobile App - Use-Cases, Concepts and ImplementationEduID Mobile App - Use-Cases, Concepts and Implementation
EduID Mobile App - Use-Cases, Concepts and Implementation
 
Top 7 wrong common beliefs about Enterprise API implementation
Top 7 wrong common beliefs about Enterprise API implementationTop 7 wrong common beliefs about Enterprise API implementation
Top 7 wrong common beliefs about Enterprise API implementation
 
Octo API-days 2015
Octo API-days 2015Octo API-days 2015
Octo API-days 2015
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
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
 
MuleSoft Madrid Meetup #3 slides 2nd July 2020
MuleSoft Madrid Meetup #3 slides 2nd July 2020MuleSoft Madrid Meetup #3 slides 2nd July 2020
MuleSoft Madrid Meetup #3 slides 2nd July 2020
 
SharePoint Apps model overview
SharePoint Apps model overviewSharePoint Apps model overview
SharePoint Apps model overview
 
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
REST and REST-fulness
REST and REST-fulnessREST and REST-fulness
REST and REST-fulness
 
What's New in IBM Streams V4.2
What's New in IBM Streams V4.2What's New in IBM Streams V4.2
What's New in IBM Streams V4.2
 
Kochi Mulesoft Meetup #6
Kochi Mulesoft Meetup #6Kochi Mulesoft Meetup #6
Kochi Mulesoft Meetup #6
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1
 
IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Mobile First (or maybe second) API Development

  • 1. Tyler Singletary, Director of Platform tyler@klout.com ; @harmophone Mobile First… or maybe second. APICon 2014
  • 2. Thinking about mobile means thinking about APIs 2 (but I don’t have to tell you that)
  • 3. How Klout Evolved Its APIs 3 Klout’s Partner API in 2010-2011: • Not Mobile Optimized • Not Used on Klout.com • Not Extensible. • XML and JSON response • No Mobile Web Experience • Easy Data in 1 Call Klout’s API Strategy in 2012+: • Acquired Blockboard • Redesigned Central API • Entitlement System for Klout.com, Mobile, Partners • Mobile Web • JSON Only • Easy Data in 2 Calls for Partners
  • 4. Any product is full of tradeoffs. • We redesigned APIs for Klout.com and our 1st- party 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. 4 Master API Partner API • Crowdsourced Mobile Apps • CRM, Enterprise • Consumer Klout.com • Mobile Klout.com Mobile API • Official Klout App • Cinch
  • 5. Let’s try Mobile Second (sort of) 5
  • 6. Different use cases… same API /user.json/1 • Klout.com can make several calls, and has expanded feature set. Fullest payloads. Complete user profile! • Partner API needs a very sanitized, limited payload. Just the user’s score. • Mobile API needs this current user, but also should get all other users 6
  • 7. Entitlements • Can be implemented by header, query parameter, or other means. • No need to build second endpoint for each use case • Requires dedicated engineering rigor to be consistent 7
  • 8. Klout Mobile iOS 1.0 8 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 }
  • 9. Let’s try Mobile First! (and only!) 9
  • 12. Optimizing APIs for both allows UX to dominate Web Mobile 2.0 iOS/Android
  • 13. Serve not only yourself, but others… • We should have branched another “Mobile Partner API” to ease in partner development of mobile apps utilizing our API. 13 Master API Partner API • CRM, Enterprise • Consumer Mobile API • Official Klout App • Cinch Mobile Partner API • Appboy Klout.com November 2013 Update: We still haven’t done this.  May 2014 Update: We still haven’t done this. :(
  • 14. I feel like this is all so familiar. 14
  • 15. Classic Client Server Design Principles Server • Talks to all external APIs • Proxy and repackage content exactly how the app needs it • Truth Client/App • Talks only to Server, except for auth (but even then…) • Temporary storage for UX and rendering • Maybe Truth 15
  • 16. Mobile Clients and Hardware Dictate Challenges 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. 16
  • 17. The Main Conflict 17 Larger Data Payload Less Requests • Quick bursts of dense information • Just the facts • But extensible
  • 19. How Do You Protect Against These Challenges? Remove extraneous data Deliver large payloads, fewer requests Real work should be done on the server Try, try, again. But not too much. Graceful Degregation 19 Classic Client Server Principles
  • 20. Failure is Routine. Plan for it. 20 Requests User Detail Twitter Stream Server User Detail Twitter Stream App – 3G User Deta- ------ ------ ----tream It’s a race against time!
  • 21. 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!” 21
  • 22. 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. 22
  • 23. Best Practices • Envelopes are an essential way to control and react to change, impress an update. • Entitlements allow you to reform and segment your API for use cases • Default to POST and PUT with arrays, even for single record updates. • Reference both URLs to resources as well as content_ids 23
  • 24. More Best Practices • 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 24
  • 25. Error states and hypermedia • 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 (Hypermedia to the rescue!): – Bon Longden’s vnd.error : https://github.com/blongden/vnd.error 25
  • 26. Summary Design for Mobile APIs: • both internal and external • Use entitlements and API Management Mobile payloads: • data rich, extensible, lean on the DDL and extras. Low # of calls. Mobile Envelope: • should become a standard way of change management 26 { "response":{}, "responseTime":26, "interstitial":{ "url": "http://m.klout.com/upgrade", } } Master API -> Partner API Mobile API, Mobile Partner API
  • 27. Tyler Singletary, Director of Platform tyler@klout.com ; @harmophone Mobile First… or maybe second. APICon 2014

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 IDs People are influential about Topics Topics 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 invaldate 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.