Reactive, Message- Driven & Scalable Todd L. Montgomery - - PowerPoint PPT Presentation

reactive message driven scalable
SMART_READER_LITE
LIVE PREVIEW

Reactive, Message- Driven & Scalable Todd L. Montgomery - - PowerPoint PPT Presentation

Reactive, Message- Driven & Scalable Todd L. Montgomery @toddlmontgomery Why Reactive!? Why Message-Driven!? The most scalable, resilient, & fast systems seem to follow some common principles http://www.reactivemanifesto.org/


slide-1
SLIDE 1

Reactive, Message- Driven & Scalable

Todd L. Montgomery @toddlmontgomery

slide-2
SLIDE 2

Why Reactive!? Why Message-Driven!?

slide-3
SLIDE 3

The most scalable, resilient, & fast systems seem to follow some common principles…

slide-4
SLIDE 4

http://www.reactivemanifesto.org/

slide-5
SLIDE 5

Large numbers are large…

slide-6
SLIDE 6
slide-7
SLIDE 7

Updates/Sec =

Devices * Frequency * Market Share

Either ingest or streaming. 2x for Request/Response

slide-8
SLIDE 8

Updates/Sec =

Devices * Frequency * Market Share

9 Billion (Today) 50 Billion by 2020 (Cisco) 26 Billion by 2020 (Smartphone/Tablet - Gartner) 75 Billion by 2020 (Morgan Stanley)

slide-9
SLIDE 9

Updates/Sec =

50 Billion * 6/min * 1% = 50 Million/sec

slide-10
SLIDE 10

Bandwidth =

50 Billion * 6/min * 1% * 200 bytes = 9.3 GB/s (74.5 Gb/s)

slide-11
SLIDE 11

And… Geographic Distribution

30% 15% 10% 15% 20% 10%

slide-12
SLIDE 12

In an emerging era of micro-services, protocols of interaction matter Like Data Structures Like Schemas

slide-13
SLIDE 13

@toddlmontgomery

pro·to·col noun \ˈprō-tə-ˌkȯ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>

slide-14
SLIDE 14

Where we are coming from…

slide-15
SLIDE 15

@toddlmontgomery

Request Response

HTTP

RFC 2068, 2616, …, 7230-7240

Synchronous Request/Response

Bi-Directional… kinda, but…

Event Event

… only

  • ne direction

at-a-time

June 2014

slide-16
SLIDE 16

✓ ASCII Encoded ✓ Very Synchronous ✓ Many TCP Connections

slide-17
SLIDE 17

@toddlmontgomery

Request ACK Response ACK

Sync Request Sync Response Web Services

But… Async Request/Response… kinda

Event Event

http://en.wikipedia.org/wiki/List_of_web_service_specifications

No, seriously, lots of these!!

slide-18
SLIDE 18

But… HTTP is THE Most Successful Protocol EVAR!

slide-19
SLIDE 19

@toddlmontgomery

“Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should.” — Jurassic Park

Just because you could use HTTP, doesn’t mean you should…

slide-20
SLIDE 20

@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"

slide-21
SLIDE 21

@toddlmontgomery

slide-22
SLIDE 22

@toddlmontgomery

418 I’m a teapot BREW WHEN

"This has a serious purpose – it identifies many of the ways in which HTTP has been extended inappropriately.” — Larry Masinter, author http://larry.masinter.net/

slide-23
SLIDE 23

Extending Appropriately*

* - some would disagree…

slide-24
SLIDE 24

@toddlmontgomery

Async Request/ Response Streaming WebSocket

RFC 6455

Full Duplex, Asynchronous “TCP over the Web”

Events Events 101 Switch HTTP Upgrade

Ingest

https://tools.ietf.org/html/rfc6455

Really a Transport Protocol

slide-25
SLIDE 25
  • r#extension#

GET /uri HTTP/1.1 Upgrade: websocket Connection: Upgrade … HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade …

Simple Framing Handshake

slide-26
SLIDE 26

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+

slide-27
SLIDE 27

WebSocket was a scout…

slide-28
SLIDE 28

✓ Persistent Connections ✓ “Different” Framing ✓ Binary Encoding

slide-29
SLIDE 29

scouting for…

The Deuce

slide-30
SLIDE 30

HTTP

slide-31
SLIDE 31

