What is NATS
And why it is good for IoT
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?
Raül Pérez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
2
Raül Pérez - @repejota IoT Barcelona - 04/07/2016
Who am I?
Raül Pérez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
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érez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
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érez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
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érez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
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érez
Lead Software Engineer
at Carrenza Ltd.
Twitter: @repejota
Github: https://github.com/repejota
Email: repejota@gmail.com
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!
28
Raül Pérez - @repejota IoT Barcelona - 04/07/2016

NATS & IoT

  • 1.
    What is NATS Andwhy it is good for IoT Raül Pérez - @repejota IoT Barcelona - 04/07/2016
  • 2.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 2 Raül Pérez - @repejota IoT Barcelona - 04/07/2016
  • 3.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 3 ● Almost 4 years working on devops & distributed projects. Raül Pérez - @repejota IoT Barcelona - 04/07/2016
  • 4.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 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
  • 5.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 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
  • 6.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 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
  • 7.
    Who am I? RaülPérez Lead Software Engineer at Carrenza Ltd. Twitter: @repejota Github: https://github.com/repejota Email: repejota@gmail.com 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
  • 8.
  • 9.
    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
  • 10.
    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
  • 11.
    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
  • 12.
    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
  • 13.
    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
  • 14.
  • 15.
    IoT ● Everything isconnected. 15 ● Virtual representations of objects (things) in a internet-like structure. Raül Pérez - @repejota IoT Barcelona - 04/07/2016
  • 16.
    IoT ● Everything isconnected. ● 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
  • 17.
    IoT ● Everything isconnected. ● 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
  • 18.
    IoT ● Everything isconnected. ● 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
  • 19.
  • 20.
    IoT + NATS ●Always on. 20 ● Always available (dial tone), fire and forget. Raül Pérez - @repejota IoT Barcelona - 04/07/2016
  • 21.
    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
  • 22.
    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
  • 23.
    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
  • 24.
    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
  • 25.
    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
  • 26.
    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
  • 27.
    Questions? Raül Pérez -@repejota IoT Barcelona - 04/07/2016
  • 28.
    Thank you! 28 Raül Pérez- @repejota IoT Barcelona - 04/07/2016