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.
Reactive Programming 
Models for IoT 
Todd L. Montgomery 
@toddlmontgomery
Already Here! Not New! 
Internet of Things? 
Just a Silicon Valley buzzword?
Also Not New! 
Reactive Programming? 
Just another buzzword?
Connecting “Things” 
…Reactively…
Request 
Response 
What most of us think happens
And if not, we’ll make it! 
Request 
Response 
What really happens
But… Who does this? 
Request 
Response 
What also really happens
Request 
Response 
@toddlmontgomery 
Support 
(UI/Device) 
Security 
(Challenge) 
Keep-Alive 
or Watchdog 
User State 
Que...
News, Stocks, Texts/SMS, 
Video, Audio, Social, … 
Stream 
What also really happens
Temperature, Heart Rate, Web Logs, Sensor 
Data, Seismic Readings, Steps, Stairs, Gyro 
Data, GPS, Acceleration, Breathing...
Pretty much how everything 
actually works… 
Request 
Stream & Ingest 
Response 
What also really happens
What also REALLY happens
Request, Response, Stream, 
and Ingest are really types 
Message 
Message 
The Break Down 
Message-Driven 
Message-Driven
Message Driven 
Reactive Applications 
Elastic 
Responsive Resilient 
http://www.reactivemanifesto.org/
Distributed Systems Evolution 
REST 
RPC 
Function Call 
Message-Driven 
LISP 
?
IoT…
HTCPCP 
RFC 2324, Extended by RFC 7168 
"there is a strong, dark, rich requirement for a protocol designed 
espressoly [si...
@toddlmontgomery
courtesy of
Sometimes it is good to 
reinvent the wheel
What History Has Taught Us 
@toddlmontgomery
THE IoT Language!
THE IoT Protocol!
THE IoT Runtime!
THE IoT ______!
Internet of Things 
Multi-Lingual 
(and Polyglot) 
Multi-Protocol & 
Multi-Standard 
Multi-“Platform” Huge Scale 
Highly I...
Connected. Integrated. 
Great time to be a protocol geek!
Nuklei 
Multi-Lingual 
(and Polyglot) 
Connected. Services. Tools. 
Location 
Transparency 
Multi-Protocol 
& Data Format ...
Protocols 
Deployment Container 
Nuklei 
Logic 
Reactive 
Message Stream 
Depends on language, 
runtime, platform, etc. 
A...
Choice of protocols becomes 
deployment concern 
Protocols 
Simple, consistent usage 
allows functional 
composition of pr...
HTTP/1.1 
Protocols? 
Shared Memory IPC 
CoAP AMQP 
WebSocket 
JMS 
WebRTC 
Not just in the traditional sense… 
MQTT 
HTTP...
pro·to·col noun ˈprō-tə-ˌkȯl, -ˌkōl, -ˌkäl, -kəl 
@toddlmontgomery 
! 
... 
! 
3 b : a set of conventions governing the t...
Protocols are the key to Integration 
REST has demonstrated this! 
@toddlmontgomery
Packet/Frame is common 
building block (Ethernet, 
ATM, etc.) 
Functional Protocol Composition 
@toddlmontgomery 
e.g. HTT...
@toddlmontgomery 
TCP 
HTTP 
Shared Memory WebSocket … JMS 
Everything below the 
boundary can change even 
at runtime 
Ev...
FIX / SBE CBOR 
HPACK 
XML JMS 
Data Format 
Divorced from Data Association 
@toddlmontgomery 
JSON 
Message 
YAML 
Map<> ...
Addressing 
Define an Endpoint 
for Connectivity 
URIs - Just, but not only Strings 
https://www.ietf.org Think about how ...
Endpoint can be 
anywhere 
Location Transparency 
More Forced Decoupling 
@toddlmontgomery 
Bind 
Address to “Proxy” 
“Pro...
Isolation & 
Deployment Containment 
OS level isolation, don’t duplicate 
at the application layer 
VM 
AMI 
App Server
BSD Sockets has it right 
Read/Write BLOBs 
Basic Low-Level API 
“Common” 
Message/Packet/Frame -based 
read(buffer, offse...
In Process or Out 
/mikro1 
Nuklei 
/mikro2 
Proxy 
Proxy 
https://localhost:80 
https://example.com 
https://localhost:80...
Struct Overlays Semi-Stateful Parsers 
Flyweights 
Know how to access fields efficiently 
Prefer to access via dead reckon...
Flow Control… Security… 
Additionally… 
Polyglot?… Schedulers… 
@toddlmontgomery 
Java, then JavaScript, C, iOS, …
Message 
Message 
To Sum Up
https://github.com/kaazing/nuklei 
Connected. Services. Tools. 
Very Early & Still Evolving
@toddlmontgomery 
Questions? 
• Kaazing http://www.kaazing.com 
• GitHub https://github.com/kaazing 
• Slideshare http://w...
Reactive Programming Models for IoT
Reactive Programming Models for IoT
Upcoming SlideShare
Loading in …5
×

Reactive Programming Models for IoT

1,769 views

Published on

GOTO Aarhus 2014

Published in: Technology
  • Be the first to comment

Reactive Programming Models for IoT

  1. 1. Reactive Programming Models for IoT Todd L. Montgomery @toddlmontgomery
  2. 2. Already Here! Not New! Internet of Things? Just a Silicon Valley buzzword?
  3. 3. Also Not New! Reactive Programming? Just another buzzword?
  4. 4. Connecting “Things” …Reactively…
  5. 5. Request Response What most of us think happens
  6. 6. And if not, we’ll make it! Request Response What really happens
  7. 7. But… Who does this? Request Response What also really happens
  8. 8. Request Response @toddlmontgomery Support (UI/Device) Security (Challenge) Keep-Alive or Watchdog User State Query
  9. 9. News, Stocks, Texts/SMS, Video, Audio, Social, … Stream What also really happens
  10. 10. Temperature, Heart Rate, Web Logs, Sensor Data, Seismic Readings, Steps, Stairs, Gyro Data, GPS, Acceleration, Breathing, EKG, EEG, … Ingest What also really happens
  11. 11. Pretty much how everything actually works… Request Stream & Ingest Response What also really happens
  12. 12. What also REALLY happens
  13. 13. Request, Response, Stream, and Ingest are really types Message Message The Break Down Message-Driven Message-Driven
  14. 14. Message Driven Reactive Applications Elastic Responsive Resilient http://www.reactivemanifesto.org/
  15. 15. Distributed Systems Evolution REST RPC Function Call Message-Driven LISP ?
  16. 16. IoT…
  17. 17. HTCPCP RFC 2324, Extended by RFC 7168 "there is a strong, dark, rich requirement for a protocol designed espressoly [sic] for the brewing of coffee" http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol @toddlmontgomery
  18. 18. @toddlmontgomery
  19. 19. courtesy of
  20. 20. Sometimes it is good to reinvent the wheel
  21. 21. What History Has Taught Us @toddlmontgomery
  22. 22. THE IoT Language!
  23. 23. THE IoT Protocol!
  24. 24. THE IoT Runtime!
  25. 25. THE IoT ______!
  26. 26. Internet of Things Multi-Lingual (and Polyglot) Multi-Protocol & Multi-Standard Multi-“Platform” Huge Scale Highly Integrated
  27. 27. Connected. Integrated. Great time to be a protocol geek!
  28. 28. Nuklei Multi-Lingual (and Polyglot) Connected. Services. Tools. Location Transparency Multi-Protocol & Data Format Basic Low-Level API
  29. 29. Protocols Deployment Container Nuklei Logic Reactive Message Stream Depends on language, runtime, platform, etc. Asynchronous Binary “Loose” Ordering
  30. 30. Choice of protocols becomes deployment concern Protocols Simple, consistent usage allows functional composition of protocols Deployment Container Nuklei Logic Reactive Message Stream Basic read/write API Various Protocol Options Asynchronous Binary Boundary
  31. 31. HTTP/1.1 Protocols? Shared Memory IPC CoAP AMQP WebSocket JMS WebRTC Not just in the traditional sense… MQTT HTTP/2 TCP/UDP/IP Aeron 0MQ
  32. 32. pro·to·col noun ˈprō-tə-ˌkȯl, -ˌkōl, -ˌkäl, -kəl @toddlmontgomery ! ... ! 3 b : a set of conventions governing the treatment and especially the formatting of data in an electronic communications system <network protocols> ... 3 a : a code prescribing strict adherence to correct etiquette and precedence (as in diplomatic exchange and in the military services) <a breach of protocol> !
  33. 33. Protocols are the key to Integration REST has demonstrated this! @toddlmontgomery
  34. 34. Packet/Frame is common building block (Ethernet, ATM, etc.) Functional Protocol Composition @toddlmontgomery e.g. HTTP over TCP looks same as HTTP over IPC or HTTP over WebSocket or HTTP over JMS e.g. Streams over Messages is a form of Fragmentation/ Reassembly Layering becomes natural & trivial. Also forces boundaries & decoupling Not New
  35. 35. @toddlmontgomery TCP HTTP Shared Memory WebSocket … JMS Everything below the boundary can change even at runtime Everything above the boundary can assume a constant interface … … … Boundary might be asynchonrous
  36. 36. FIX / SBE CBOR HPACK XML JMS Data Format Divorced from Data Association @toddlmontgomery JSON Message YAML Map<> and other native associations are better than format specific APIs
  37. 37. Addressing Define an Endpoint for Connectivity URIs - Just, but not only Strings https://www.ietf.org Think about how much @toddlmontgomery context this contains! Simple, Natural, & Familiar
  38. 38. Endpoint can be anywhere Location Transparency More Forced Decoupling @toddlmontgomery Bind Address to “Proxy” “Proxy” Object Migration
  39. 39. Isolation & Deployment Containment OS level isolation, don’t duplicate at the application layer VM AMI App Server
  40. 40. BSD Sockets has it right Read/Write BLOBs Basic Low-Level API “Common” Message/Packet/Frame -based read(buffer, offset, length) write(buffer, offset, length) @toddlmontgomery
  41. 41. In Process or Out /mikro1 Nuklei /mikro2 Proxy Proxy https://localhost:80 https://example.com https://localhost:80/mikro2 https://example.com
  42. 42. Struct Overlays Semi-Stateful Parsers Flyweights Know how to access fields efficiently Prefer to access via dead reckoning (stateless) @toddlmontgomery
  43. 43. Flow Control… Security… Additionally… Polyglot?… Schedulers… @toddlmontgomery Java, then JavaScript, C, iOS, …
  44. 44. Message Message To Sum Up
  45. 45. https://github.com/kaazing/nuklei Connected. Services. Tools. Very Early & Still Evolving
  46. 46. @toddlmontgomery Questions? • Kaazing http://www.kaazing.com • GitHub https://github.com/kaazing • Slideshare http://www.slideshare.com/toddleemontgomery • Twitter @toddlmontgomery Thank You!

×