Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming

249 views

Published on

For more than a decade, web APIs have replaced the previous generation of web services. Throughout this period of growth, most APIs have been restricted to request-response over HTTP. We are now seeing a move back to eventing with the popularity of webhooks. Additionally, streaming is becoming another option for connecting services, apps, and devices. In this talk, we will look at the opportunities that event-based APIs and streaming offer and how our software architecture is evolving to handle these new styles of API interaction.

Published in: Software
  • Be the first to comment

GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming

  1. 1. Beyond REST: Moving to Event-Based APIs and Streaming GlueCon 2019 James Higginbotham james@launchany.com @launchany
  2. 2. 2@launchany Introduction • Executive API Consultant • API architecture, strategy, and design • Based in Colorado Springs • Across multiple verticals: – Commercial Insurance – Healthcare – Hospitality – Finance and Banking – Travel – Airline
  3. 3. 3@launchany Tracing the Evolution of REST APIs Photo by Jason Leung on Unsplash
  4. 4. 4@launchany APIs Solve a Variety of Use Cases Customer Experience Worker Experience Supplier/Partner Experience Integration Utility
  5. 5. 5@launchany API Design is an architectural concern that combines business, product design, and software engineering
  6. 6. 6@launchany REST APIs are stuck in the land of CRUD
  7. 7. 7@launchany ? Roy Fielding’s Warning “The REST interface is designed to be efficient for large grain hypermedia data transfer, optimizing for the common case of the Web, but resulting in an interface that is not optimal for other forms of architectural interaction.” - Roy Fielding - https://www.ics.uci.edu/~fielding/pubs/dissertation/software_arch.htm#sec_1_5
  8. 8. 8@launchany APIs Require Different Interaction Styles Request/ Response Request/ Acknowledge Batch-Based Publish/ Subscribe Message Streaming
  9. 9. 9@launchany Styles of API Eventing and Streaming Photo by Andrew Ridley on Unsplash
  10. 10. 10@launchany Messaging and Streaming Infrastructure
  11. 11. 11@launchany Queues and Topics Point-to-Point Messaging via Queues Fanout (Pub/Sub) via Topics Component MessageBroker Component Publisher MessageBroker Subscriber Subscriber Subscriber Component Message B Message A Message A Message B Message A Message A Message A Message A
  12. 12. 12@launchany Messaging Infrastructure
  13. 13. 13@launchany Messaging and Streaming Infrastructure
  14. 14. 14@launchany Distributed Logs Topic A Record1 Record2 Record3 Record4 Record5 Record6 Record7 Record8 Record9 Record10 Consumer BConsumer A
  15. 15. 15@launchany Streaming Infrastructure
  16. 16. 16@launchany From API Polling to API Eventing https://streamdata.io
  17. 17. 17@launchany API Eventing and Streaming Styles
  18. 18. 18@launchany GraphQL Subscriptions Source: https://graphql.github.io/graphql-spec/June2018/#sec-Subscription
  19. 19. 19@launchany API Eventing and Streaming Styles
  20. 20. 20@launchany gRPC Client and Server Streaming Source: https://grpc.io/docs/tutorials/basic/python.html#bidirectional-streaming-rpc
  21. 21. 21@launchany API Eventing and Streaming Styles
  22. 22. 22@launchany Server-Sent Events (SSE) Source: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
  23. 23. 23@launchany API Eventing and Streaming Styles
  24. 24. 24@launchany Websockets Source: http://apress.jensimmons.com/v5/pro-html5-programming/ch7.html
  25. 25. 25@launchany Websocket Subprotocols Source: https://www.iana.org/assignments/websocket/websocket.xml
  26. 26. 26@launchany API Eventing and Streaming Styles
  27. 27. 27@launchany Webhooks for HTTP POST Callbacks
  28. 28. 28@launchany Resthooks.org
  29. 29. 29@launchany Opportunity #1: Events and Streams Create Innovation Photo by Diego PH on Unsplash
  30. 30. 30@launchany GitHub: Creating a CI/CD Marketplace Source: https://github.com/launchany/event-hub/settings/hooks/new
  31. 31. 31@launchany Opportunity #2: Events and Streams Enable Collaboration Photo by Matteo Vistocco on Unsplash
  32. 32. When APIs Meet Jobs-To-Be-Done { … "_links": { “self": {"href": "/approval-requests/d796f2d0eb72492bb088"}, “approve": {"href": "/approval-requests/d796f2d0eb72492bb088/approve"}, “decline": {"href": "/approval-requests/d796f2d0eb72492bb088/decline"}, }, … } { "event": { "type": "approved", … } }
  33. 33. 33@launchany Messaging Platform Events
  34. 34. 34@launchany Bi-directional Webhooks Webhook Dispatcher Workflow Engine Messaging App Webhook Receiver Webhook Receiver Webhook Dispatcher HTTP POST /hooks/messages HTTP POST /hooks/workflow { “lastState”: “review”, “newState”: “approved”, “workflowId” : … } { “message”: “Can you please review?”, “link”: “/articles/12345”, “workflowId” : … } Ash: “Can you please review?” Julie: Approved
  35. 35. 35@launchany Opportunity #3: Events and Streams Operationalize Data Photo by Mika Baumeister on Unsplash
  36. 36. 36@launchany Today’s Data Pipeline: From ETL to ELQT
  37. 37. 37@launchany Evolving Your Software Architecture Photo by Ashkan Forouzani on Unsplash
  38. 38. 38@launchany APIs Often Start Simple
  39. 39. 39@launchany Capabilities and Outcomes First, API Design Next • Track a project from start to completion • Subdivide a project into tasks • Mark tasks as completed • View incomplete tasks • View active projects • View archived projects • Add collaborators to a project • POST /projects • POST /projects/{projectId}/tasks • POST /projects/{projectId}/tasks /{taskId}/complete • GET /tasks?status=incomplete • GET /projects?status=active • GET /projects?status=archived • POST /projects/{projectId}/members
  40. 40. 40@launchany As the Organization Grows, Complexity Increases
  41. 41. 41@launchany The Journey Toward an Enterprise API Platform Offers API Inventory API Orders API Identity API Accounts API Rewards API Partners Internal Developers Public App Developers Customers Third-party Approved Apps Redeem Svc Register Svc Avail Offers Svc Check Inv Svc Ship Receive Svc Create Order Svc Order History Svc Profile Svc Permissions Svc Friends n Fam Svc Redemption Stream New Acct Stream Inv Low Stream Order Proc Stream
  42. 42. 42@launchany The Evolving Enterprise Platform
  43. 43. 43@launchany Move Your Platform Beyond Request-Response APIs • APIs deliver capabilities through commands and queries • Events and streaming provide extensibility • Discovery via OpenAPI Spec + AsyncAPI (https://asyncapi.com) • Function-as-a-Service (FaaS) and iPaaS are the integration glue Rewards API Redeem Svc Register Svc Redemption Stream Redemption Event onRedemptionEvent() APIs Capabilities (Services) Streaming & Eventing Functions-as-a-Service & Stream Processors Redemption Processor
  44. 44. 44@launchany AsyncAPI: Eventing and Streaming Discovery
  45. 45. 45@launchany Describing Streaming Data Using AsyncAPI (w/ Apache Avro)
  46. 46. 46@launchany https://launchany.com/canvas Introducing the Microservice Design Canvas v2
  47. 47. 47@launchany Microservice Design Card v2 https://launchany.com/canvas
  48. 48. 48@launchany Toward a Future of Faster Integration Photo by Dlanor S on Unsplash
  49. 49. 49@launchany GitHub Actions: Eventing Meets Serverless Source: https://github.com/stefanprodan/gh-actions-demo
  50. 50. 50@launchany The History of Low Code/No Code Source: https://www.youtube.com/watch?v=I5WEH8jh8Hk Client-Server SOA/SOAP
  51. 51. 51@launchany The Future is API Integration (again)
  52. 52. 52@launchany James Higginbotham james@launchany.com @launchany https://launchany.com/canvas https://apideveloperweekly.com

×