18
Nanomsg Scalable Networking Library Hamidreza Soleimani CTO @ BisPhone Technologies Tehran Linux User Group August 11, 2016

Nanomsg - Scalable Networking Library

Embed Size (px)

Citation preview

Page 1: Nanomsg - Scalable Networking Library

NanomsgScalable Networking Library

Hamidreza Soleimani CTO @ BisPhone Technologies

Tehran Linux User Group August 11, 2016

Page 2: Nanomsg - Scalable Networking Library

– 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

Page 3: Nanomsg - Scalable Networking Library

OS —————

In-Process Transport

Inter-Process Transport

TCP Transport

Network —————

Process —————

Thread 1

Thread 2

Process1

Process 2

Node 1

Node 2

Page 4: Nanomsg - Scalable Networking Library

Log Aggregator

Global Service Registry

Metric Collector

Monitoring Service

Clients Load Balancers

Data Access Layer

Databases

Request Handlers

Push Notification

Services

etc.

etc.

Page 5: Nanomsg - Scalable Networking Library

Nanomsg provides the “Lego bricks” for building scalable and distributed

systems

Page 6: Nanomsg - Scalable Networking Library

– 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

Page 7: Nanomsg - Scalable Networking Library

Nanomsg is all about communication and coordination

Page 8: Nanomsg - Scalable Networking Library

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://…')

Page 9: Nanomsg - Scalable Networking Library

Log Aggregator

Global Service Registry

Metric Collector

Monitoring Service

Clients Load Balancers

Data Access Layer

Databases

Request Handlers

Push Notification

Services

etc.

etc.

Page 10: Nanomsg - Scalable Networking Library

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

Page 11: Nanomsg - Scalable Networking Library

Nanomsg API is POSIX-compliant

Page 12: Nanomsg - Scalable Networking Library

Nanomsg Scalability Protocols

PAIRREQ/REP

PUB/SUBBUS

SURVEY

PIPELINE

Page 13: Nanomsg - Scalable Networking Library

PAIR Bidirectional Communication

Socket 1 Socket 2

Page 14: Nanomsg - Scalable Networking Library

REQ/REP Client Requests, Server Replies

Server Client

Page 15: Nanomsg - Scalable Networking Library

Publisher Subscriber

PUB/SUB Topic Broadcasting

Page 16: Nanomsg - Scalable Networking Library

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

Page 17: Nanomsg - Scalable Networking Library

Example

Github.com/hamidreza-s/NanoChat

Page 18: Nanomsg - Scalable Networking Library

Question?

hamidreza-s.github.io