Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Nanomsg - Scalable Networking Library

753 views

Published on

nanomsg is a socket library that provides several common communication patterns. It aims to make the networking layer fast, scalable, and easy to use. Implemented in C, it works on a wide range of operating systems with no further dependencies.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Nanomsg - Scalable Networking Library

  1. 1. Nanomsg Scalable Networking Library Hamidreza Soleimani CTO @ BisPhone Technologies Tehran Linux User Group August 11, 2016
  2. 2. – Characteristics of Scalability on Performance - André B. Bondi “Scalability is the capability of a Process, OS or Network to handle a growing amount of work, or its potential to be enlarged in order to accommodate that growth.” Scalability
  3. 3. OS ————— In-Process Transport Inter-Process Transport TCP Transport Network ————— Process ————— Thread 1 Thread 2 Process1 Process 2 Node 1 Node 2
  4. 4. Log Aggregator Global Service Registry Metric Collector Monitoring Service Clients Load Balancers Data Access Layer Databases Request Handlers Push Notification Services etc. etc.
  5. 5. Nanomsg provides the “Lego bricks” for building scalable and distributed systems
  6. 6. – Distributed Systems: Concepts and Design (5th Edition) - Addison Wesley “A distributed system is a model in which components located on networked computers communicate and coordinate their actions by passing messages.” Distributed Systems
  7. 7. Nanomsg is all about communication and coordination
  8. 8. OS ————— In-Process Transport Inter-Process Transport TCP Transport Network ————— Process ————— Thread 1 Thread 2 Process1 Process 2 Node 1 Node 2 socket.bind('inproc://…') socket.bind('ipc://…') socket.bind('tcp://…')
  9. 9. Log Aggregator Global Service Registry Metric Collector Monitoring Service Clients Load Balancers Data Access Layer Databases Request Handlers Push Notification Services etc. etc.
  10. 10. Nanomsg is written in C with binding for almost all languages C++ Erlang Clojure D HaskellGo Fortran Dylan C# Javascript Java Objective-C R Ruby Python PHP Lisp Rust OCaml Smalltalk
  11. 11. Nanomsg API is POSIX-compliant
  12. 12. Nanomsg Scalability Protocols PAIR REQ/REP PUB/SUBBUS SURVEY PIPELINE
  13. 13. PAIR Bidirectional Communication Socket 1 Socket 2
  14. 14. REQ/REP Client Requests, Server Replies Server Client
  15. 15. Publisher Subscriber PUB/SUB Topic Broadcasting
  16. 16. PIPELINE One-Way Data-flow BUS Many-to-Many Communication SURVEY Ask Group a Question Producer ConsumerConsumer / Producer Node 1 Node 3 Node 2 Node 4 Surveyor RespondentRespondent
  17. 17. Example Github.com/hamidreza-s/NanoChat
  18. 18. Question? hamidreza-s.github.io

×