reactive programming models for iot
play

Reactive Programming Models for IoT Todd L. Montgomery - PowerPoint PPT Presentation

Reactive Programming Models for IoT Todd L. Montgomery @toddlmontgomery Psst! Already Here! Not New! Internet of Things? Just a Silicon Valley buzzword? Psst! Also Not New! Reactive Programming? Just another buzzword? Connecting Things


  1. Reactive Programming Models for IoT Todd L. Montgomery @toddlmontgomery

  2. Psst! Already Here! Not New! Internet of Things? Just a Silicon Valley buzzword?

  3. Psst! Also Not New! Reactive Programming? Just another buzzword?

  4. Connecting “Things” …Reactively…

  5. Request Response What most of us think happens

  6. And if not, we’ll make it! Request Response What really happens

  7. But… Who does this? Request Response What also really happens

  8. User State Security Query (Challenge) Request Response Keep-Alive Support or Watchdog (UI/Device) @toddlmontgomery

  9. News, Stocks, Texts/SMS, Video, Audio, Social, … Stream What also really happens

  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. Pretty much how everything actually works… Request Stream & Ingest Response What also really happens

  12. What also REALLY happens

  13. Request, Response, Stream, and Ingest are really types Message Message Message-Driven The Break Down Message-Driven

  14. Message Driven Elastic Reactive Applications Responsive Resilient http://www.reactivemanifesto.org/

  15. Distributed Systems Evolution Message-Driven REST LISP RPC Function Call

  16. IoT…

  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. @toddlmontgomery

  19. courtesy of

  20. Sometimes it is good to reinvent the wheel

  21. What History Has Taught Us @toddlmontgomery

  22. THE IoT Language!

  23. THE IoT Protocol!

  24. THE IoT Runtime!

  25. THE IoT ______!

  26. Multi-Lingual Multi-Protocol & (and Polyglot) Multi-Standard Internet of Things Huge Scale Multi-“Platform” Highly Integrated

  27. Connected. Integrated. Great time to be a protocol geek!

  28. Multi-Lingual Multi-Protocol (and Polyglot) & Data Format Nuklei Connected. Services. Tools. Location Basic Transparency Low-Level API

  29. Deployment Container Logic Nuklei Reactive Message Stream Protocols Depends on language, Asynchronous runtime, platform, etc. Binary “Loose” Ordering

  30. Simple, consistent usage Choice of protocols becomes allows functional deployment concern composition of protocols Deployment Container Logic Nuklei Reactive Message Stream Protocols Various Basic Protocol read/write Options API Asynchronous Binary Boundary

  31. Shared Memory IPC JMS HTTP /1.1 MQTT TCP /UDP /IP Protocols? CoAP AMQP Not just in the traditional sense… Aeron 0MQ HTTP /2 WebSocket WebRTC

  32. pro·to·col noun \ ˈ pr ō -t ə - ˌ k o ̇ l, - ˌ k ō l, - ˌ käl, -k ə l\ � ... � 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 > � @toddlmontgomery

  33. Protocols are the key to Integration REST has demonstrated this! @toddlmontgomery

  34. Packet/Frame is common Layering becomes natural & building block (Ethernet, trivial. Also forces ATM, etc.) boundaries & decoupling Functional Protocol Composition Not New e.g. HTTP over TCP looks e.g. Streams over Messages same as HTTP over IPC or is a form of Fragmentation/ HTTP over WebSocket or Reassembly HTTP over JMS @toddlmontgomery

  35. FIX / SBE CBOR HPACK JMS Data Format XML Message Divorced from Data Association Map<> and other native JSON YAML associations are better than format specific APIs @toddlmontgomery

  36. Does not need to be human readable Thing 1 Thing 2 Not a human Also, …not a human Binary Encoding Concise Binary Object Representation (CBOR) FIX / Simple Binary Encoding (SBE) HPACK (Part of HTTP /2) … http://tools.ietf.org/html/rfc7049 https://github.com/real-logic/simple-binary-encoding @toddlmontgomery

  37. Simple, Natural, Define an Endpoint & Familiar for Connectivity Addressing URIs - Just , but not only Strings https://www.ietf.org Think about how much context this contains! @toddlmontgomery

  38. Deployment Container Endpoint can be docker, AWS, VM, … anywhere Isolation & Location Transparency Leverage Binding & Resolution to Migration decouple @toddlmontgomery

  39. AMI Deployment Container VM App Server OS level isolation, don’t duplicate at the application layer

  40. BSD Sockets has it right From an old protocol hacker… Basic Low-Level API “Common” Message/Packet/Frame -based @toddlmontgomery

  41. Defining a Service Endpoint ★ Address = String ★ Service Logic = Lambda Because they should be that simple @toddlmontgomery

  42. Previous Protocol @FunctionalInterface Flyweight public interface Mikro { void onMessage( Object header, int typeId, ByteBuffer AtomicBuffer buffer, int offset, on Steroids int length); } @toddlmontgomery

  43. Struct Overlays Semi-Stateful Parsers Flyweights Know how to access fields efficiently Prefer to access via dead reckoning (stateless) @toddlmontgomery

  44. Sending to a Service From anything, not just another Service For Efficiency, Reuse, and Caching ★ Proxy = Resolve(Address) ★ Proxy.send(Data) @toddlmontgomery

  45. @FunctionalInterface public interface Proxy { int send( int typeId, ByteBuffer AtomicBuffer buffer, int offset, on Steroids int length); } @toddlmontgomery

  46. Not an afterthought Also, not an afterthought Flow Control… Security… Additionally… Polyglot?… Schedulers… Java, then JavaScript, C, Think Packet Scheduling? iOS, @toddlmontgomery

  47. Message Message To Sum Up

  48. https://github.com/kaazing/nuklei Connected. Services. Tools. Very Early & Still Evolving

  49. Questions? Kaazing http://www.kaazing.com • GitHub https://github.com/kaazing • Slideshare http://www.slideshare.com/toddleemontgomery • Twitter @toddlmontgomery • Thank You! @toddlmontgomery

Recommend


More recommend