towards transport agnostic middleware
play

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


  1. Towards Transport-Agnostic Middleware Martin Sústrik sustrik@250bpm.com www.250bpm.com

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

  3. ZeroMQ/nanomsg 1 minute overview

  4. As a layer in the network stack it implements multiple protocols, a.k.a. “messaging patterns”. ● Request/Reply ● Publish/Subscribe ● Pipeline ● Survey ● Et c.

  5. Publish/Subscribe Distributing data to all interested endpoints

  6. Request/Reply Load-balancing tasks among stateless workers

  7. What about the transport layer?

  8. It's heterogenous!

  9. Code example int main() { int s = nn_socket (AF_SP, NN_PUB); nn_bind (s, “tcp://eth0:5555”); Publisher 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”); Subscriber while (1) { char buf [100]; nn_recv (s, buf, sizeof (buf), 0); } }

  10. Why should this group care?

  11. 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.

  12. 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...

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

  14. 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 .

  15. Different example Request/Reply pattern requires transport layer to exercise pushback. That way the tasks can be redirected from overloaded workers to underutilised workers. Preferred transport protocol is TCP or SCTP .

  16. What are the implications?

  17. Back to the heterogenous example:

  18. No need to specify the transport protocol: int main() { int s = nn_socket (AF_SP, NN_PUB); nn_bind (s, “eth0:NYSE-stock-quotes”); Publisher 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”); Subscriber while (1) { char buf [100]; nn_recv (s, buf, sizeof (buf), 0); } }

  19. What we get is clean mechanism vs. policy separation!

  20. Developer specifies the mechanism: “NYSE stock quote feed is to use the Publish/Subscribe pattern.” 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); } } Mechanism is specified via transport-agnostic API.

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

  22. Questions? Email: sustrik@250bpm.com

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend