Upgrade to Pro — share decks privately, control downloads, hide ads and more …

API Management from the Trenches

API Management from the Trenches

APIs are at the heart of a vast number of applications, and they are not always written by the development team implementing them.

Consuming an external API can be fun but also fraught with potential issues, bottlenecks and nightmares. When documentation can only help you to a certain degree, what can you do?

This session will cover dealing with API resources for your application and some really useful tools and techniques to assist you as you implement them.

Matt Gifford

October 23, 2015
Tweet

More Decks by Matt Gifford

Other Decks in Technology

Transcript

  1. @coldfumonkeh
    Matt Gifford
    API Management
    from the
    Trenches

    View full-size slide

  2. CONSUMER DEBUGGING
    AUTHOR DEBUGGING
    CONSIDERATIONS

    View full-size slide

  3. CONSUMER DEBUGGING

    View full-size slide

  4. MICRO SERVICES

    View full-size slide

  5. “Great things are done by a series of small things
    brought together.”
    - Vincent Van Gogh

    View full-size slide

  6. VERSION MONITORING

    View full-size slide

  7. http://bit.ly/1uIZrYV

    View full-size slide

  8. AUTHENTICATION

    View full-size slide

  9. USE A LIBRARY

    View full-size slide

  10. TEST IN ISOLATION

    View full-size slide

  11. http://bit.ly/1byFK1R

    View full-size slide

  12. DIRECT API CALLS

    View full-size slide

  13. FIREFOX REST CLIENT PLUGIN
    work on these

    View full-size slide

  14. cURL
    curl -i -X PUT httpbin.org/put -H Content-Type:application/json -d ‘{“hello”: “world”}’

    View full-size slide

  15. github.com/jakubroztocil/httpie
    http PUT httpbin.org/put hello=world
    HTTPie

    View full-size slide

  16. POSTMAN (v1)

    View full-size slide

  17. POSTMAN (v2)

    View full-size slide

  18. Fake API
    FAKE API

    View full-size slide

  19. https://github.com/webpro/dyson

    View full-size slide

  20. https://github.com/typicode/json-server

    View full-size slide

  21. https://github.com/basicallydan/interfake

    View full-size slide

  22. npm install interfake --save
    var Interfake = require('interfake');
    var interfake = new Interfake();
    interfake.get('/whats-next').body({ next : 'more stuff '});
    interfake.listen(3000); // The server will listen on port 3000
    {
    "next":"more stuff"
    }
    http://localhost:3000/whats-next

    View full-size slide

  23. charlesproxy.com/

    View full-size slide

  24. httpkit.com/wiretap

    View full-size slide

  25. runscope.com/docs/inspector

    View full-size slide

  26. CACHE MANAGEMENT

    View full-size slide

  27. AUTHOR DEBUGGING

    View full-size slide

  28. CLOUD LOGGING

    View full-size slide

  29. www.sumologic.com

    View full-size slide

  30. logstash.net

    View full-size slide

  31. www.loggly.com

    View full-size slide

  32. ERROR REPORTING

    View full-size slide

  33. getsentry.com

    View full-size slide

  34. zapier.com/status

    View full-size slide

  35. apimetrics.io

    View full-size slide

  36. runscope.com/radar

    View full-size slide

  37. ducksboard.com

    View full-size slide

  38. LOAD TESTING

    View full-size slide

  39. github.com/JoeDog/siege

    View full-size slide

  40. github.com/wg/wrk

    View full-size slide

  41. 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

    View full-size slide

  42. CONSIDERATIONS

    View full-size slide

  43. DOCUMENTATION

    View full-size slide

  44. apiblueprint.org

    View full-size slide

  45. bit.ly/designApi

    View full-size slide

  46. SPEAK TO A HUMAN

    View full-size slide

  47. @kinlane
    @johnsheehan
    @synedra

    View full-size slide

  48. http://restassuredbook.com/

    View full-size slide