28
What is NATS And why it is good for IoT Raül Pérez - @repejota IoT Barcelona - 04/07/2016

NATS & IoT

Embed Size (px)

Citation preview

Page 1: NATS & IoT

What is NATSAnd why it is good for IoT

Raül Pérez - @repejota IoT Barcelona - 04/07/2016

Page 2: NATS & IoT

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

Page 3: NATS & IoT

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

Page 4: NATS & IoT

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

Page 5: NATS & IoT

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

Page 6: NATS & IoT

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

Page 7: NATS & IoT

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

Page 8: NATS & IoT

NATS

8

Page 9: NATS & IoT

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

Page 10: NATS & IoT

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

Page 11: NATS & IoT

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

Page 12: NATS & IoT

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

Page 13: NATS & IoT

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

Page 14: NATS & IoT

IoT

14

Page 15: NATS & IoT

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

Page 16: NATS & IoT

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

Page 17: NATS & IoT

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

Page 18: NATS & IoT

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

Page 19: NATS & IoT

IoT + NATS

19

Page 20: NATS & IoT

IoT + NATS● Always on.

20

● Always available (dial tone), fire and forget.

Raül Pérez - @repejota IoT Barcelona - 04/07/2016

Page 21: NATS & IoT

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

Page 22: NATS & IoT

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

Page 23: NATS & IoT

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

Page 24: NATS & IoT

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

Page 25: NATS & IoT

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

Page 26: NATS & IoT

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

Page 27: NATS & IoT

Questions?

Raül Pérez - @repejota IoT Barcelona - 04/07/2016

Page 28: NATS & IoT

Thank you!

28Raül Pérez - @repejota IoT Barcelona - 04/07/2016