YOW! Nights - YOW! Conference · 2019. 9. 23. · Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013 “What needs to be done to make the ReST architectural style

Post on 20-Jan-2021

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

Kevin O’NeillCTO PlayUp

YOW!Nights

@kevinoneill

March 2013

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Roadmap

• ReST and Hypermedia

• An example of a Hypermedia driven service

• Tips & Trips

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

A jumping off point

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Opinionated

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Real

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

ReST & Hypermedia

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Representational State Transfer (ReST) is a style of software architecture for distributed

hypermedia systems such as the World Wide Web

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

ReST

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

ReST is not a meaningful term

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

One URL ≠ ReST

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Resources = ReST

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Resources = ReST

http://example.com/users/3

http://example.com/users/<uid>

http://example.com/users/<uid>/friends

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

HTTP Verbs = ReST

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

HTTP Verbs = ReST

POST  http://example.com/users

GET  http://example.com/users/3

PUT  http://example.com/users/3

DELETE  http://example.com/users/3

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

What is ReST really?

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

"ReST is software design on the scale of decades: every detail is intended to promote software longevity and independent evolution. Many of the constraints are directly opposed to short-term ef"ciency. Unfortunately, people are fairly good at short-term design, and usually awful at long-term design."

Roy Fielding

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

The constraints of ReST

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Client Server

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Stateless Server

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Cacheable

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Uniform Interface

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Layered System

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Code-On-Demand(optional)

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Uniform Interface

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Identi"cation of Resources

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Manipulation of resources through

representations

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Self-descriptive messages

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Hypermedia as the engine of application

state

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

“What needs to be done to make the ReST architectural style clear on the notion that hypertext is a constraint? In other words, if the engine of application state (and hence the API) is not being driven by hypertext, then it cannot be ReSTful and cannot be a ReST API. Period. Is there some broken manual somewhere that needs to be "xed?”

Roy T. Fielding

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

A Hypermedia driven service

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

PlayUp Pass

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

AppStore

TicketService

7:20 PM

1 Get Section

2 Get Tile

3 Priced Tile

4 Section

5�*HW�RHU��3OD\8SBL26BRHUB�� 6�2HU��$SSB6WRUHB7LHUB��

7 Get Price�$SSB6WRUHB7LHUB��

8 $����

TMS

ContentProvider

($)

Getting the Price

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Products":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Products":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

":type":  "application/vnd.playup.ticketing.product+json"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Preview":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

