SlideShare a Scribd company logo
1 of 42
Download to read offline
Distributed Stream Processing with
WSO2 Stream Processor
Tishan Dahanayakage
Associate Technical Lead
Jul, 2018
WSO2 Stream
Processor
WSO2 Stream Processor (WSO2 SP)
An open source, cloud native analytics product
optimized to create real-time, actionable insights for
agile digital businesses.
3
Stream Processing Challenges
• Need to write code
• Complex deployment (5-6 nodes)
• Slow to change
4
Stream Processing Challenges
• Need to write code
– Streaming SQL + Graphical editor
• Complex deployment (5-6 nodes)
– 2 node minimum HA deployment
(of course distributed too..)
• Slow to change
– Query templates, business
rules dashboard, editor
5
WSO2 SP Reference Architecture
6
Distributed Stream
Processing
Why Distributed Stream Processing
• Availability of data
• Need for timely business insights
Creates requirements for
• High throughput
• Low latency
8
WSO2 SP Distributed Deployment
• Exactly-once processing
• Fault tolerance
• Highly scalable
• No back pressure
• Distributed development configurations via annotations
• Pluggable distribution options (K8, YARN, etc.)
9
Complexities Over Single Node
• Communication across components
• Fault tolerance of components
• Message semantics
• Message ordering
10
Reference and Deployment Architecture
11
Manager Workflow - Adding a New Application
12
Manager Workflow - Adding a New Worker
13
Manager Workflow - Adding and Removing a
Worker
14
Worker Workflow
15
Event Flow
16
Event
Source
Event
Sink
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Siddhi
App
Kafka Topic
Kafka Topic
Kafka Topic
Kafka
Topic
Kafka
Topic
Distributed Siddhi
Application
Sample Standalone Siddhi Application
18
Sample Standalone Siddhi Application@App:name('Energy-Alert-App')
@App:description('Energy consumption and anomaly detection')
@source(type = 'http', topic = 'device-power', @map(type = 'json'))
define stream DevicePowerStream (type string, deviceID string, power int, roomID string);
@sink(type = 'email', to = '{{autorityContactEmail}}', username = 'john', address = 'john@gmail.com', password =
'test', subject = 'High power consumption of {{deviceID}}', @map(type = 'text', @payload('Device ID: {{deviceID}} of
room : {{roomID}} is consuming {{finalPower}}kW/h. ')))
define stream AlertStream (deviceID string, roomID string, initialPower double, finalPower double,
autorityContactEmail string);
@info(name = 'monitered-filter')
from DevicePowerStream[type == 'monitored']
select deviceID, power, roomID
insert current events into MonitoredDevicesPowerStream;
@info(name = 'power-increase-pattern')
partition with (deviceID of MonitoredDevicesPowerStream)
begin
@info(name = 'avg-calculator')
from MonitoredDevicesPowerStream#window.time(2 min)
select deviceID, avg(power) as avgPower, roomID
insert current events into #AvgPowerStream;
@info(name = 'power-increase-detector')
from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min
select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower, e1.roomID
insert current events into RisingPowerStream;
end;
19
Sample Standalone Siddhi Application Contd
@info(name = 'power-range-filter')
from RisingPowerStream[finalPower > 100]
select deviceID, roomID, initialPower, finalPower, 'no-reply@powermanagement.com' as autorityContactEmail
insert current events into AlertStream;
@info(name = 'internal-filter')
from DevicePowerStream[type == 'internal']
select deviceID, power
insert current events into InternalDevicesPowerStream;
20
Basic Concepts
• Execution Group
– Collection of Siddhi queries
– Single execution unit
• Parallelism
– Number of parallel instances
21
Annotations
• ExecGroup
– Create execution groups
• Parallel
– Provide parallelism to execution groups
– Provide parallelism to sources
• TransportChannelCreationEnabled
– Management option to control creation of channels
22
Sample Distributed Siddhi Application@App:name('Energy-Alert-App')
@App:description('Energy consumption and anomaly detection')
@source(type = 'http', topic = 'device-power', @map(type = 'json'))
define stream DevicePowerStream (type string, deviceID string, power int, roomID string);
@sink(type = 'email', to = '{{autorityContactEmail}}', username = 'john', address = 'john@gmail.com', password =
'test', subject = 'High power consumption of {{deviceID}}', @map(type = 'text', @payload('Device ID: {{deviceID}} of
room : {{roomID}} power is consuming {{finalPower}}kW/h. ')))
define stream AlertStream (deviceID string, roomID string, initialPower double, finalPower double,
autorityContactEmail string);
@info(name = 'monitered-filter')@dist(execGroup='001')
from DevicePowerStream[type == 'monitored']
select deviceID, power, roomID
insert current events into MonitoredDevicesPowerStream;
@info(name = 'power-increase-pattern')@dist(parallel='2', execGroup='002')
partition with (deviceID of MonitoredDevicesPowerStream)
begin
@info(name = 'avg-calculator')
from MonitoredDevicesPowerStream#window.time(2 min)
select deviceID, avg(power) as avgPower, roomID
insert current events into #AvgPowerStream;
@info(name = 'power-increase-detector')
from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min
select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower, e1.roomID
insert current events into RisingPowerStream;
end;
23
Sample Distributed Siddhi Application Contd..
@info(name = 'power-range-filter')@dist(parallel='2', execGroup='003')
from RisingPowerStream[finalPower > 100]
select deviceID, roomID, initialPower, finalPower, 'no-reply@powermanagement.com' as autorityContactEmail
insert current events into AlertStream;
@info(name = 'internal-filter')@dist(execGroup='004')
from DevicePowerStream[type == 'internal']
select deviceID, power
insert current events into InternaltDevicesPowerStream;
24
Event Flow Diagram
25
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
Event Flow Diagram
26
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-passthrough-1373-1')
@source(type = 'http', topic = 'device-power',
@map(type = 'json'))
define stream passthroughDevicePowerStream (type
string, deviceID string, power int);
@sink(type='kafka',
topic='Energy-Alert-App.DevicePowerStream' ,
bootstrap.servers='localhost:9092',
@map(type='xml'))
define stream DevicePowerStream (type string,
deviceID string, power int);
from passthroughDevicePowerStream
select *
insert into DevicePowerStream;
Event Flow Diagram
27
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-004-1')
@source(type='kafka',
topic.list='Energy-Alert-App.DevicePowerStream',
group.id='Energy-Alert-App-004-0',
threading.option='single.thread',
bootstrap.servers='localhost:9092',
@map(type='xml'))
define stream DevicePowerStream (type string,
deviceID string, power int);
define stream InternalDevicesPowerStream (deviceID
string, power int);
@info(name = 'internal-filter')
from DevicePowerStream[type == internal]
select deviceID, power
insert current events into
InternalDevicesPowerStream;
Event Flow Diagram
28
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-001-1')
@source(type='kafka',
topic.list='Energy-Alert-App.DevicePowerStream',
group.id='Energy-Alert-App-001-0',
threading.option='single.thread',
bootstrap.servers='localhost:9092',
@map(type='xml'))
define stream DevicePowerStream (type string,
deviceID string, power int);
@sink(type='kafka',
topic='Energy-Alert-App.MonitoredDevicesPowerStre
am.deviceID' ,
bootstrap.servers='localhost:9092',
@map(type='xml'),
@distribution(strategy='partitioned',
partitionKey='deviceID',
@destination(partition.no = '0'),
@destination(partition.no = '1') ))
define stream MonitoredDevicesPowerStream
(deviceID string, power int);
@info(name = 'monitered-filter')
from DevicePowerStream[type == 'monitored']
select deviceID, power
insert current events into
MonitoredDevicesPowerStream;
Event Flow Diagram
29
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-002-1')
@source(type='kafka', topic.list
='Energy-Alert-App.MonitoredDevicesPowerStream.deviceID',
group.id='Energy-Alert-App-002', threading.option='partition.wise',
bootstrap.servers='localhost:9092', partition.no.list='0',@map(type='xml'))
define stream MonitoredDevicesPowerStream (deviceID string, power int);
@sink(type='kafka', topic='Energy-Alert-App.RisingPowerStream' ,
bootstrap.servers='localhost:9092', @map(type='xml'))
define stream RisingPowerStream (deviceID string, initialPower double, finalPower
double);
@info(name = 'power-increase-pattern')
partition with (deviceID of MonitoredDevicesPowerStream)
begin
@info(name = 'avg-calculator')
from MonitoredDevicesPowerStream#window.time(2 min)
select deviceID, avg(power) as avgPower
insert current events into #AvgPowerStream;
@info(name = 'power-increase-detector')
from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower]
within 10 min
select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower
insert current events into RisingPowerStream;
end;
Event Flow Diagram
30
HTTP
Source
Pass-
through
Gov
Fiter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-002-2')
@source(type='kafka',
topic.list='Energy-Alert-App.MonitoredDevicesPowerStream.deviceID
', group.id='Energy-Alert-App-002',
threading.option='partition.wise',
bootstrap.servers='localhost:9092',
partition.no.list='1',@map(type='xml'))
define stream MonitoredDevicesPowerStream (deviceID string, power
int);
@sink(type='kafka', topic='Energy-Alert-App.RisingPowerStream' ,
bootstrap.servers='localhost:9092', @map(type='xml'))
define stream RisingPowerStream (deviceID string, initialPower
double, finalPower double);
@info(name = 'power-increase-pattern')
partition with (deviceID of MonitoredDevicesPowerStream)
begin
@info(name = 'avg-calculator')
from MonitoredDevicesPowerStream#window.time(2 min)
select deviceID, avg(power) as avgPower
insert current events into #AvgPowerStream;
@info(name = 'power-increase-detector')
from every e1 = #AvgPowerStream -> e2 =
#AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min
select e1.deviceID as deviceID, e1.avgPower as initialPower,
e2.avgPower as finalPower
insert current events into RisingPowerStream;
end;
Event Flow Diagram
31
HTTP
Source
Pass-
through
Internal
Filter
Power
Increase
Pattern
1
Power
Range
Filter 1
Power
Range
Filter 2
Monitor
Filter
Power
Increase
Pattern
2
Email
Sink
Email
Sink
@App:name('Energy-Alert-App-003-1')
@source(type='kafka',
topic.list='Energy-Alert-App.RisingPowerStream',
group.id='Energy-Alert-App-003',
threading.option='single.thread',
bootstrap.servers='localhost:9092', @map(type='xml'))
define stream RisingPowerStream (deviceID string,
initialPower double, finalPower double, roomID string);
@sink(type = 'email', to = '{{autorityContactEmail}}',
username = 'john', address = 'john@gmail.com', password =
'test', subject = 'High power consumption of {{deviceID}}',
@map(type = 'text', @payload('Device ID: {{deviceID}} of
room : {{roomID}} power is consuming {{finalPower}}kW/h.
')))
define stream AlertStream (deviceID string, roomID string,
initialPower double, finalPower double, autorityContactEmail
string);
@info(name = 'power-range-filter')
from RisingPowerStream[finalPower > 100]
select deviceID, roomID, initialPower, finalPower,
'no-reply@powermanagement.com' as autorityContactEmail
insert current events into AlertStream;
Deployment of Cluster
Classic VM-Based Deployment
• Single configuration file
• Three profiles
– Manager
– Worker
– Status Dashboard
33
Kubernetes Deployment
• Preconfigured Kubernetes resources[1]
• Deploy using kubectl with ease
[1]https://github.com/wso2/kubernetes-sp
34
Kubernetes Deployment
35
Monitoring
Status Dashboard
• Understand system performance via
– Throughput
– Latency
– CPU, memory utilizations
• Monitor in various scales
– Node Level
– Siddhi App Level
– Siddhi Query Level
37
Status Dashboard
38
Demo
Q & A
THANK YOU
wso2.com
THANK YOU
wso2.com
42

More Related Content

Similar to Distributed Stream Processing with WSO2 Stream Processor

[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital EnterpriseWSO2
 
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...Ryousei Takano
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...spChains: A Declarative Framework for Data Stream Processing in Pervasive App...
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...Fulvio Corno
 
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...
Flink Forward San Francisco 2018:  David Reniz & Dahyr Vergara - "Real-time m...Flink Forward San Francisco 2018:  David Reniz & Dahyr Vergara - "Real-time m...
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...Flink Forward
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorWSO2
 
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data Analytics
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data AnalyticsStrata+Hadoop 2015 NYC End User Panel on Real-Time Data Analytics
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data AnalyticsSingleStore
 
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...Atlassian
 
M|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersM|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersMariaDB plc
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Workshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSWorkshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSAmazon Web Services
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...confluent
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appNeil Avery
 
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamGDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamImre Nagi
 
Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Keshav Murthy
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationJürgen Etzlstorfer
 

Similar to Distributed Stream Processing with WSO2 Stream Processor (20)

[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
 
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Ceilometer + Heat = Alarming
Ceilometer + Heat = Alarming Ceilometer + Heat = Alarming
Ceilometer + Heat = Alarming
 
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...spChains: A Declarative Framework for Data Stream Processing in Pervasive App...
spChains: A Declarative Framework for Data Stream Processing in Pervasive App...
 
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...
Flink Forward San Francisco 2018:  David Reniz & Dahyr Vergara - "Real-time m...Flink Forward San Francisco 2018:  David Reniz & Dahyr Vergara - "Real-time m...
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event Processor
 
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data Analytics
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data AnalyticsStrata+Hadoop 2015 NYC End User Panel on Real-Time Data Analytics
Strata+Hadoop 2015 NYC End User Panel on Real-Time Data Analytics
 
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...
AtlasCamp 2015: JIRA Service Desk: Scale your team with build-it-yourself aut...
 
M|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersM|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data Adapters
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
Tracon
TraconTracon
Tracon
 
Workshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSWorkshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWS
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming app
 
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamGDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
 
QSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load RunnerQSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load Runner
 
Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data.
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediation
 

More from WSO2

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in ChoreoWSO2
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023WSO2
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzureWSO2
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfWSO2
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in MinutesWSO2
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityWSO2
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...WSO2
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfWSO2
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoWSO2
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsWSO2
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital BusinessesWSO2
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)WSO2
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformationWSO2
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesWSO2
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready BankWSO2
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIsWSO2
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native DeploymentWSO2
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”WSO2
 

More from WSO2 (20)

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in Choreo
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on Azure
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdf
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos Identity
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdf
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing Choreo
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected Products
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital Businesses
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformation
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking Experiences
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready Bank
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Distributed Stream Processing with WSO2 Stream Processor

  • 1. Distributed Stream Processing with WSO2 Stream Processor Tishan Dahanayakage Associate Technical Lead Jul, 2018
  • 3. WSO2 Stream Processor (WSO2 SP) An open source, cloud native analytics product optimized to create real-time, actionable insights for agile digital businesses. 3
  • 4. Stream Processing Challenges • Need to write code • Complex deployment (5-6 nodes) • Slow to change 4
  • 5. Stream Processing Challenges • Need to write code – Streaming SQL + Graphical editor • Complex deployment (5-6 nodes) – 2 node minimum HA deployment (of course distributed too..) • Slow to change – Query templates, business rules dashboard, editor 5
  • 6. WSO2 SP Reference Architecture 6
  • 8. Why Distributed Stream Processing • Availability of data • Need for timely business insights Creates requirements for • High throughput • Low latency 8
  • 9. WSO2 SP Distributed Deployment • Exactly-once processing • Fault tolerance • Highly scalable • No back pressure • Distributed development configurations via annotations • Pluggable distribution options (K8, YARN, etc.) 9
  • 10. Complexities Over Single Node • Communication across components • Fault tolerance of components • Message semantics • Message ordering 10
  • 11. Reference and Deployment Architecture 11
  • 12. Manager Workflow - Adding a New Application 12
  • 13. Manager Workflow - Adding a New Worker 13
  • 14. Manager Workflow - Adding and Removing a Worker 14
  • 18. Sample Standalone Siddhi Application 18
  • 19. Sample Standalone Siddhi Application@App:name('Energy-Alert-App') @App:description('Energy consumption and anomaly detection') @source(type = 'http', topic = 'device-power', @map(type = 'json')) define stream DevicePowerStream (type string, deviceID string, power int, roomID string); @sink(type = 'email', to = '{{autorityContactEmail}}', username = 'john', address = 'john@gmail.com', password = 'test', subject = 'High power consumption of {{deviceID}}', @map(type = 'text', @payload('Device ID: {{deviceID}} of room : {{roomID}} is consuming {{finalPower}}kW/h. '))) define stream AlertStream (deviceID string, roomID string, initialPower double, finalPower double, autorityContactEmail string); @info(name = 'monitered-filter') from DevicePowerStream[type == 'monitored'] select deviceID, power, roomID insert current events into MonitoredDevicesPowerStream; @info(name = 'power-increase-pattern') partition with (deviceID of MonitoredDevicesPowerStream) begin @info(name = 'avg-calculator') from MonitoredDevicesPowerStream#window.time(2 min) select deviceID, avg(power) as avgPower, roomID insert current events into #AvgPowerStream; @info(name = 'power-increase-detector') from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower, e1.roomID insert current events into RisingPowerStream; end; 19
  • 20. Sample Standalone Siddhi Application Contd @info(name = 'power-range-filter') from RisingPowerStream[finalPower > 100] select deviceID, roomID, initialPower, finalPower, 'no-reply@powermanagement.com' as autorityContactEmail insert current events into AlertStream; @info(name = 'internal-filter') from DevicePowerStream[type == 'internal'] select deviceID, power insert current events into InternalDevicesPowerStream; 20
  • 21. Basic Concepts • Execution Group – Collection of Siddhi queries – Single execution unit • Parallelism – Number of parallel instances 21
  • 22. Annotations • ExecGroup – Create execution groups • Parallel – Provide parallelism to execution groups – Provide parallelism to sources • TransportChannelCreationEnabled – Management option to control creation of channels 22
  • 23. Sample Distributed Siddhi Application@App:name('Energy-Alert-App') @App:description('Energy consumption and anomaly detection') @source(type = 'http', topic = 'device-power', @map(type = 'json')) define stream DevicePowerStream (type string, deviceID string, power int, roomID string); @sink(type = 'email', to = '{{autorityContactEmail}}', username = 'john', address = 'john@gmail.com', password = 'test', subject = 'High power consumption of {{deviceID}}', @map(type = 'text', @payload('Device ID: {{deviceID}} of room : {{roomID}} power is consuming {{finalPower}}kW/h. '))) define stream AlertStream (deviceID string, roomID string, initialPower double, finalPower double, autorityContactEmail string); @info(name = 'monitered-filter')@dist(execGroup='001') from DevicePowerStream[type == 'monitored'] select deviceID, power, roomID insert current events into MonitoredDevicesPowerStream; @info(name = 'power-increase-pattern')@dist(parallel='2', execGroup='002') partition with (deviceID of MonitoredDevicesPowerStream) begin @info(name = 'avg-calculator') from MonitoredDevicesPowerStream#window.time(2 min) select deviceID, avg(power) as avgPower, roomID insert current events into #AvgPowerStream; @info(name = 'power-increase-detector') from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower, e1.roomID insert current events into RisingPowerStream; end; 23
  • 24. Sample Distributed Siddhi Application Contd.. @info(name = 'power-range-filter')@dist(parallel='2', execGroup='003') from RisingPowerStream[finalPower > 100] select deviceID, roomID, initialPower, finalPower, 'no-reply@powermanagement.com' as autorityContactEmail insert current events into AlertStream; @info(name = 'internal-filter')@dist(execGroup='004') from DevicePowerStream[type == 'internal'] select deviceID, power insert current events into InternaltDevicesPowerStream; 24
  • 25. Event Flow Diagram 25 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink
  • 26. Event Flow Diagram 26 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-passthrough-1373-1') @source(type = 'http', topic = 'device-power', @map(type = 'json')) define stream passthroughDevicePowerStream (type string, deviceID string, power int); @sink(type='kafka', topic='Energy-Alert-App.DevicePowerStream' , bootstrap.servers='localhost:9092', @map(type='xml')) define stream DevicePowerStream (type string, deviceID string, power int); from passthroughDevicePowerStream select * insert into DevicePowerStream;
  • 27. Event Flow Diagram 27 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-004-1') @source(type='kafka', topic.list='Energy-Alert-App.DevicePowerStream', group.id='Energy-Alert-App-004-0', threading.option='single.thread', bootstrap.servers='localhost:9092', @map(type='xml')) define stream DevicePowerStream (type string, deviceID string, power int); define stream InternalDevicesPowerStream (deviceID string, power int); @info(name = 'internal-filter') from DevicePowerStream[type == internal] select deviceID, power insert current events into InternalDevicesPowerStream;
  • 28. Event Flow Diagram 28 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-001-1') @source(type='kafka', topic.list='Energy-Alert-App.DevicePowerStream', group.id='Energy-Alert-App-001-0', threading.option='single.thread', bootstrap.servers='localhost:9092', @map(type='xml')) define stream DevicePowerStream (type string, deviceID string, power int); @sink(type='kafka', topic='Energy-Alert-App.MonitoredDevicesPowerStre am.deviceID' , bootstrap.servers='localhost:9092', @map(type='xml'), @distribution(strategy='partitioned', partitionKey='deviceID', @destination(partition.no = '0'), @destination(partition.no = '1') )) define stream MonitoredDevicesPowerStream (deviceID string, power int); @info(name = 'monitered-filter') from DevicePowerStream[type == 'monitored'] select deviceID, power insert current events into MonitoredDevicesPowerStream;
  • 29. Event Flow Diagram 29 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-002-1') @source(type='kafka', topic.list ='Energy-Alert-App.MonitoredDevicesPowerStream.deviceID', group.id='Energy-Alert-App-002', threading.option='partition.wise', bootstrap.servers='localhost:9092', partition.no.list='0',@map(type='xml')) define stream MonitoredDevicesPowerStream (deviceID string, power int); @sink(type='kafka', topic='Energy-Alert-App.RisingPowerStream' , bootstrap.servers='localhost:9092', @map(type='xml')) define stream RisingPowerStream (deviceID string, initialPower double, finalPower double); @info(name = 'power-increase-pattern') partition with (deviceID of MonitoredDevicesPowerStream) begin @info(name = 'avg-calculator') from MonitoredDevicesPowerStream#window.time(2 min) select deviceID, avg(power) as avgPower insert current events into #AvgPowerStream; @info(name = 'power-increase-detector') from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower insert current events into RisingPowerStream; end;
  • 30. Event Flow Diagram 30 HTTP Source Pass- through Gov Fiter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-002-2') @source(type='kafka', topic.list='Energy-Alert-App.MonitoredDevicesPowerStream.deviceID ', group.id='Energy-Alert-App-002', threading.option='partition.wise', bootstrap.servers='localhost:9092', partition.no.list='1',@map(type='xml')) define stream MonitoredDevicesPowerStream (deviceID string, power int); @sink(type='kafka', topic='Energy-Alert-App.RisingPowerStream' , bootstrap.servers='localhost:9092', @map(type='xml')) define stream RisingPowerStream (deviceID string, initialPower double, finalPower double); @info(name = 'power-increase-pattern') partition with (deviceID of MonitoredDevicesPowerStream) begin @info(name = 'avg-calculator') from MonitoredDevicesPowerStream#window.time(2 min) select deviceID, avg(power) as avgPower insert current events into #AvgPowerStream; @info(name = 'power-increase-detector') from every e1 = #AvgPowerStream -> e2 = #AvgPowerStream[(e1.avgPower + 5) <= avgPower] within 10 min select e1.deviceID as deviceID, e1.avgPower as initialPower, e2.avgPower as finalPower insert current events into RisingPowerStream; end;
  • 31. Event Flow Diagram 31 HTTP Source Pass- through Internal Filter Power Increase Pattern 1 Power Range Filter 1 Power Range Filter 2 Monitor Filter Power Increase Pattern 2 Email Sink Email Sink @App:name('Energy-Alert-App-003-1') @source(type='kafka', topic.list='Energy-Alert-App.RisingPowerStream', group.id='Energy-Alert-App-003', threading.option='single.thread', bootstrap.servers='localhost:9092', @map(type='xml')) define stream RisingPowerStream (deviceID string, initialPower double, finalPower double, roomID string); @sink(type = 'email', to = '{{autorityContactEmail}}', username = 'john', address = 'john@gmail.com', password = 'test', subject = 'High power consumption of {{deviceID}}', @map(type = 'text', @payload('Device ID: {{deviceID}} of room : {{roomID}} power is consuming {{finalPower}}kW/h. '))) define stream AlertStream (deviceID string, roomID string, initialPower double, finalPower double, autorityContactEmail string); @info(name = 'power-range-filter') from RisingPowerStream[finalPower > 100] select deviceID, roomID, initialPower, finalPower, 'no-reply@powermanagement.com' as autorityContactEmail insert current events into AlertStream;
  • 33. Classic VM-Based Deployment • Single configuration file • Three profiles – Manager – Worker – Status Dashboard 33
  • 34. Kubernetes Deployment • Preconfigured Kubernetes resources[1] • Deploy using kubectl with ease [1]https://github.com/wso2/kubernetes-sp 34
  • 37. Status Dashboard • Understand system performance via – Throughput – Latency – CPU, memory utilizations • Monitor in various scales – Node Level – Siddhi App Level – Siddhi Query Level 37
  • 39. Demo
  • 40. Q & A
  • 42. 42