How to
Design a
Unified API
London API Group - 02/07/14
Wednesday, 2 July 14
Slide 2
Slide 2 text
Simon Wood
@hpoom
Holiday Extras
Image by Barney Livingston - Flickr
Wednesday, 2 July 14
Slide 3
Slide 3 text
@hpoom
Wednesday, 2 July 14
Slide 4
Slide 4 text
@hpoom
Over 40m visits
and 500k bookings
in the last 5 years
Give £20m revenue
to hotels each year
Wednesday, 2 July 14
Slide 5
Slide 5 text
@hpoom
Wednesday, 2 July 14
Slide 6
Slide 6 text
What I am going to cover
The Problem
Design Solutions
Considerations
Technology
@hpoom
Wednesday, 2 July 14
Slide 7
Slide 7 text
LET’S TALK ABOUT
THE PROBLEM
@hpoom
Wednesday, 2 July 14
Slide 8
Slide 8 text
Multiple
sources
of data
@hpoom
Wednesday, 2 July 14
Slide 9
Slide 9 text
@hpoom
Wednesday, 2 July 14
Slide 10
Slide 10 text
Multiple
consumers
of data
@hpoom
Wednesday, 2 July 14
Slide 11
Slide 11 text
Shortbreaks traffic
breakdown 18 months
@hpoom
Wednesday, 2 July 14
Slide 12
Slide 12 text
@hpoom
Wednesday, 2 July 14
Slide 13
Slide 13 text
De couple
@hpoom
Wednesday, 2 July 14
Slide 14
Slide 14 text
Hide
legacy
@hpoom
Wednesday, 2 July 14
Slide 15
Slide 15 text
Speed!
@hpoom
Wednesday, 2 July 14
Slide 16
Slide 16 text
Source: Strangeloop Networks Case Study
Amazon
100
milliseconds
revenue
1%
Mozilla
2.2
seconds
downloads
60m
per year
@hpoom
Wednesday, 2 July 14
Slide 17
Slide 17 text
Scaleability
@hpoom
Wednesday, 2 July 14
Slide 18
Slide 18 text
Be efficient
with resource
@hpoom
Wednesday, 2 July 14
Slide 19
Slide 19 text
SO WHAT IS THE
THE SOLUTION
@hpoom
Wednesday, 2 July 14
Slide 20
Slide 20 text
The
Design
Bit
@hpoom
Wednesday, 2 July 14
Slide 21
Slide 21 text
Website
Application
Layer
Legacy
Reservation System
@hpoom
Wednesday, 2 July 14
Slide 22
Slide 22 text
Website
Application
Layer & API
Legacy
Reservation System
Affiliates
@hpoom
Wednesday, 2 July 14
Slide 23
Slide 23 text
Website
Application
Layer & API
Legacy
Reservation System
Affiliates
Hotel System Ticket System
@hpoom
Wednesday, 2 July 14
Slide 24
Slide 24 text
Website
Application
Layer & API
Legacy
Reservation System
Affiliates
Hotel System Ticket System
@hpoom
Wednesday, 2 July 14
Slide 25
Slide 25 text
Unified API
Website Mobile App Affiliates Smart TV
Hotels Tickets Transport Food
Multiple consumers of data
Multiple sources of data
@hpoom
Wednesday, 2 July 14
Slide 26
Slide 26 text
Proxy
@hpoom
Wednesday, 2 July 14
Slide 27
Slide 27 text
Website
Application
Layer
Legacy
Reservation System
@hpoom
Wednesday, 2 July 14
Slide 28
Slide 28 text
Website
Application
Layer
Unified API
Legacy
Reservation System
New System
Proxy
@hpoom
Wednesday, 2 July 14
Slide 29
Slide 29 text
Hierarchical
@hpoom
Wednesday, 2 July 14
Slide 30
Slide 30 text
Website
Application
Layer
Unified API
Legacy
Reservation System
New System
@hpoom
Wednesday, 2 July 14
Slide 31
Slide 31 text
Website
Application
Layer
Unified API
Product API Content API
Price &
Availability
Name
Star Rating
Facilities
@hpoom
Wednesday, 2 July 14
Slide 32
Slide 32 text
Website
Application
Layer
Unified API
Product API Content API
Hotels Tickets Transport
@hpoom
Wednesday, 2 July 14
Slide 33
Slide 33 text
Website
Application
Layer
Unified API
Product API Content API
Hotels Tickets Transport
Legacy New Affiliate
@hpoom
Wednesday, 2 July 14
Slide 34
Slide 34 text
Micro-service
architecture
Idea by Fred George - http://bit.ly/fred-george
@hpoom
Wednesday, 2 July 14
Slide 35
Slide 35 text
Traditional
Enterprise
Architecture
Micro
Service
Architecture
Diagram by James Hughes - http://bit.ly/micro-service
@hpoom
Wednesday, 2 July 14
Slide 36
Slide 36 text
Website
Application
Layer
Unified API
Content API
@hpoom
Wednesday, 2 July 14
Slide 37
Slide 37 text
Authentication
@hpoom
Wednesday, 2 July 14
Slide 38
Slide 38 text
Unified API
Website Mobile App Affiliates Smart TV
Hotels Tickets Transport Food
Auth
@hpoom
Wednesday, 2 July 14
Slide 39
Slide 39 text
Standardise
your payloads
@hpoom
Wednesday, 2 July 14
Slide 40
Slide 40 text
PUBLIC SERVICE
ANNOUNCEMENT
@hpoom
This is THE correct way
to write numeric dates
2014-07-02
Source XKCD - http://bit.ly/iso-date
Wednesday, 2 July 14
Cache &
async
requests
@hpoom
Wednesday, 2 July 14
Slide 43
Slide 43 text
Unified API
Website Mobile App Affiliates Smart TV
Hotels Tickets Transport Food
Async
Total request time is only as
slow as the slowest provider
1.2s 0.8s
1.1s 0.6s
@hpoom
Wednesday, 2 July 14
Slide 44
Slide 44 text
Unified API
Website Mobile App Affiliates Smart TV
Hotels Tickets Transport Food
Cache
Cache Cache Cache Cache
If we hit the
top cache
respond in
0.04s
@hpoom
Wednesday, 2 July 14
Slide 45
Slide 45 text
In summary
Solutions
Unified API
Standard Payloads
Micro Services
Proxy
Cache & Async
Hierarchical
Problems
Multi Data Sources
Multi Consumers
Decouple
Hide Legacy
Speed
Scaleability
@hpoom
Wednesday, 2 July 14
Slide 46
Slide 46 text
SOME
CONSIDERATIONS
@hpoom
Wednesday, 2 July 14
Slide 47
Slide 47 text
Open &
Commercial
@hpoom
Wednesday, 2 July 14
Slide 48
Slide 48 text
The right
way to
rate limit
@hpoom
Wednesday, 2 July 14
Slide 49
Slide 49 text
Who needs
access?
@hpoom
Wednesday, 2 July 14
Slide 50
Slide 50 text
Unlimited
pools of
talent
@hpoom Chris Jason, ESPN - http://bit.ly/espnapi
Wednesday, 2 July 14
Slide 51
Slide 51 text
Debugging
& Logs
@hpoom
Wednesday, 2 July 14
Slide 52
Slide 52 text
Our log data in loggly
@hpoom
Wednesday, 2 July 14
We use...
@hpoom
express
web application
framework for
node
Wednesday, 2 July 14
Slide 56
Slide 56 text
Yesterday’s
Standard
SOAP
XML
Today’s
Standard
REST
JSON
Keep it simple!
@hpoom
Wednesday, 2 July 14
Slide 57
Slide 57 text
@hpoom
Wednesday, 2 July 14
Slide 58
Slide 58 text
Language
does not
matter
@hpoom
Wednesday, 2 July 14
Slide 59
Slide 59 text
Good
docs
@hpoom Pusher Blog - http://bit.ly/devapidocs
Wednesday, 2 July 14
Slide 60
Slide 60 text
TAKE
AWAYS
@hpoom
Wednesday, 2 July 14
Slide 61
Slide 61 text
APIs
Mobile
Social Cloud
@hpoom Diagram by Sam Ramji - http://bit.ly/biz-apis
Wednesday, 2 July 14
Slide 62
Slide 62 text
Consume your
own APIs
@hpoom
uses to build
Source Zach Holman - http://bit.ly/githubdogfood
uses to build
Wednesday, 2 July 14
Slide 63
Slide 63 text
@hpoom
“You wouldn't really
think that an online
bookstore needs to be
an extensible,
programmable
platform. Would you?”
Steve Yegge
Source Steve Yegge - http://bit.ly/yegge
Wednesday, 2 July 14
Slide 64
Slide 64 text
is really
important
don't screw
it up
APIs Design
@hpoom
Wednesday, 2 July 14
Slide 65
Slide 65 text
Thanks
http://bit.ly/unifiedapi
@hpoom
twitter
+
github
Simon Wood
Wednesday, 2 July 14