SlideShare a Scribd company logo
1 of 28
Download to read offline
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Reactive IoT
How to build the next generation
M2M communication using
the Actor based model
Nicola La Gloria
Andrea Zoleo
Kynetics, Santa Clara, CA
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Agenda
- Introduction:
- Legacy IoT and pains.
- How can we design a better model?
- Reactive Manifesto
- Some elements of a reactive architecture
- Definition of Plato Devices.
- What is Reactive IoT? (RIoT)
- 2 Case of Study
- Our Open Source implementation of RIoT: O-Robot
- Demo
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Legacy IoT
❯ Monolithic Architecture
》 3-tiers (Presentation, Application, Data)
》 Multiple AS (to scale)
》 Single RDBMS
❯ Traditional Microservices
》 Multiple isolated services
》 Http interconnected
》 No single programming model
》 Multiple RDBMS
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Pains of Legacy IoT
The problem: Trade off between scalability (adding different types of
devices) and the ability to plug-in arbitrary logic in the device
model
The legacy solution: device model too generic
❯ Generic list of attributes/setpoints in the device model (defined
a priori)
❯ Exchange of generic files (aka any kind of resource)
❯ Simple monitor and control of a single device without no advanced
definition of collaboration and coordination between devices
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
What would be a more effective model?
❯ Communication between server and devices and collaboration between
devices can’t be direct. It should be handled through a device
representation on the server in a scalable context.
❯ Behaviour orchestration of heterogeneous devices should be similar
to how human workers exchange messages and directives (commands)
❯ Unexpected events are the standard and the exception must be
handled through a hierarchy of responsibilities.
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
What should we ask to the new model?
An effective model should allow to:
❯ Write advanced business logic (using a DSL i.e)
❯ Not have any “a priori” hypothesis on the device.
❯ Scale without any service interruption.
❯ Be fast to provide responses to devices and clients in order
for them to react.
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
What should be the drivers?
❯ Asynchronous, responsive and full duplex messaging system.
❯ Be robust to any loss of connection between device and
backend.
❯ Workers isolation (tasks small enough to be handled
independently)
❯ Hierarchical structure for responsibilities and
countermeasures
❯ Tasks organized in a workflow
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
What is Reactive
- Reactive manifesto (2.0)
- ERRM (Elastic, Responsive, Resilient and Message Driven)
© Lightbend
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
How can we achieve this?
❯ Actors (human workers)
❯ Messages (communication)
❯ Reactive Streams (data flux manipulation)
❯ Microservices (isolation, reuse, deployment)
❯ Cluster management (scale with no service interruption)
❯ CQRS/ED (performances, scale)
❯ NOSQL (schemaless)
= AKKA O/
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Microservices vs Akka
❯ Multiple isolated services/Akka remote provides clustering
❯ Http (JSON) interconnected/Binary serialized messages
❯ Some aggregate service/Akka applies localization transparency
❯ Multiple RDBMS/CQRS
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Plato Devices
“The ideal world is stronger than reality”
❯ In this context if we associated a device to a specific actor,
this actor becomes a kind of projection of the real device but
living in the back end (the “Ideal World”)
❯ This is a great solution to responsiveness and backpressure
❯ Plato Device provides a rich definition even for a very simple
device
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
But more...
❯ Actor lives in the server (always reachable by the client).
❯ It’s state can be monitored even when the physical device is
not reachable (fallback).
❯ The system is robust to device failures, it can always provide
a prompt response to the user in a real time fashion.
❯ Complex orchestration logic can be handled on server
❯ The server can instantiate several actors leveraging few
thread pools.
❯ Actor lives in its execution thread with a stateful
connection.
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
A simplified architecture
Device
Client
Protocol
FAC
Server
PD
HTTP
WebS
ock
SFS
Device
Device
Device
PD
PD
PD
CQRS
Domain
Entities
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Reactive IoT (RIoT)
- Reactive IoT has the aim of applying the principles of the
Reactive Manifesto in order to provide a new foundation to the
interaction between elements of an IoT system and facilitate
their development.
- The device logic (and more) may be totally represented in the
Plato device (isolation), which is message driven towards
other actors, and responsible of the communication (MQTT i.e)
to the real device.
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Advantages of the RIoT approach
❯ Grow any device with custom logic developed in Java, Scala or
a custom DSL.
❯ With a careful development, scale without halting service
》 CQRS/ED (i.e Cassandra)
》 Schema evolution (Akka/Stamina)
》 Akka message serialization (between remote Actors)
》 Routers, Sharding, Roles
❯ Multiple protocol (mqtt, http, websocket, akka, tcp/ip, etc..)
with streaming support and reactive responsiveness.
❯ Hierarchical fault handling and recover (let it crash).
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
“Versatile” becomes the cornerstone
Let’s explore two Case of Study:
1. Microdevices, HUB, Backend, Client, HTTP
2. Devices, Backend, Client, MQTT
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Case of Study (1)
DevGat
Client
ES
HTTP
FAC
ActorServer
EVJ
PQ
µDev µDev µDev
EVP
PD
HTTP
WebS
ock
DEA
SFS
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Case of Study (2)
Device
Client
ES
FAC
ActorServer
EVJ
PQ
PD
HTTP
WebS
ockMC
MqTT
Broker
PDR
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
A (GPL) implementation of RIoT: O-Robot
❯ We developed a project which is our first implementation of a
RiOT system: O-Robot.
》 A robot (for monitoring or surveillance purposes) sends constantly position
and environmental data to the backend.
》 The client may request to supervise a particular robot which start to send a
video stream.
❯ It uses: CQRS, Messages, Actors, Microservices.
❯ Right now it runs on a single instance (no sharding, routing,
roles, we are getting there!)
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
O-Robot Architecture - Deploy
Robot
Device
Mqtt
Broker
Akka Play
Server
Browser
mqtt
mqtt akka
http/ws
Elastic
Search
Cassandra
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
O-Robot Architecture - Modules
❯ Modules:
》 Core → main actors
》 Model → domain model objects
》 Mqtt → actors and protocol handling
》 Persistence → persistent actors events (CQRS/ED)
》 Protocol → akka protocol
》 Elastic → mapping ES
》 Play → web application
》 Sim → robot device simulator
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
O-Robot Architecture - Actors
ORobot
Sup.
Facade
Robots
Sup.
Robot
Registry
Sup.
Mqtt
Connector
Sup.
Robot
Robot
Registry
Mqtt
Connector
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Demo:
❯ Demo setup:
》 Robot device simulated using warp board (running JVM 8)
■ Robot communicates via WIFI
■ WIFI is managed by a local AP
》 Backend running on a laptop connected to the AP
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Warp
❯ Small form factor: 16mm x 38mm x 3.5mm
(Board Area < 1 sq-in)
❯ 10 Layer HDI PCB (0.4mm BGA, LGA, 0201)
❯ 1Ghz ARM Cortex-A9 (Freescale i.MX6SL)
❯ 512MB Memory + 4GB Flash
❯ USB OTG, 6-axis ACC+Mag, PMIC, Wifi+BT/BLE
❯ B2B Expansion
Wearable Tech Conference, San Jose 2016© 2016 warpx.io
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Demo setup
Sensor
Board
Warp AP
Netbook
(Warp)
Mac
(Backend)
WiFi WiFi
WiFi
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Warp References
❯ Mailing list: >warpx.io on Google group
❯ Store: http://revotics.com/store
❯ Community website:www.warp.io
❯ Documentation:www.warpx.io/resources
❯ This presentation: www.warpx.io/resources
❯ GitHub: https://github.com/warpboard
JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved
Thank you

