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

API Flow

Z
May 11, 2016

API Flow

My talk at GitHub Satellite Amsterdam (5/11/2016) on how to build APIs. #githubsatellite #statelliteAMS

Recording: https://www.youtube.com/watch?v=cwz3U82mC-Y

Z

May 11, 2016
Tweet

More Decks by Z

Other Decks in Programming

Transcript

  1. OR?

  2. SHARED UNDERSTANDING AHEAD OF TIME 1 A component exposes an

    interface 2 Some humans write a lot of text to document it
  3. SHARED UNDERSTANDING AHEAD OF TIME 1 A component exposes an

    interface 2 Some humans write a lot of text to document it 3 Some other humans read it
  4. SHARED UNDERSTANDING AHEAD OF TIME 1 A component exposes an

    interface 2 Some humans write a lot of text to document it 3 Some other humans read it 4 And program another component to use the interface
  5. SHARED UNDERSTANDING AHEAD OF TIME 1 EX PO SE IN

    TERFAC E W RITE D O C S REA D D O C S PRO G RA M C LIEN T 2 3 4
  6. SHARED UNDERSTANDING AHEAD OF TIME 1 EX PO SE IN

    TERFAC E W RITE D O C S REA D D O C S PRO G RA M C LIEN T 2 3 4
  7. CLASSIC API FLOW 1 D EVELO PM EN T D

    ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4
  8. PROBLEMS OF SHARED UNDERSTANDING AHEAD OF TIME • Error-prone •

    Brittle system • Tight-coupling, prohibits changes • Requires couple of iterations to get it right • Does not scale
  9. PROBLEMS OF SHARED UNDERSTANDING AHEAD OF TIME • Error-prone •

    Brittle system • Tight-coupling, prohibits changes • Requires couple of iterations to get it right • Does not scale humans do errors versioning anyone? heard about broken clients? did clients use your API as expected? hire more programmers to write more docs
  10. 4 STAGES OF API MATURITY API as a by- product

    of building apps API documentation generated from code Design-first API Development API Design Consistency
  11. DESIGN-FIRST FLOW 2 D EVELO PM EN T D ELIVERY

    C O N SU M PTIO N A N A LYSIS 3 4 5 1 D ESIG N
  12. PREPARE YOUR ORGANIZATION 1 PREPA RATIO N D ESIG N

    D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  13. PREPARE YOUR ORGANIZATION 1 PREPA RATIO N D ESIG N

    D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6 reuse for improved DX through consistency
  14. DESIGN & PROTOTYPE 1 PREPA RATIO N D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  15. 1 PREPA RATIO N DESIGN & PROTOTYPE D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  16. 1 PREPA RATIO N ANALYZE & ITERATE D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  17. 1 PREPA RATIO N API FLOW PHASES STEPS D ESIG

    N & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  18. DESIGN & PROTOTYPE 2 1 Identify Resources 2 Define Resource

    States 3 Write API Description • API Blueprint • OpenAPI Spec (Swagger) • Word / Google Doc • Email • WADL, WSDL, RAML GitHub Flow
  19. DESIGN & PROTOTYPE 2 1 Identify Resources 2 Define Resource

    States 3 Write API Description 4 Use Mock Server 5 C O N SU M PTIO N GitHub Flow
  20. DESIGN & PROTOTYPE 2 1 Identify Resources 2 Define Resource

    States 3 Write API Description 4 Use Mock Server 5 Share & Review 5 C O N SU M PTIO N GitHub Flow GitHub Flow
  21. GITHUB FLOW CREATE A BRANCH Create a branch in your

    project where you can safely experiment and make changes. OPEN A PULL REQUEST Use a pull request to get feedback on your changes from people down the hall or ten time zones away. MERGE AND DEPLOY Merge your changes into your master branch and deploy your code. ADD COMMITS DISCUSS AND REVIEW GitHub provides tools for easier collaboration and code sharing from any device. Start collaborating with millions of developers today! GitHub is the best way to build software together. WORK FAST WORK SMART THE GITHUB FLOW The GitHub Flow is a lightweight, branch-based workflow that's great for teams and projects with regular deployments. Find this and other guides at http://guides.github.com/. Source: GitHub https://guides.github.com/introduction/flow/ GitHub Flow
  22. THE REAL DIFFERENCE 1 D EVELO PM EN T D

    ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 1 PREPA RATIO N D ESIG N & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  23. THE REAL DIFFERENCE 1 D EVELO PM EN T D

    ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 1 PREPA RATIO N D ESIG N & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6 )( )(
  24. DEVELOPMENT 3 1 Description + Implementation 2 Develop Server 3

    Test Locally GitHub Flow GitHub Flow Dredd github.com/apiaryio/dredd
  25. DEVELOPMENT 3 1 2 Develop Server 3 Test Locally 4

    Test in CI GitHub Flow Description + Implementation GitHub Flow
  26. DEVELOPMENT 3 1 2 Develop Server 3 Test Locally 4

    Test in CI 5 Deploy GitHub Flow Description + Implementation GitHub Flow Develop Track: Using pull requests to drive continuous delivery Guðmundur Bjarni Ólafsson (Heroku) Heroku Flow
  27. CONSUMPTION 5 1 Read Documentation 2 Experiment with API 3

    Develop client against Mock Server GitHub Flow
  28. CONSUMPTION 5 1 Read Documentation 2 Experiment with API 3

    Develop client against Mock Server 4 Develop client against Production via Debugging Proxy GitHub Flow GitHub Flow
  29. 1 PREPA RATIO N API FLOW D ESIG N &

    PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  30. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T 2 3
  31. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY 2 3 4
  32. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N 2 3 4 5
  33. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  34. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  35. 1 PREPA RATIO N API FLOW PHASES D ESIG N

    & PRO TO TYPE D EVELO PM EN T D ELIVERY C O N SU M PTIO N A N A LYSIS 2 3 4 5 6
  36. REFERENCES • How to Build APIs: https://apiary.io/how-to-build-api • Apiary: https://apiary.io/

    • J.C.R. Licklider: https://en.wikipedia.org/wiki/J._C._R._Licklider • Future of Programming: https://vimeo.com/71278954 • Communicating with Aliens: http://amundsen.com/blog/archives/1146 • GitHub Flow: https://guides.github.com/introduction/flow/ • Heroku Flow: https://www.heroku.com/continuous-delivery • Dredd: https://github.com/apiaryio/dredd