Pro Yearly is on sale from $80 to $50! »

Yes! You should provide a client library for your API!

E06aa8f63d2a1753a2b352bc1cabbde2?s=47 Daniel Azuma
November 13, 2018

Yes! You should provide a client library for your API!

Presentation by Daniel Azuma at RubyConf 2018. Discusses API client libraries, what they should do, why they are useful, and how they can be created and maintained at scale. More information at http://daniel-azuma.com/rubyconf2018

E06aa8f63d2a1753a2b352bc1cabbde2?s=128

Daniel Azuma

November 13, 2018
Tweet

Transcript

  1. Yes! You should provide a client library for your API!

    Daniel Azuma Nov 13, 2018
  2. Source: https://pixabay.com/en/hands-raised-raised-hands-arms-up-1768845/ License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/)

  3. API Client Library

  4. API Client Library A Ruby gem providing a nice Ruby

    interface for calling a network API
  5. None
  6. None
  7. Daniel Azuma @danielazuma http:/ /daniel-azuma.com/

  8. None
  9. .rb .py .js .go .php .rb .py .js .go .php

    .rb .py .js .go .php .rb .py .js .go .php … … >10 languages >250 services
  10. Is it worth it?

  11. Source: https://pixabay.com/en/baby-boy-child-childhood-computer-84627/ License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/)

  12. None
  13. APIs are hard

  14. Auth

  15. Retry

  16. Caching

  17. Auth Retry Caching Quotas Error Handling Pagination Instrumentation Long-running Operations

    Versioning etc…
  18. API > HTTP

  19. None
  20. Know the protocol

  21. Client Example

  22. Stub Object Client Example

  23. Identity / auth Client Example

  24. Method calls Client Example

  25. Result objects Client Example

  26. no URLs no JSON no HTTP status Client Example

  27. no URLs no JSON no HTTP status no retry no

    caching Client Example
  28. DevX

  29. Use Ruby abstractions

  30. None
  31. Use Ruby abstractions Handle errors

  32. Use Ruby abstractions Handle errors Improve safety/security

  33. Use Ruby abstractions Handle errors Improve safety/security Improve performance

  34. log entry send request user app client library logging service

    receive response return log entry send request receive response return
  35. queue queue log entries log entries send batch send batch

    user app client library logging service
  36. Use Ruby abstractions Handle errors Improve safety/security Improve performance Provide

    instrumentation
  37. Use Ruby abstractions Handle errors Improve safety/security Improve performance Provide

    instrumentation
  38. .rb .py .js .go .php .rb .py .js .go .php

    .rb .py .js .go .php .rb .py .js .go .php … … >10 languages >250 services
  39. Interface Description Language

  40. Interface Description Language Source: https://pixabay.com/en/book-geek-glasses-read-robot-1296590/ License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/)

  41. Interface Description Language Calls

  42. Interface Description Language Calls Parameters/results

  43. Interface Description Language Calls Parameters/results Data types

  44. Interface Description Language Calls Parameters/results Data types Properties

  45. Interface Description Language Calls Parameters/results Data types Properties Documentation

  46. WSDL

  47. SOAP

  48. https:/ /openapis.org/

  49. .rb

  50. Metaprogramming

  51. IDL Client Library Metaprogramming Engine Generated Classes

  52. IDL Client Library Metaprogramming Engine Generated Classes

  53. Code generation

  54. IDL Code Generator Generator Engine Client Library Generated Ruby Files

  55. IDL Code Generator Generator Engine Client Library Reference Documentation Server

    Skeleton Automated Tests
  56. None
  57. How do I get started? +

  58. How do I get started? + Choose a spec standard

  59. Choose a spec standard How do I get started? +

    Write an API description
  60. Choose a spec standard How do I get started? +

    Write an API description Invoke an open source generator
  61. Choose a spec standard How do I get started? +

    Write an API description Invoke an open source generator Customize the generator
  62. Why to write a client library

  63. Why to write a client library What should go in

    a client library
  64. Why to write a client library What should go in

    a client library How to write scalable client libraries
  65. Why to write a client library What should go in

    a client library How to write scalable client libraries
  66. Yes! You should provide a client library for your API!

    ,
  67. Yes! You should provide a client library for your API!

    https:/ /daniel-azuma.com/rubyconf2018