There is emerging implementation experience and interest in a protocol that retains the semantics of HTTP without the legacy of HTTP/1.x message framing and syntax, which have been identified as hampering performance and encouraging misuse of the underlying transport. — IETF httpbis Charter http://datatracker.ietf.org/wg/httpbis/charter/

slide-32
SLIDE 32

Model on SPDY

slide-33
SLIDE 33

@toddlmontgomery

Async Request Async Response SPDY & HTTP/2

IETF Drafts

Async Request/Response Streaming (Server Push)

Events Events

http://www.ietf.org/id/draft-ietf-httpbis-http2-16.txt

slide-34
SLIDE 34

✓ Persistent Connection ✓ Binary Encoding ✓ Multiple Streams ✓ Efficient Headers (HPACK) ✓ Server Push

slide-35
SLIDE 35

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length (24) | +---------------+---------------+---------------+ | Type (8) | Flags (8) | +-+-+-----------+---------------+-------------------------------+ |R| Stream Identifier (31) | +=+=============================================================+ | Frame Payload (0...) ... +---------------------------------------------------------------+

slide-36
SLIDE 36

HPACK

slide-37
SLIDE 37

http://www.ietf.org/id/draft-ietf-httpbis-header-compression-10.txt

✓ Binary Encoding ✓ Huffman Encoding ✓ Dynamic Table ✓ Static Table ✓ HTTP Method included

slide-38
SLIDE 38

@toddlmontgomery

Async Request Async Response WebSocket over HTTP/2

IETF Draft

Streaming Ingest Full Duplex, Asynchronous with Multiple Channels/Streams

Events Events

http://www.ietf.org/id/draft-hirano-httpbis-websocket-over-http2-00.txt

slide-39
SLIDE 39

https://github.com/http2/http2-spec/wiki/Implementations

slide-40
SLIDE 40

IETF Constrained RESTful Environments (CoRE) Working Group

slide-41
SLIDE 41

CoRE is providing a framework for resource-oriented applications intended to run on constrained IP networks. A constrained IP network has limited packet sizes, may exhibit a high degree of packet loss, and may have a substantial number of devices that may be powered off at any point in time but periodically "wake up" for brief periods of time. — IETF CoRE Charter http://datatracker.ietf.org/wg/core/charter/

“Constrained” isn’t what you might think…

slide-42
SLIDE 42

@toddlmontgomery

Constrained Application Protocol (CoAP) RFC 7252

https://tools.ietf.org/html/rfc7252

Events Events

Async Response Async Request Async Request Async Response Pub/Sub

slide-43
SLIDE 43

✓ HTTP Mapping ✓ UDP, DTLS, & WebSocket ✓ Resource Discovery ✓ Linking

slide-44
SLIDE 44

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Ver| T | TKL | Code | Message ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Token (if any, TKL bytes) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options (if any) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1 1 1 1 1 1 1 1| Payload (if any) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

slide-45
SLIDE 45

http://en.wikipedia.org/wiki/Constrained_Application_Protocol

slide-46
SLIDE 46

Only scratched the surface…

slide-47
SLIDE 47

✓ WebRTC ✓ XMPP ✓ MQTT ✓ Aeron ✓ …

slide-48
SLIDE 48

IoT…

slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51

courtesy of

slide-52
SLIDE 52

@toddlmontgomery

What History Has Taught Us

slide-53
SLIDE 53

THE IoT Protocol!

slide-54
SLIDE 54

THE IoT ______!

slide-55
SLIDE 55

Internet of Things

slide-56
SLIDE 56

✓ Multi-Protocol ✓ Multi-Language (Polyglot) ✓ Multi-Platform ✓ Huge Scale ✓ Highly Integrated

slide-57
SLIDE 57

Takeaways!

slide-58
SLIDE 58

Protocols of Interaction Matter

slide-59
SLIDE 59

Look for the right tool (protocol) for the job Like a Data Structure… Like a Schema…

slide-60
SLIDE 60

@toddlmontgomery

Questions?

  • Reactive Manifesto http://www.reactivemanifesto.com
  • Kaazing http://www.kaazing.com
  • GitHub https://github.com/kaazing
  • Aeron https://github.com/real-logic/Aeron
  • SlideShare http://www.slideshare.com/toddleemontgomery
  • Twitter @toddlmontgomery

Thank You!