Upload
hadieu
View
228
Download
0
Embed Size (px)
Citation preview
@toddlmontgomery
Request
Response
Support (UI/Device)
Security (Challenge)
Keep-Alive or Watchdog
User State Query
Ingest
What also really happens
Temperature, Heart Rate, Web Logs, Sensor Data, Seismic Readings, Steps, Stairs, Gyro
Data, GPS, Acceleration, Breathing, EKG, EEG, …
Request
Response
What also really happens
Stream & Ingest
Pretty much how everything actually works…
Message
Message
The Break Down
Request, Response, Stream, and Ingest are really types
Message-Driven
Message-Driven
Reactive Applications
Message Driven
Responsive Resilient
Elastic
http://www.reactivemanifesto.org/
@toddlmontgomery
HTCPCP RFC 2324, Extended by RFC 7168
http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol
"there is a strong, dark, rich requirement for a protocol designed espressoly [sic] for the brewing of coffee"
Internet of Things
Multi-Lingual (and Polyglot)
Multi-Protocol & Multi-Standard
Multi-“Platform” Huge Scale Highly Integrated
Connected. Services. Tools.Nuklei
Multi-Lingual (and Polyglot)
Location Transparency
Multi-Protocol & Data Format
Basic Low-Level API
Protocols
Nuklei
Deployment Container
LogicReactive
Message Stream
Depends on language, runtime, platform, etc. Asynchronous
Binary “Loose” Ordering
Protocols
NukleiLogic
Reactive Message Stream
Asynchronous Binary Boundary
Basic read/write
API
Various Protocol Options
Choice of protocols becomes deployment concern
Deployment Container
Simple, consistent usage allows functional
composition of protocols
Protocols?
Shared Memory IPC
WebSocket
JMS
WebRTC
Not just in the traditional sense…
HTTP/1.1MQTT
HTTP/2
AMQPCoAP
TCP/UDP/IP
Aeron 0MQ
@toddlmontgomery
pro·to·col noun \ˈprō-tə-ˌko ̇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
Functional Protocol Composition
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
Packet/Frame is common building block (Ethernet,
ATM, etc.)
Layering becomes natural & trivial. Also forces
boundaries & decoupling
Not New
@toddlmontgomery
Data Format
JSON
FIX / SBE CBOR
YAML
XML JMS Message
Divorced from Data Association
Map<> and other native associations are better than
format specific APIs
HPACK
@toddlmontgomery
Binary Encoding
Thing 1 Thing 2Not a human Also, …not a human
Does not need to be human readable
http://tools.ietf.org/html/rfc7049
Concise Binary Object Representation (CBOR)FIX / Simple Binary Encoding (SBE)
https://github.com/real-logic/simple-binary-encoding
HPACK (Part of HTTP/2)…
@toddlmontgomery
AddressingURIs - Just, but not only Strings
https://www.ietf.org Think about how much context this contains!
Define an Endpoint for Connectivity
Simple, Natural, & Familiar
@toddlmontgomery
Isolation & Location Transparency
Deployment Container docker, AWS, VM, …
Leverage Binding & Resolution to
decoupleMigration
Endpoint can be anywhere
@toddlmontgomery
Basic Low-Level API
“Common”Message/Packet/Frame -based
BSD Sockets has it right
From an old protocol hacker…
@toddlmontgomery
Defining a Service
★ Address = String ★ Service Logic = Lambda
Endpoint
Because they should be that simple
@toddlmontgomery
@FunctionalInterface public interface Mikro { void onMessage( Object header, int typeId, AtomicBuffer buffer, int offset, int length); }
Previous Protocol Flyweight
ByteBuffer on Steroids
@toddlmontgomery
Flyweights
Struct Overlays Semi-Stateful Parsers
Know how to access fields efficientlyPrefer to access via dead reckoning (stateless)
@toddlmontgomery
Sending to a Service
★ Proxy = Resolve(Address) ★ Proxy.send(Data)
From anything, not just another Service
For Efficiency, Reuse, and Caching
@toddlmontgomery
@FunctionalInterface public interface Proxy { int send( int typeId, AtomicBuffer buffer, int offset, int length); }
ByteBuffer on Steroids
@toddlmontgomery
Additionally…
Flow Control… Security…
Schedulers…Polyglot?…
Think Packet Scheduling?Java, then JavaScript, C, iOS,
Not an afterthought Also, not an afterthought
https://github.com/kaazing/nuklei
Very Early & Still Evolving
Connected. Services. Tools.
@toddlmontgomery
Questions?
• Kaazing http://www.kaazing.com • GitHub https://github.com/kaazing • Slideshare http://www.slideshare.com/toddleemontgomery • Twitter @toddlmontgomery
Thank You!