Towards Transport-Agnostic Middleware Martin Sstrik - - PowerPoint PPT Presentation

towards transport agnostic middleware
SMART_READER_LITE
LIVE PREVIEW

Towards Transport-Agnostic Middleware Martin Sstrik - - PowerPoint PPT Presentation

Towards Transport-Agnostic Middleware Martin Sstrik sustrik@250bpm.com www.250bpm.com Messaging Middleware A layer in the network stack to manage communication between more than two endpoints. ZeroMQ/nanomsg 1 minute overview As a


slide-1
SLIDE 1

Towards Transport-Agnostic Middleware

Martin Sústrik sustrik@250bpm.com www.250bpm.com

slide-2
SLIDE 2

Messaging Middleware A layer in the network stack to manage communication between more than two endpoints.

slide-3
SLIDE 3
slide-4
SLIDE 4

ZeroMQ/nanomsg 1 minute overview

slide-5
SLIDE 5
  • Request/Reply
  • Publish/Subscribe
  • Pipeline
  • Survey
  • Et c.

As a layer in the network stack it implements multiple protocols, a.k.a. “messaging patterns”.

slide-6
SLIDE 6

Publish/Subscribe Distributing data to all interested endpoints

slide-7
SLIDE 7

Request/Reply Load-balancing tasks among stateless workers

slide-8
SLIDE 8

What about the transport layer?

slide-9
SLIDE 9

It's heterogenous!

slide-10
SLIDE 10

int main() { int s = nn_socket (AF_SP, NN_PUB); nn_bind (s, “tcp://eth0:5555”); nn_bind (s, “pgm://eth0;241.0.0.1:5555”); while (1) { nn_send (s, “ABC”, 3, 0); sleep (1); } } int main() { int s = nn_socket (AF_SP, NN_SUB); nn_connect (s, “tcp://myserver:5555”); while (1) { char buf [100]; nn_recv (s, buf, sizeof (buf), 0); } }

Publisher Subscriber Code example

slide-11
SLIDE 11

Why should this group care?

slide-12
SLIDE 12

Because it's hard for the application developer to make informed decision about transport protocol to use:

  • Reliable or unreliable?
  • Unicast of multicast?
  • Ordered or unordered?
  • Pushback or no pushback?
  • Widely used (TCP, UDP) or niche (SCTP)?
  • Et c.
slide-13
SLIDE 13

Often, informed decision can't even be made at the development time:

  • Developer has little understanding of

customer's deployment environment...

  • Application is sold to different customers,

each having different network...

  • Environment is going to change in the

future...

slide-14
SLIDE 14

Yet, by choosing a “messaging pattern”, developer provides enough information to make an informed decision about transport protocols to use!

slide-15
SLIDE 15

Example

Publish/Subcribe pattern requires transport layer not to be reliable. Reliability would mean that a single slow or dead subscriber can stop the entire distribution tree. Preferred transport protocol is UDP or DCCP.

slide-16
SLIDE 16

Different example

Request/Reply pattern requires transport layer to exercise

  • pushback. That way the tasks can be redirected from
  • verloaded workers to underutilised workers.

Preferred transport protocol is TCP or SCTP.

slide-17
SLIDE 17

What are the implications?

slide-18
SLIDE 18

Back to the heterogenous example:

slide-19
SLIDE 19

int main() { int s = nn_socket (AF_SP, NN_PUB); nn_bind (s, “eth0:NYSE-stock-quotes”); while (1) { nn_send (s, “ABC”, 3, 0); sleep (1); } } int main() { int s = nn_socket (AF_SP, NN_SUB); nn_connect (s, “myserver:NYSE-stock-quotes”); while (1) { char buf [100]; nn_recv (s, buf, sizeof (buf), 0); } }

Publisher Subscriber No need to specify the transport protocol:

slide-20
SLIDE 20

What we get is clean mechanism vs. policy separation!

slide-21
SLIDE 21

int main() { int s = nn_socket (AF_SP, NN_PUB); nn_bind (s, “eth0:NYSE-stock-quotes”); while (1) { nn_send (s, “ABC”, 3, 0); sleep (1); } }

Developer specifies the mechanism: “NYSE stock quote feed is to use the Publish/Subscribe pattern.” Mechanism is specified via transport-agnostic API.

slide-22
SLIDE 22

NYSE-stock-quotes: LAN: pgm WAN: tcp

Administrator specifies the policy: “NYSE stock quote feed is to use PGM on the LAN and TCP over the WAN.” Policy is specified via transport-aware network configuration tools.

slide-23
SLIDE 23

Questions?

Email: sustrik@250bpm.com