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

So, you want to build a Real-time API. Where do...

So, you want to build a Real-time API. Where do you start?

More Decks by API Strategy & Practice Conference

Other Decks in Technology

Transcript

  1. So, you want to build a Real-time API. Where do

    you start? PHIL @LEGGETTER Head of Evangelism @leggetter
  2. What we'll cover 5 Reasons you should offer a Real-Time

    API Transports Communication Patterns Protocols Security & Scaling Frameworks & Tools Conclusion Real-Time API Quiz (if time)
  3. Finding the Real-Time Data Any event in your system =

    Real-Time Data Changes in data System interactions User interactions
  4. Why have a Real-Time API? You have real-time data. Gain

    value from it! Quick business value Time Factor/Constraints Improve the Developer Experience & Empower them Help consumers building Real-Time features
  5. Factors to consider API Consumer? Server or Client Message update

    frequency Direction of communication Message latency Efficiency
  6. Server-Sent Events If you're considering either HTTP Long-Polling or HTTP

    Streaming then align with the Server-Sent Events standard.
  7. WebRTC Server or Client (normally client to client) High update

    rates Bi-directional Low latency High efficiency
  8. PubSub Subscribe & Publish on "channels" Channels. Multiplexed. Single connection

    Clearly partitions complex data Dedicated endpoint Requires SDK
  9. Data Sync Interact with, and synchronize, data structures Dedicated endpoint

    + Protocol New paradigm SDK required Hides network activity from developer
  10. Choose one that meets your requirements How do you do

    that? 1. Choose one that offers the functionality you need
  11. Choose one that meets your requirements How do you do

    that? 1. Choose one that offers the functionality you need 2. Watch my videos :)
  12. Real-Time API Tools? Not Many Lots for WebHooks - it's

    HTTP SwaggerSocket - REST over WS Fanout.io† StreamData.io† SailsJS† † frameworks, but offer a form of tooling
  13. So, you want to build a Real-time API. Where do

    you start? 1. Understand & Identify your valuable Real-Time Data (Events) 2. Define the API Consumer and choose Transports 3. Decide on the best Communication Pattern 4. Can an existing Real-Time Framework help?
  14. So, you want to build a Real-time API. Where do

    you start? 1. Understand & Identify your valuable Real-Time Data (Events) 2. Define the API Consumer and choose Transports 3. Decide on the best Communication Pattern 4. Can an existing Real-Time Framework help? 5. We need better Real-Time API tooling
  15. So, you want to build a Real-time API. Where do

    you start? Questions? leggetter.github.io/realtime-apis PHIL @LEGGETTER Head of Evangelism
  16. Real-Time API Quiz Example Scenarios 1. What transport? 2. What

    communication pattern? 3. What's the company?
  17. Scenario 1 Predefine query within service Push to servers Frequent

    data updates Potentially large message payloads
  18. Scenario 1 Predefine query within service Push to servers Frequent

    data updates Potentially large message payloads HTTP Streaming
  19. Scenario 1 Predefine query within service Push to servers Frequent

    data updates Potentially large message payloads HTTP Streaming Simple messaging
  20. Scenario 1 Predefine query within service Push to servers Frequent

    data updates Potentially large message payloads HTTP Streaming Simple messaging
  21. Scenario 2 Push to server Occasional data updates ("events") Delivery

    within ~1 of event WebHooks Simple messaging
  22. Scenario 2 Push to server Occasional data updates ("events") Delivery

    within ~1 of event WebHooks Simple messaging
  23. Scenario 3 Push to browsers, native mobile & anywhere Frequent

    data updates ("events") Delivery within 250ms Partitioned data
  24. Scenario 3 Push to browsers, native mobile & anywhere Frequent

    data updates ("events") Delivery within 250ms Partitioned data WebSocket + HTTP fallback
  25. Scenario 3 Push to browsers, native mobile & anywhere Frequent

    data updates ("events") Delivery within 250ms Partitioned data WebSocket + HTTP fallback PubSub + events
  26. Scenario 3 Push to browsers, native mobile & anywhere Frequent

    data updates ("events") Delivery within 250ms Partitioned data WebSocket + HTTP fallback PubSub + events
  27. Scenario 4 Multi-device comms via central storage Frequent data updates

    Delivery within 1s WebSocket (+ HTTP Streaming)
  28. Scenario 4 Multi-device comms via central storage Frequent data updates

    Delivery within 1s WebSocket (+ HTTP Streaming) Data Sync
  29. Scenario 4 Multi-device comms via central storage Frequent data updates

    Delivery within 1s WebSocket (+ HTTP Streaming) Data Sync
  30. So, you want to build a Real-time API. Where do

    you start? Questions? leggetter.github.io/realtime-apis PHIL @LEGGETTER Head of Evangelism