• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Real-time APIs
 

Real-time APIs

on

  • 5,613 views

The number of real-time APIs on the Web are rising. What are real-time APIs, how are they used? How are they built? This deck and demo was presented at InfoQ in San Francisco Nov 2012.

The number of real-time APIs on the Web are rising. What are real-time APIs, how are they used? How are they built? This deck and demo was presented at InfoQ in San Francisco Nov 2012.

Statistics

Views

Total Views
5,613
Views on SlideShare
3,082
Embed Views
2,531

Actions

Likes
6
Downloads
48
Comments
0

11 Embeds 2,531

http://blogs.mulesoft.org 1848
http://java.dzone.com 659
http://architects.dzone.com 7
https://twitter.com 7
http://www.dzone.com 2
http://jolidev10-jolicloud.dotcloud.com 2
http://rritw.com 2
http://www.rritw.com 1
https://si0.twimg.com 1
https://twimg0-a.akamaihd.net 1
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Creator of the Mule project: first open source ESBFounder the company behind Mule and its family of productsSit firmly in the love marmite campStarted my career working in banks, telco and insuranceI have always been a “plumber” 14 years experience hooking stuff togetherUltimately I’m a geek that likes to tinker with softwareHuge lego fan, obsessed as a kid. Family guy cracks me up – my wife does notget either one
  • Simple. Because nobody wants to waitBecause your customers expect it. The world expects itReal-time will make or break your application- (Think about the Apps you use (maybe use Cue as an example))
  • “Don’t call us, we will call you”Need to work within the boundaries of API rate limits How many calls per hour\\ Total calls per day Time between callsList examples:
  • We don’t like to wait. Speed is a massive factor of success for any No point learning about something 4 minutes after it happened

Real-time APIs Real-time APIs Presentation Transcript

  • Real-time APIs and how to build one@rossmason, @mulesoft
  • Agenda• What the heck is Real-time APIs• The technology and trends• Demos
  • What is real-time?• Real-time: the ability to react to something as soon as it happens• Web real-time: Same but slower (about 900ms delay is ok)
  • What is a real-time API?• Real-time API: Allows an app to only register for events that it is interested in – Give me new customers as they are added – Tell me when the stock price changes – Tell me in 4 weeks to send an email to Bob
  • Why Real-time?• User experience: Don’t make people wait• Accuracy: Don’t make things wait• Because life happen in real-time
  • Why Real-time?Speed
  • What do most API consumers do?• Polling – Make a request every 60 seconds – 61.672% of calls yield no result – New data can be available and waiting for 59.9 seconds – Need to work within the boundaries of API rate limits • How many calls per hour • Total calls per day • Time between calls
  • Why Real-time?Broadcast
  • Why Real-time?Engagement
  • Push vs StreamingPush (aka WebHooks) Streaming• I’ll call you back • Keep the line open• Asynchronous • Request Response• Drawbacks • Drawbacks – Need to have a reply channel – Holds a socket connection setup open – Continuations can be – Considered a security risk by used some – Harder to implement durable – Reliability complicated – did connections the data arrive
  • REST or Real-time?• Real-time APIs are additive to an existing REST or SOAP API• Invocation semantics are different – Client needs to handle two invocation models• Real-time APIs are mostly used to query data – Usually not to perform CRUD operations• Have different SLA and reliability requirements
  • REST or Real-time? consumer REST API Streaming APIResource A Resource B Resource C Transport Subscription Manager Query Processor
  • Real-time Technologies• Transport – Comet (HTTP) – WebSocket (HTTP)• Protocols – With formal pub/sub semantics: • XMPP • Bayeux • STOMP – Ad hoc, ie "subscription" expressed in the request: • JSON• Push – PubSubHubbub – Web Hooks
  • Real-time APIs are realAPI Real-time technology/protocolSalesforce CometFacebook PubSubHubbubInstagram Ah Hoc (WebHooks/PubSubHubbub)Twitter Ad Hoc (Comet)PubNub Ad HocSuperFeedr XMPPPusher Ad Hoc (WebSockets)
  • Real-time APIs: REST + JSON or XML 1% of all APIs support real-time interaction source: ProgrammableWeb.com
  • Stop. Demo time!
  • Demo 1: AJAX Streaming API HTTP Long Transport Polling Subscription CometD Manager Query <None> Processorhttps://github.com/rossmason/mule-streaming-api-demo
  • Demo 2: WebSockets Streaming API Transport WebSocket Subscription JMS Manager Query Esper Processorhttps://github.com/rossmason/mule-streaming-api-demo
  • Mule real-time API supportTechnologies 3rd Party APIs• CometD • Salesforce Streaming API• Web Sockets • Facebook real-time API• Ad Hoc • Twitter Firehose• PubSubHubbub • PubNub• XMPP• STOMP• WebHooks
  • Real-time Web SotN• Still in early adopter territory – But some major APIs use this approach• Limitations – No discovery protocol (i.e. WADL) – Many different methods • Some hampered by older browser technology (i.e. Web Sockets
  • Thank You!• Twitter: @rossmason, @mulesoft• Slides: http://slideshare.net/rossmason• Code: https://github.com/rossmason/mule-streaming-api-demo• Blog: http://blogs.mulesoft.org• We are hiring: http://mulesoft.com.careers