More Related Content

Similar to Reactive IoT, Java One 2016

Designing distributed systems
Designing distributed systemsDesigning distributed systems
Designing distributed systemsMalisa Ncube
 
FraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of MiddlewareFraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of Middlewarephilippe_merle
 
A Reflective Platform for Highly Adaptable Multi-Cloud Systems
A Reflective Platform for Highly Adaptable Multi-Cloud SystemsA Reflective Platform for Highly Adaptable Multi-Cloud Systems
A Reflective Platform for Highly Adaptable Multi-Cloud Systemsphilippe_merle
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneKonrad Malawski
 
Services Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldServices Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldLexumo
 
Actor model in F# and Akka.NET
Actor model in F# and Akka.NETActor model in F# and Akka.NET
Actor model in F# and Akka.NETRiccardo Terrell
 
SDN and Security: A Marriage Made in Heaven. Or Not.
SDN and Security: A Marriage Made in Heaven. Or Not.SDN and Security: A Marriage Made in Heaven. Or Not.
SDN and Security: A Marriage Made in Heaven. Or Not.Priyanka Aash
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWSAmazon Web Services Korea
 
From Angular to React and back again
From Angular to React and back againFrom Angular to React and back again
From Angular to React and back againSimona Cotin
 
Angular and react an overview
Angular and react an overviewAngular and react an overview
Angular and react an overviewArtur Daschevici
 
