Upload
hamidreza-soleimani
View
249
Download
6
Embed Size (px)
Citation preview
NanomsgScalable Networking Library
Hamidreza Soleimani CTO @ BisPhone Technologies
Tehran Linux User Group August 11, 2016
– 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
OS —————
In-Process Transport
Inter-Process Transport
TCP Transport
Network —————
Process —————
Thread 1
Thread 2
Process1
Process 2
Node 1
Node 2
Log Aggregator
Global Service Registry
Metric Collector
Monitoring Service
Clients Load Balancers
Data Access Layer
Databases
Request Handlers
Push Notification
Services
etc.
etc.
Nanomsg provides the “Lego bricks” for building scalable and distributed
systems
– 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
Nanomsg is all about communication and coordination
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://…')
Log Aggregator
Global Service Registry
Metric Collector
Monitoring Service
Clients Load Balancers
Data Access Layer
Databases
Request Handlers
Push Notification
Services
etc.
etc.
Nanomsg is written in C with binding for
almost all languages C++
ErlangClojure
D
HaskellGoFortran Dylan
C#
Javascript
Java
Objective-C
R
Ruby
Python PHP
Lisp
Rust
OCamlSmalltalk
Nanomsg API is POSIX-compliant
Nanomsg Scalability Protocols
PAIRREQ/REP
PUB/SUBBUS
SURVEY
PIPELINE
PAIR Bidirectional Communication
Socket 1 Socket 2
REQ/REP Client Requests, Server Replies
Server Client
Publisher Subscriber
PUB/SUB Topic Broadcasting
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
Example
Github.com/hamidreza-s/NanoChat
Question?
hamidreza-s.github.io