APIs from the Trenches - FOWA 2014

39bb8762f3a25ebc00ebd75bc4f363af?s=47 Simon Wood
October 01, 2014

APIs from the Trenches - FOWA 2014

People can spend a lot of time debugging APIs. Think about it, people are consuming something they have not designed or coded, and documentation can only go so far. In this talk we will cover debugging APIs as a consumer, highlight the tools that are out there available to take the pain out of consuming APIs. We will also look at how to bake in debugging as an API author and how to use logging to give you help when things do go wrong.

39bb8762f3a25ebc00ebd75bc4f363af?s=128

Simon Wood

October 01, 2014
Tweet

Transcript

  1. @hpoom APIs FROM THE TRENCHES By Simon Wood 1 FOWA

    London 2014
  2. a @hpoom Technology Director for Shortbreaks Holiday Extras Simon Wood

    2 @hpoom About Me
  3. b @hpoom 3 Holiday Extras

  4. b @hpoom 4 @hpoom miDrive

  5. b @hpoom Our Mission 5 Consumer Debugging Author Debugging Considerations

  6. @hpoom j Consumer Deibugging 6

  7. @hpoom m Selection 7

  8. @hpoom f Discovery 8

  9. @hpoom f Micro Services 9

  10. @hpoom f Abstraction 10

  11. @hpoom f Version Monitoring 11

  12. b @hpoom API Changelog 12 bit.ly/apiChange

  13. b @hpoom API Changelog 13

  14. @hpoom m Network 14

  15. @hpoom f Connection 15

  16. b @hpoom Connection 16 bit.ly/DiagNet

  17. @hpoom f Auth 17

  18. @hpoom e Auth 18 Use a Library

  19. @hpoom e Auth Test in Isolation 19

  20. b @hpoom Token Gen 20 bit.ly/TokenGen

  21. b @hpoom Token Gen 21 bit.ly/TokenGen

  22. @hpoom f Direct API Calls 22

  23. @hpoom e Why Direct Calls? 23 Quick

  24. @hpoom e Why Direct Calls? Scope 24

  25. @hpoom h Direct API calls 25

  26. @hpoom h Direct API calls 25 Browser

  27. @hpoom h Direct API calls 25 Browser cURL

  28. @hpoom h Direct API calls 25 Browser cURL Postman

  29. b @hpoom Postman 26

  30. b @hpoom Postman 27

  31. @hpoom m Payload 28

  32. @hpoom f Mock API 29

  33. ” @hpoom p “Developing an application and an API in

    parallel can be quite the tricky task” Ryan Able bit.ly/FakeAPI 30
  34. @hpoom e Why Mock? Schema 31

  35. @hpoom e Why Mock? Change 32

  36. @hpoom e Why Mock? Rate Limits 33

  37. @hpoom e Why Mock? Efficiency 34

  38. @hpoom h Mock API 35

  39. @hpoom h Mock API 35 Mockable mockable.io

  40. @hpoom h Mock API 35 Apiary apiary.io Mockable mockable.io

  41. @hpoom h Mock API 35 Mocky mocky.io Apiary apiary.io Mockable

    mockable.io
  42. b @hpoom Mocky 36

  43. @hpoom f 37 Fake API

  44. @hpoom e Why Fake? Offline 38

  45. @hpoom e Why Fake? Security 39

  46. @hpoom e Why Fake? Dynamic 40

  47. @hpoom h Fake API 41 dyson webpro/dyson JSON Server typicode/json-server

    Interfake basicallydan/interfake
  48. b @hpoom 42 Interfake npm install interfake --save var Interfake

    = require('interfake'); var interfake = new Interfake(); interfake.get('/whats-next').body({ next : 'more stuff '}); interfake.listen(3000); // Listen on port 3000 { "next":"more stuff" } Install Code http://localhost:3000/whats-next
  49. @hpoom f Proxy 43

  50. @hpoom e Why Proxy? Snoop 44

  51. @hpoom e Why Proxy? Replay 45

  52. @hpoom e Why Proxy? 46 Tunnel

  53. @hpoom h Proxies 47

  54. @hpoom h Proxies 47 Wiretap

  55. @hpoom h Proxies 47 Runscope Wiretap

  56. @hpoom h Proxies 47 Ngrok Runscope Wiretap

  57. @hpoom f Turn Off Cache 48

  58. @hpoom j Author Deibugging 49

  59. @hpoom m Logging 50

  60. @hpoom e Why Logging? 51 Audit Trail

  61. @hpoom e Why Logging? 52 Pinpoint

  62. @hpoom e Why Logging? Analysis 53

  63. @hpoom f Cloud Logging 54

  64. @hpoom h Cloud Logging 55

  65. @hpoom h Cloud Logging 55 Sumo Logic

  66. @hpoom h Cloud Logging 55 Sumo Logic Logstash

  67. @hpoom h Cloud Logging 55 Sumo Logic Loggly Logstash

  68. b @hpoom 56 Loggly

  69. b @hpoom 57 Loggly

  70. b @hpoom 58 Loggly

  71. @hpoom m Error Reporting 59

  72. @hpoom e Why Error Reporting? 60 Exceptions

  73. @hpoom h Error Reporting 61

  74. @hpoom h Error Reporting 61 Bugsnag

  75. @hpoom h Error Reporting 61 Bugsnag Airbreak

  76. @hpoom h Error Reporting 61 Bugsnag Sentry Airbreak

  77. b @hpoom 62 Sentry

  78. b @hpoom 63 Sentry

  79. @hpoom m Monitoring 64

  80. @hpoom h Monitor 65

  81. @hpoom h Monitor 65 Zapier

  82. @hpoom h Monitor 65 Runscope Zapier

  83. @hpoom h Monitor 65 Runscope Zapier Ducksboard

  84. @hpoom m Load Testing 66

  85. @hpoom h Load Testing 67

  86. @hpoom h Load Testing 67 Siege

  87. @hpoom h Load Testing 67 Loader.io Siege

  88. @hpoom h Load Testing 67 wrk Loader.io Siege

  89. b @hpoom 68 wrk wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html Running

    30s test @ http://127.0.0.1:8080/index.html 12 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 635.91us 0.89ms 12.92ms 93.69% Req/Sec 56.20k 8.07k 62.00k 86.54% 22464657 requests in 30.00s, 17.76GB read Requests/sec: 748868.53 Transfer/sec: 606.33MB Basic Example Output
  90. @hpoom j 69 Author Considerations

  91. @hpoom m Docs 70

  92. @hpoom h Swagger RAML API Blueprint API Design 71

  93. b @hpoom 72 API Design bit.ly/designApi

  94. @hpoom m SDKs 73

  95. @hpoom j 74 Human Help

  96. @hpoom j FOLLOW 75 @kinlane @johnsheehan @synedra

  97. ” @hpoom p Kin Lane bit.ly/trenchesOfAPI “API design is often

    done in the trenches of API operations, iterating and perfecting as an API initiative evolves.” 76
  98. @hpoom Thank you please contact me if you have any

    questions Twitter: @hpoom Links: http://bit.ly/ApiTrenches logo 77 By Simon Wood FOWA London 2014 join.holidayextras.co.uk