Self-Tuning and Managing Services
Self-Tuning and Managing ServicesSelf-Tuning and Managing Services
Self-Tuning and Managing ServicesReza Rahimi
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh Dasari
 
Loadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro servicesLoadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro servicesChiradeep Vittal
 
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusUni Systems S.M.S.A.
 
NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in DepthTrayan Iliev
 
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best PracticesAWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best PracticesAmazon Web Services
 

Similar to Reactive IoT, Java One 2016 (20)

Suresh_Resume
Suresh_ResumeSuresh_Resume
Suresh_Resume
 
Rajeev_Resume
Rajeev_ResumeRajeev_Resume
Rajeev_Resume
 
Designing distributed systems
Designing distributed systemsDesigning distributed systems
Designing distributed systems
 
FraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of MiddlewareFraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of Middleware
 
A Reflective Platform for Highly Adaptable Multi-Cloud Systems
A Reflective Platform for Highly Adaptable Multi-Cloud SystemsA Reflective Platform for Highly Adaptable Multi-Cloud Systems
A Reflective Platform for Highly Adaptable Multi-Cloud Systems
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
Services Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldServices Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 World
 
Actor model in F# and Akka.NET
Actor model in F# and Akka.NETActor model in F# and Akka.NET
Actor model in F# and Akka.NET
 
SDN and Security: A Marriage Made in Heaven. Or Not.
SDN and Security: A Marriage Made in Heaven. Or Not.SDN and Security: A Marriage Made in Heaven. Or Not.
SDN and Security: A Marriage Made in Heaven. Or Not.
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
 
From Angular to React and back again
From Angular to React and back againFrom Angular to React and back again
From Angular to React and back again
 
Angular and react an overview
Angular and react an overviewAngular and react an overview
Angular and react an overview
 
Self-Tuning and Managing Services
Self-Tuning and Managing ServicesSelf-Tuning and Managing Services
Self-Tuning and Managing Services
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead
 
Loadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro servicesLoadbalancers: The fabric for your micro services
Loadbalancers: The fabric for your micro services
 
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
 
Resume
ResumeResume
Resume
 
Deepthi_KV
Deepthi_KVDeepthi_KV
Deepthi_KV
 
NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in Depth
 
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best PracticesAWS Cloud Kata 2014 | Jakarta - Startup Best Practices
AWS Cloud Kata 2014 | Jakarta - Startup Best Practices
 

More from Kynetics

Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyEclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyKynetics
 
Deploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionDeploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionKynetics
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxKynetics
 
ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything Kynetics
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Kynetics
 
Eclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationEclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationKynetics
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 PortlandKynetics
 
Eclipsecon 2017 presentation
Eclipsecon 2017 presentationEclipsecon 2017 presentation
Eclipsecon 2017 presentationKynetics
 
Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Kynetics
 
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Kynetics
 
Linaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsLinaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsKynetics
 

More from Kynetics (11)

Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyEclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
 
Deploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionDeploy Eclipse hawBit in Production
Deploy Eclipse hawBit in Production
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded Linux
 
ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
 
Eclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationEclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 Presentation
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 Portland
 
Eclipsecon 2017 presentation
Eclipsecon 2017 presentationEclipsecon 2017 presentation
Eclipsecon 2017 presentation
 
Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.
 
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
 
Linaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsLinaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - Kynetics
 

Recently uploaded

Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 

Recently uploaded (20)

Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 

Reactive IoT, Java One 2016

  • 1. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Reactive IoT How to build the next generation M2M communication using the Actor based model Nicola La Gloria Andrea Zoleo Kynetics, Santa Clara, CA
  • 2. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Agenda - Introduction: - Legacy IoT and pains. - How can we design a better model? - Reactive Manifesto - Some elements of a reactive architecture - Definition of Plato Devices. - What is Reactive IoT? (RIoT) - 2 Case of Study - Our Open Source implementation of RIoT: O-Robot - Demo
  • 3. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Legacy IoT ❯ Monolithic Architecture 》 3-tiers (Presentation, Application, Data) 》 Multiple AS (to scale) 》 Single RDBMS ❯ Traditional Microservices 》 Multiple isolated services 》 Http interconnected 》 No single programming model 》 Multiple RDBMS
  • 4. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Pains of Legacy IoT The problem: Trade off between scalability (adding different types of devices) and the ability to plug-in arbitrary logic in the device model The legacy solution: device model too generic ❯ Generic list of attributes/setpoints in the device model (defined a priori) ❯ Exchange of generic files (aka any kind of resource) ❯ Simple monitor and control of a single device without no advanced definition of collaboration and coordination between devices
  • 5. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved What would be a more effective model? ❯ Communication between server and devices and collaboration between devices can’t be direct. It should be handled through a device representation on the server in a scalable context. ❯ Behaviour orchestration of heterogeneous devices should be similar to how human workers exchange messages and directives (commands) ❯ Unexpected events are the standard and the exception must be handled through a hierarchy of responsibilities.
  • 6. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved What should we ask to the new model? An effective model should allow to: ❯ Write advanced business logic (using a DSL i.e) ❯ Not have any “a priori” hypothesis on the device. ❯ Scale without any service interruption. ❯ Be fast to provide responses to devices and clients in order for them to react.
  • 7. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved What should be the drivers? ❯ Asynchronous, responsive and full duplex messaging system. ❯ Be robust to any loss of connection between device and backend. ❯ Workers isolation (tasks small enough to be handled independently) ❯ Hierarchical structure for responsibilities and countermeasures ❯ Tasks organized in a workflow
  • 8. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved What is Reactive - Reactive manifesto (2.0) - ERRM (Elastic, Responsive, Resilient and Message Driven) © Lightbend
  • 9. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved How can we achieve this? ❯ Actors (human workers) ❯ Messages (communication) ❯ Reactive Streams (data flux manipulation) ❯ Microservices (isolation, reuse, deployment) ❯ Cluster management (scale with no service interruption) ❯ CQRS/ED (performances, scale) ❯ NOSQL (schemaless) = AKKA O/
  • 10. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Microservices vs Akka ❯ Multiple isolated services/Akka remote provides clustering ❯ Http (JSON) interconnected/Binary serialized messages ❯ Some aggregate service/Akka applies localization transparency ❯ Multiple RDBMS/CQRS
  • 11. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Plato Devices “The ideal world is stronger than reality” ❯ In this context if we associated a device to a specific actor, this actor becomes a kind of projection of the real device but living in the back end (the “Ideal World”) ❯ This is a great solution to responsiveness and backpressure ❯ Plato Device provides a rich definition even for a very simple device
  • 12. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved But more... ❯ Actor lives in the server (always reachable by the client). ❯ It’s state can be monitored even when the physical device is not reachable (fallback). ❯ The system is robust to device failures, it can always provide a prompt response to the user in a real time fashion. ❯ Complex orchestration logic can be handled on server ❯ The server can instantiate several actors leveraging few thread pools. ❯ Actor lives in its execution thread with a stateful connection.
  • 13. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved A simplified architecture Device Client Protocol FAC Server PD HTTP WebS ock SFS Device Device Device PD PD PD CQRS Domain Entities
  • 14. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Reactive IoT (RIoT) - Reactive IoT has the aim of applying the principles of the Reactive Manifesto in order to provide a new foundation to the interaction between elements of an IoT system and facilitate their development. - The device logic (and more) may be totally represented in the Plato device (isolation), which is message driven towards other actors, and responsible of the communication (MQTT i.e) to the real device.
  • 15. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Advantages of the RIoT approach ❯ Grow any device with custom logic developed in Java, Scala or a custom DSL. ❯ With a careful development, scale without halting service 》 CQRS/ED (i.e Cassandra) 》 Schema evolution (Akka/Stamina) 》 Akka message serialization (between remote Actors) 》 Routers, Sharding, Roles ❯ Multiple protocol (mqtt, http, websocket, akka, tcp/ip, etc..) with streaming support and reactive responsiveness. ❯ Hierarchical fault handling and recover (let it crash).
  • 16. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved “Versatile” becomes the cornerstone Let’s explore two Case of Study: 1. Microdevices, HUB, Backend, Client, HTTP 2. Devices, Backend, Client, MQTT
  • 17. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Case of Study (1) DevGat Client ES HTTP FAC ActorServer EVJ PQ µDev µDev µDev EVP PD HTTP WebS ock DEA SFS
  • 18. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Case of Study (2) Device Client ES FAC ActorServer EVJ PQ PD HTTP WebS ockMC MqTT Broker PDR
  • 19. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved A (GPL) implementation of RIoT: O-Robot ❯ We developed a project which is our first implementation of a RiOT system: O-Robot. 》 A robot (for monitoring or surveillance purposes) sends constantly position and environmental data to the backend. 》 The client may request to supervise a particular robot which start to send a video stream. ❯ It uses: CQRS, Messages, Actors, Microservices. ❯ Right now it runs on a single instance (no sharding, routing, roles, we are getting there!)
  • 20. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved O-Robot Architecture - Deploy Robot Device Mqtt Broker Akka Play Server Browser mqtt mqtt akka http/ws Elastic Search Cassandra
  • 21. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved O-Robot Architecture - Modules ❯ Modules: 》 Core → main actors 》 Model → domain model objects 》 Mqtt → actors and protocol handling 》 Persistence → persistent actors events (CQRS/ED) 》 Protocol → akka protocol 》 Elastic → mapping ES 》 Play → web application 》 Sim → robot device simulator
  • 22. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved O-Robot Architecture - Actors ORobot Sup. Facade Robots Sup. Robot Registry Sup. Mqtt Connector Sup. Robot Robot Registry Mqtt Connector
  • 23. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Demo: ❯ Demo setup: 》 Robot device simulated using warp board (running JVM 8) ■ Robot communicates via WIFI ■ WIFI is managed by a local AP 》 Backend running on a laptop connected to the AP
  • 24. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Warp ❯ Small form factor: 16mm x 38mm x 3.5mm (Board Area < 1 sq-in) ❯ 10 Layer HDI PCB (0.4mm BGA, LGA, 0201) ❯ 1Ghz ARM Cortex-A9 (Freescale i.MX6SL) ❯ 512MB Memory + 4GB Flash ❯ USB OTG, 6-axis ACC+Mag, PMIC, Wifi+BT/BLE ❯ B2B Expansion
  • 25. Wearable Tech Conference, San Jose 2016© 2016 warpx.io
  • 26. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Demo setup Sensor Board Warp AP Netbook (Warp) Mac (Backend) WiFi WiFi WiFi
  • 27. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Warp References ❯ Mailing list: >warpx.io on Google group ❯ Store: http://revotics.com/store ❯ Community website:www.warp.io ❯ Documentation:www.warpx.io/resources ❯ This presentation: www.warpx.io/resources ❯ GitHub: https://github.com/warpboard
  • 28. JavaOne 2016, San Francisco, CA© 2016-2017 Kynetics, all right reserved Thank you