How to Design an API

How to Design an API

Talk at London API Meetup on 2nd July 2014.

39bb8762f3a25ebc00ebd75bc4f363af?s=128

Simon Wood

July 02, 2014
Tweet

Transcript

  1. How to Design a Unified API London API Group -

    02/07/14 Wednesday, 2 July 14
  2. Simon Wood @hpoom Holiday Extras Image by Barney Livingston -

    Flickr Wednesday, 2 July 14
  3. @hpoom Wednesday, 2 July 14

  4. @hpoom Over 40m visits and 500k bookings in the last

    5 years Give £20m revenue to hotels each year Wednesday, 2 July 14
  5. @hpoom Wednesday, 2 July 14

  6. What I am going to cover The Problem Design Solutions

    Considerations Technology @hpoom Wednesday, 2 July 14
  7. LET’S TALK ABOUT THE PROBLEM @hpoom Wednesday, 2 July 14

  8. Multiple sources of data @hpoom Wednesday, 2 July 14

  9. @hpoom Wednesday, 2 July 14

  10. Multiple consumers of data @hpoom Wednesday, 2 July 14

  11. Shortbreaks traffic breakdown 18 months @hpoom Wednesday, 2 July 14

  12. @hpoom Wednesday, 2 July 14

  13. De couple @hpoom Wednesday, 2 July 14

  14. Hide legacy @hpoom Wednesday, 2 July 14

  15. Speed! @hpoom Wednesday, 2 July 14

  16. Source: Strangeloop Networks Case Study Amazon 100 milliseconds revenue 1%

    Mozilla 2.2 seconds downloads 60m per year @hpoom Wednesday, 2 July 14
  17. Scaleability @hpoom Wednesday, 2 July 14

  18. Be efficient with resource @hpoom Wednesday, 2 July 14

  19. SO WHAT IS THE THE SOLUTION @hpoom Wednesday, 2 July

    14
  20. The Design Bit @hpoom Wednesday, 2 July 14

  21. Website Application Layer Legacy Reservation System @hpoom Wednesday, 2 July

    14
  22. Website Application Layer & API Legacy Reservation System Affiliates @hpoom

    Wednesday, 2 July 14
  23. Website Application Layer & API Legacy Reservation System Affiliates Hotel

    System Ticket System @hpoom Wednesday, 2 July 14
  24. Website Application Layer & API Legacy Reservation System Affiliates Hotel

    System Ticket System @hpoom Wednesday, 2 July 14
  25. 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
  26. Proxy @hpoom Wednesday, 2 July 14

  27. Website Application Layer Legacy Reservation System @hpoom Wednesday, 2 July

    14
  28. Website Application Layer Unified API Legacy Reservation System New System

    Proxy @hpoom Wednesday, 2 July 14
  29. Hierarchical @hpoom Wednesday, 2 July 14

  30. Website Application Layer Unified API Legacy Reservation System New System

    @hpoom Wednesday, 2 July 14
  31. Website Application Layer Unified API Product API Content API Price

    & Availability Name Star Rating Facilities @hpoom Wednesday, 2 July 14
  32. Website Application Layer Unified API Product API Content API Hotels

    Tickets Transport @hpoom Wednesday, 2 July 14
  33. Website Application Layer Unified API Product API Content API Hotels

    Tickets Transport Legacy New Affiliate @hpoom Wednesday, 2 July 14
  34. Micro-service architecture Idea by Fred George - http://bit.ly/fred-george @hpoom Wednesday,

    2 July 14
  35. Traditional Enterprise Architecture Micro Service Architecture Diagram by James Hughes

    - http://bit.ly/micro-service @hpoom Wednesday, 2 July 14
  36. Website Application Layer Unified API Content API @hpoom Wednesday, 2

    July 14
  37. Authentication @hpoom Wednesday, 2 July 14

  38. Unified API Website Mobile App Affiliates Smart TV Hotels Tickets

    Transport Food Auth @hpoom Wednesday, 2 July 14
  39. Standardise your payloads @hpoom Wednesday, 2 July 14

  40. 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
  41. Checksum tricks @hpoom MD5 ("Checksum tricks") = 1aef67e94cf84d9c4200e24cbdc9f93d Wednesday, 2

    July 14
  42. Cache & async requests @hpoom Wednesday, 2 July 14

  43. 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
  44. 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
  45. 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
  46. SOME CONSIDERATIONS @hpoom Wednesday, 2 July 14

  47. Open & Commercial @hpoom Wednesday, 2 July 14

  48. The right way to rate limit @hpoom Wednesday, 2 July

    14
  49. Who needs access? @hpoom Wednesday, 2 July 14

  50. Unlimited pools of talent @hpoom Chris Jason, ESPN - http://bit.ly/espnapi

    Wednesday, 2 July 14
  51. Debugging & Logs @hpoom Wednesday, 2 July 14

  52. Our log data in loggly @hpoom Wednesday, 2 July 14

  53. 700k unique payloads 3GB JSON logged daily @hpoom Wednesday, 2

    July 14
  54. WHAT TECHNOLOGY? @hpoom Wednesday, 2 July 14

  55. We use... @hpoom express web application framework for node Wednesday,

    2 July 14
  56. Yesterday’s Standard SOAP XML Today’s Standard REST JSON Keep it

    simple! @hpoom Wednesday, 2 July 14
  57. @hpoom Wednesday, 2 July 14

  58. Language does not matter @hpoom Wednesday, 2 July 14

  59. Good docs @hpoom Pusher Blog - http://bit.ly/devapidocs Wednesday, 2 July

    14
  60. TAKE AWAYS @hpoom Wednesday, 2 July 14

  61. APIs Mobile Social Cloud @hpoom Diagram by Sam Ramji -

    http://bit.ly/biz-apis Wednesday, 2 July 14
  62. Consume your own APIs @hpoom uses to build Source Zach

    Holman - http://bit.ly/githubdogfood uses to build Wednesday, 2 July 14
  63. @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
  64. is really important don't screw it up APIs Design @hpoom

    Wednesday, 2 July 14
  65. Thanks http://bit.ly/unifiedapi @hpoom twitter + github Simon Wood Wednesday, 2

    July 14