APIs from the Trenches - API Days Mediterranea 2015

APIs from the Trenches - API Days Mediterranea 2015

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

May 06, 2015
Tweet

Transcript

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

    Days Mediterranea
  2. a @hpoom Technology Director for Shortbreaks ! Simon Wood 2

    @hpoom About Me
  3. @hpoom j Selection 3

  4. @hpoom m Abstraction 4

  5. @hpoom m Version Monitoring 5

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

  7. b @hpoom API Changelog 7

  8. @hpoom j Network 8

  9. @hpoom m Connection 9

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

  11. @hpoom m Auth 11

  12. @hpoom e Auth 12 Use a Library

  13. @hpoom e Auth Test in Isolation 13

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

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

  16. @hpoom m Direct API Calls 16

  17. @hpoom e Why Direct Calls? 17 Quick

  18. @hpoom e Why Direct Calls? Scope 18

  19. @hpoom h Direct API calls 19 Browser cURL Postman

  20. b @hpoom Postman 20

  21. b @hpoom Postman 21

  22. @hpoom j Payload 22

  23. @hpoom m Mock API 23

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

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

  26. @hpoom e Why Mock? Change 26

  27. @hpoom e Why Mock? Rate Limits 27

  28. @hpoom e Why Mock? Efficiency 28

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

    mockable.io
  30. b @hpoom Mocky 30

  31. @hpoom m Fake API 31

  32. @hpoom e Why Fake? Offline 32

  33. @hpoom e Why Fake? Security 33

  34. @hpoom e Why Fake? Dynamic 34

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

    Interfake basicallydan/interfake
  36. b @hpoom { "next":"more stuff" } 36 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 Install Code http://localhost:3000/whats-next
  37. @hpoom m Proxy 37

  38. @hpoom e Why Proxy? Snoop 38

  39. @hpoom e Why Proxy? Replay 39

  40. @hpoom h Proxies 40 Ngrok Runscope Wiretap

  41. @hpoom f Turn Off Cache 41

  42. @hpoom j Logging 42

  43. @hpoom e Why Logging? 43 Audit Trail

  44. @hpoom e Why Logging? Analysis 44

  45. @hpoom m Cloud Logging 45

  46. @hpoom h Cloud Logging 46 Sumo Logic Loggly Logstash

  47. b @hpoom 47 Loggly

  48. b @hpoom 48 Loggly

  49. b @hpoom 49 Loggly

  50. @hpoom j Monitoring 50

  51. @hpoom h Monitor 51 Runscope Zapier Ducksboard

  52. @hpoom j Load Testing 52

  53. @hpoom h Load Testing 53 wrk Loader.io Siege

  54. b @hpoom 54 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
  55. @hpoom j Docs 55

  56. @hpoom h Swagger RAML API Blueprint API Design 56

  57. b @hpoom 57 API Design bit.ly/designApi

  58. ” @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.” 58
  59. @hpoom Thank you please contact me if you have any

    questions! ! Twitter: @hpoom Links: http://bit.ly/ApiTrenches logo 59 By Simon Wood API Days Mediterranea join.holidayextras.co.uk