"preview":  {    ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",      ":type":  "application/vnd.playup.stream.story+json"},  

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Preview":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

":type":  "application/vnd.playup.stream.story+json"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Accept Header

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Accept Header

Accept

application/vnd.playup.stream.story+json,*/*

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

Preview

":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

URI Parameterization

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

URI Parameterization":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

{token:ticketing_sample_provider}

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

URI Parameterizationhttp://april.ticket-­‐provider.playupdev.com/content/82/preview?token=ABBr0dVOGRdPpF%2BAqll9sJNJAICWEHK%2BnTngDMzBI5IiABmlstT3RjwIBGkJpUCX3lchMQF3OrGoYyiYHh8zAbc7m%2FhsttbKyBBa%2BiX5hSApeBi1erBw7oJH9LBmk%2B1pfL2zApBDxCZZpJCkT5hScK1Z2g3%2BDhqkrQJTs3PQumbbC9bXJRnENksQhsb%2BNJuFrJ47sAGQBPPXyN0hy40i3J6LcwGMUSFIaR5kIAw3%2BiYyiKgC35rmZzvMYGEeV%2F08YR1ih47aKct5%2Fk0CTbzR06qxi1W11fR3pSMBn3HxqgYPjjMdgsa%2B5PiLv102eTk7kXc4Aqz1VDN2ogqu3qDbzebxdp6OOhnoSKa3jebrV9MOH6IgBRKYfiujq7MNle1xV1LwUQlm3T4BagclibIqOq%2FS1psWo0oZfU1DQW5h2AX%2BLrvF%2BGfgFRiHvaOWBUuq5esY0yqENyjD3Yu8WGq15MTqI36oK5S6hUy%2F0gAlB0rFMU%2BSX4WbuX64yjlKVWV5wr7E3FmaxT7yr98pGq04zKrJv2tn4rpUtcRoc8LrYiK2BdoQplYATGBCDgv68p%2FTiislPJv0%2B4hqhO5oAIv7fMa81uy%2F5WMcOjzmmsOgJzua0%2B%2FarXna9I3d0djqJ9fTDSQkM6icwz5u2P%2Btulzwq8UHEgYEFYFGUKyk%2BEXUgre7nttltajpLL3fRqGfrUqyI1NNM1dqGjeDN4zL0YA8KujtSoSWcA%3D%3D

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offers":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offers":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offers":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ],        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ]  }

Text  ":options":  [      "POST"  ]

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offers":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

":acceptable_types":  [  "application/vnd.playup.encrypted+json      ;embedded=          \"application/vnd.playup.ticketing.product.details+json\"      ;for=\"ticket_service\""]

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Types

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Typesdescribe a domain speci"c protocol

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

application/json

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Type Explosion

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Types":type":  "application/vnd.playup.ticketing.product+json",  "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider"},  "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket?provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\""        ],  }

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Types

application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Types

application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Media Types

application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.product.details+json\";for=\"ticket_service\"

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Something to consider

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Format vs Type

application/vnd.playup.stream+json

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Format vs Type

application/vnd.playup.stream+json

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Format vs Type

application/vnd.playup.stream+mp

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Format vs Type

application/vnd.playup.stream;format=\”json\”

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

So now we post

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offer{        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                  "store-­‐product":  [                        {                                "product":  "com.playup.content.pricing.tier1",                                  "vendor":  "appstore"                        }                ]        },          "verification":  {                "key":  "…",                  "link":  {                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.receipt+json\";for=\"ticket_service\""                        ],                          ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        }}

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Offer{        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                  "store-­‐product":  [                        {                                "product":  "com.playup.content.pricing.tier1",                                  "vendor":  "appstore"                        }                ]        },          "verification":  {                "key":  "…",                  "link":  {                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.receipt+json\";for=\"ticket_service\""                        ],                          ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        }}

"content":  {    "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",      "store-­‐product":  [        {            "product":  "com.playup.content.pricing.tier1",              "vendor":  "appstore"        }    ]}

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

{        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                  "store-­‐product":  [                        {                                "product":  "com.playup.content.pricing.tier1",                                  "vendor":  "appstore"                        }                ]        },          "verification":  {                "key":  "…",                  "link":  {                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded=\"application/vnd.playup.ticketing.receipt+json\";for=\"ticket_service\""                        ],                          ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        }}

Offer

"link":  {    ":href":  "http://april.ticket.playupdev.com/receipt…",      ":options":  [  "POST"  ],    ":acceptable_types":  [        "application/vnd.playup.encrypted+json;…"    ]}

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Tips & Trips

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

API Versioning

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Versioning

X-­‐PlayUp-­‐API-­‐Version

3

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Don’t Do It

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Server Decides

User-­‐Agent

PlayUp%20Pass/3.5.5233  CFNetwork/609.1.4  Darwin/13.0.0

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Client Decides

"link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":self":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html"},  

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Client Decides

"link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":href":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html"},  

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Client Decides

"link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":href":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html"},  

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Client vs Server

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Document Evolution

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

The client should ignore what it doesn’t

understand

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Don’t add or remove mandatory "elds

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

New Media Type

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

"Realtime" Updates

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

XMPP

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Polling

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Leverage Infrastructure

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Dynamic Scaling

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Cache Headers

ETag"9461cf5ecc0f4df6e880ce76479aba90"

Cache-­‐Controlmax-­‐age=15,  public

VaryAccept-­‐Language

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Cache Headers

ETag"9461cf5ecc0f4df6e880ce76479aba90"

Cache-­‐Controlmax-­‐age=15,  public

VaryAccept-­‐Language

   Cache-­‐Control    max-­‐age=15,  public

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Other Choices

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Tools

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Charles

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Fiddler

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Link Conditioner

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Wireshark

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Wireshark

rvictl  -­‐s  <device  UDID>

/def/bpf*

YOW! Nights - March 2013Kevin O’Neill - CTO PlayUp - @kevinoneill

Kevin O’NeillCTO - PlayUp

kevin@playup.com@kevinoneill

Questions?

top related