nats & iot
TRANSCRIPT
What is NATSAnd why it is good for IoT
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
2Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
3
● Almost 4 years working on devops & distributed projects.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
4
● Almost 4 years working on devops & distributed projects.● Still more a dev than op dude.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
5
● Almost 4 years working on devops & distributed projects.● Still more a dev than op dude.● Proud to be a Gopher after a looong PHP/Ruby/Python/Node.js past
experience. :P
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
6
● Almost 4 years working on devops & distributed projects.● Still more a dev than op dude.● Proud to be a Gopher after a looong PHP/Ruby/Python/Node.js past
experience. :P● Based in Barcelona.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?Raül PérezLead Software Engineer at Carrenza Ltd.
Twitter: @repejotaGithub: https://github.com/repejotaEmail: [email protected]
7
● Almost 4 years working on devops & distributed projects.● Still more a dev than op dude.● Proud to be a Gopher after a looong PHP/Ruby/Python/Node.js past
experience. :P● Based in Barcelona.● Love startups & love remote work!
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
NATS
8
What is NATS?● Cloud-native message platform.
9
● Designed to natively support modern cloud architectures.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
What is NATS?● Cloud-native message platform.● Highly performant.
10
● Designed to natively support modern cloud architectures.● It is fast! Can handle millions of messages per second.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
What is NATS?● Cloud-native message platform.● Highly performant.● Extremely lightweight.
11
● Designed to natively support modern cloud architectures.● It is fast! Can handle millions of messages per second.● A single binary, easy to deploy without unnecessary complexity.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
What is NATS?● Cloud-native message platform.● Highly performant.● Extremely lightweight.● Support for various messaging models and use cases.
12
● Designed to natively support modern cloud architectures.● It is fast! Can handle 10 million messages per second on a Macbook● A single binary, easy to deploy without unnecessary complexity.● Request/Response, Publish/Subscribe, Queues.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
What is NATS?● Cloud-native message platform.● Highly performant.● Extremely lightweight.● Support for various messaging models and use cases.
13
● Designed to natively support modern cloud architectures.● It is fast! Can handle millions of messages per second.● A single binary, easy to deploy without unnecessary complexity.● Request/Response, Publish/Subscribe, Queues.● Simple text based protocol.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT
14
IoT● Everything is connected.
15
● Virtual representations of objects (things) in a internet-like structure.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT● Everything is connected.● Wireless connections between objects.
16
● Virtual representations of objects (things) in a internet-like structure.● Flexible structure.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT● Everything is connected.● Wireless connections between objects.● Self configured and discoverable.
17
● Virtual representations of objects (things) in a internet-like structure.● Flexible structure.● Event Driven.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT● Everything is connected.● Wireless connections between objects.● Self configured and discoverable.● Internet is no longer for people but also for machines.
18
● Virtual representations of objects (things) in a internet-like structure.● Flexible structure.● Event Driven.● Multiple protocols.● Multiple communication patterns.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT + NATS
19
IoT + NATS● Always on.
20
● Always available (dial tone), fire and forget.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT + NATS● Always on.● Pure pub/sub.
21
● Always available (dial tone), fire and forget.● Never assumes the audience.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT + NATS● Always on.● Pure pub/sub.● Clustered mode server.
22
● Always available (dial tone), fire and forget.● Never assumes the audience.● Distributed queueing across clusters, cluster aware clients.
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
IoT + NATS● Always on.● Pure pub/sub.● Clustered mode server.● Auto-pruning of subscribers.
23
● Always available (dial tone), fire and forget.● Never assumes the audience.● Distributed queueing across clusters, cluster aware clients.● Slow clients are being cut off.● Clients implement retry logic.● Extremely low latency!
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
NATS Latency - basically zero!
An example vs RabbitMQ
Source: http://bravenewgeek.com/benchmarking-message-queue-latency/
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
NATS IoT Examples● Talk on using Lua and NATS for IoT in the Home by Eric Pinto Garcia (https:
//github.com/DawnAngel )○ Video: https://www.youtube.com/watch?v=SLQ9VXrByPc
○ Slides: https://github.com/DawnAngel/presentations/blob/master/Lua,%20NATS%20&%20IoT.pdf
● Ripple - Water Conservation Device control using NATS, Artik10 boards, Golang
○ http://devpost.com/software/ripples
● NATS Arduino Client by Josh Glendenning (https://github.com/joshglendenning ):
○ https://github.com/joshglendenning/arduino-nats
● Example of NATS messaging with Raspberry Pi by John Lockwood:○ https://dzone.com/articles/simple-composable-microservices-an-iot-example-usi
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Resources● http://microservices.io● https://en.wikipedia.org/wiki/Cloud_computing ● http://nats.io
26
● http://carrenza.com● http://apcera.com
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Questions?
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Thank you!
28Raül Pérez - @repejota IoT Barcelona - 04/07/2016