31
© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission. Real Time Event Processing and Decision Making By Lyndon Adams, Sr. Architect Pivotal Real Time

Real Time Event Processing and Decision Making

Embed Size (px)

DESCRIPTION

Speaker: Lyndon Adams As Information Technology evolves and improves, the demands of industry and the internet continue to challenge its capabilities. Today's 'Internet of Things', with millions of devices reporting their status on the network every second, produces massive streams of events. Getting the information in these events consumed and correlated so that it can be used to make routing and processing decisions on related events is particularly challenging. As the data demands of these processes increases, traditional client-server architectures begin to fail. Combining event processing with patterns and knowledge gleamed from Big Data models enables whole new kinds of real-time applications. Spring Integration and other Spring projects play a big role in this new paradigm, adding developer productivity and ease of integration into the mix. Lyndon will discuss and demonstrate the architectural decisions and use cases that occur when Fast Data meets Big Data.

Citation preview

Page 1: Real Time Event Processing and Decision Making

© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.

Real Time Event Processing and Decision Making

By Lyndon Adams, Sr. Architect Pivotal Real Time

Page 2: Real Time Event Processing and Decision Making

Introduction

What does ‘Real Time’ mean? Applications are getting ‘realer’ and ‘timelier’

Where do we see real time use cases? Banking, Telco, Sensors, Smart Grids, Intelligence and others

How can I make real time decisions in response to events? Route events to servers based on data affinity

Page 3: Real Time Event Processing and Decision Making

What is Real Time? re·al Adjective /ˈrē(əә)l/ Actually existing as a thing or occurring in fact; not imagined or supposed

Julius Caesar was a real person Used to emphasize the significance or seriousness of a situation or circumstance

there is a real danger of civil war the competitive threat from overseas is very real

Relating to something as it is, not merely as it may be described or distinguished (of a substance or thing) Not imitation or artificial; genuine

the earring was presumably real gold True or actual

his real name is James this isn't my real reason for coming

(of a person or thing) Rightly so called; proper he's my idea of a real man Jamie is my only real friend

Complete; utter (used for emphasis) the tour turned out to be a real disaster

Adjusted for changes in the value of money; assessed by purchasing power real incomes had fallen by 30 percent an increase in real terms of 11.6 percent

Of fixed property (i.e., land and buildings), as distinct from personal property he lost nearly all of his real holdings

(of a number or quantity) Having no imaginary part (of an image) Of a kind in which the light that forms it actually passes through it; not virtual

All related information needs to be brought together in one place

“How would you know the difference between the dream world and the real world?”

Morpheus, The Matrix

Applications with consequence need accurate and up-to-date information

Copies of data, caches, eventual consistency and batch windows can all lead to errors

Page 4: Real Time Event Processing and Decision Making

What is Real Time? time Noun /tīm/ The indefinite continued progress of existence and events in the past, present, and future regarded as a whole

one of the greatest wits of all time The progress of this as affecting people and things

things were getting better as time passed Time or an amount of time as reckoned by a conventional standard

it's eight o'clock Eastern Standard Time A point of time as measured in hours and minutes past midnight or noon

the time is 9:30 A moment or definite portion of time allotted, used, or suitable for a purpose

the scheduled departure time should we set a time for the meeting?

An indefinite period traveling always distorts one's feelings for a time

A more or less definite portion of time in history or characterized by particular events or circumstances

Victorian times the park is beautiful at this time of year

The conditions of life during a particular period times have changed

The appropriate or expected time for something, in particular childbirth or death he seemed old before his time

“Time is an illusion. Lunchtime, doubly so” Ford Prefect, The Hitchhikers Guide to the Galaxy

Appropriateness is situational, defined by the user

Each use may have its own definition of relevant time

Past, current and predictions of the future may all be relevant

Concurrent events and circumstances can affect the relevant ‘portion’ of time

Page 5: Real Time Event Processing and Decision Making

Pivotal Real Time Intelligence

Pivotal RTI is designed to provide low latency, high throughput, elastic stream processing for applications with a very strong dependence on highly volatile reference data. Pivotal RTI includes fault tolerant and distributed data management for the volatile data it uses.

Thro

ughp

ut

Kafka

Pivotal RTI Rabbit MQ

Storm

Map-Reduce Traditional Client-Server

SpringXD

Rules/CEP Engines

CPU Optimized Data Optimized

ETL

Page 6: Real Time Event Processing and Decision Making

Use Cases

Page 7: Real Time Event Processing and Decision Making

Real Time Pricing and Risk

Market Data

Trades Position

Price Bids

Offers

Threshold Detected

+ Market Volatility isn’t a problem … it’s an

opportunity.

Monte Carlo Simulation

Correction

43.7B records

Historical Data Big Active Data Fast

Page 8: Real Time Event Processing and Decision Making

Customer Behavior

Data Fabric Fast Big Data Archive

MicroCube

‘Customer Habits’

‘Customer Options’

Location Event Targeted Marketing

Periodic Refresh

Location Record

Data Analytics Big

Page 9: Real Time Event Processing and Decision Making

Sensor Data Processing

Big Data

Fast Data 000’s data points/sec

Emergency Shutdown Tuning & Optimization,

Monitor & Control

Continuous Real-time Analysis

Maintenance Billing

Page 10: Real Time Event Processing and Decision Making

Smart Grids, Smart Cites

Phase Variance

Weather Data

Conductor Temp

Insulator Temp

Intrusion Detection1

Conductor Tension

Footing Torque

Shaft Torque

Bearing Temp Windings Temp

Input Pressure

Exhaust Pressure

kVA Output Output Freq.

Coolant Temp

Supply kVA

Demand kVA

Stadium/Convention Schedule

Weather Data Tower Occupancy

Public Transport Demand

Holidays/Events

Emergency Operations

Big Data

Fast Data

Local Sunshine Residential

Consumption Vehicle Charging

Electricity must be consumed in the instant that it is

produced.

Page 11: Real Time Event Processing and Decision Making

Asset Management and Intelligence

Big Data

Fast Data

Events Details

Analysis

Page 12: Real Time Event Processing and Decision Making

Complex Decisions Require More & Real-time Data

Ring My Current Phone

Send to Voicemail

Incoming Call What time is it (locally)?

Am I travelling?

Am I in a meeting?

Is it family calling?

Is call marked ‘urgent’?

Have I interacted w/ phone recently? Am I driving? Am I on

vacation? Do I know the

caller? Who am I talking to?

What phone am I using?

There isn’t time to go to disk for this information.

This information is individual and changing all the time.

Page 13: Real Time Event Processing and Decision Making

Solution

Page 14: Real Time Event Processing and Decision Making

Data Optimized Applications

Customers A-D

Customers E-J

Customers K-O

App A

App A

App B

App C

Customers P-Z

App A

App B

App C

App A

App B

App C

App A

App B

App C

App A

App B

App C

Database w/ all data

Stateless Client App Scale Stateless App w/ more instances Additional Stateless Apps

‘Pivot’ the Architecture

Partition the Data into memory Deploy Apps to all nodes

Events jump nodes only when necessary

Database and network contention limit scale/performance

Caches provide limited value if: •  The data sets are big •  The data changes

Page 15: Real Time Event Processing and Decision Making

Pivotal RTI with Pivotal One

+ +

Widgets

PaaS

Big Data

Fast Data

App Dev

Page 16: Real Time Event Processing and Decision Making

Spring Integration Adapters REST & RSS

JMS & AMQP Mail

Twitter

TCP & UDP

Web Services

File

FTP & SFTP

Byte Streams Tuple, POJO, Message

Page 17: Real Time Event Processing and Decision Making

Real Time Processing

Acknowledgement

Raw Stream Event

Validate Enrich Archive

Widget

Eviction

Sliding Window

Related Streams

Threshold Detection

Merge Business Event

Filter

Page 18: Real Time Event Processing and Decision Making

Widgets

Set Arithmetic

Geo-Spatial

Threshold

Accumulators

Analytic

Page 19: Real Time Event Processing and Decision Making

Real Time Analysis Linear Regression Example

Big Data Analyitics

Ingestion Complex Events Operations

parameters & noise

event data

periodic update

Predict y Is this normal? Is this fraud?

take action

Page 20: Real Time Event Processing and Decision Making

Geo-Spatial Widgets

Geo Heat Maps

Enter/Leave Zone

Distance to POI

Friends in Area

Debouncing

Page 21: Real Time Event Processing and Decision Making

Composition of Applications

/Network Business Unit

/ Root

/myCompany Business Unit

/CDR Ingestion SpringXD App

/Marketing Business Unit

/DroppedCalls

/CustomerRetention Spring Integration App

/DroppedCallThreshold Spring Integration App

/ExcessiveDroppedCalls

Network Events

Shared Channel

/Sales Business Unit

/ContractLIfecycle Spring Integration App

/ExpringContracts

Shared Container

Shared Container

Issue Rebate

Reference: /myCompany/Network/CDRIngestion/DroppedCalls

Page 22: Real Time Event Processing and Decision Making

Demo

Page 23: Real Time Event Processing and Decision Making

Real time dash board •  Streaming UI for call monitoring.

•  Stack •  Spring Integration use case

flows. •  GeoSpatial service and event

set processing. •  OpenLayers, HighCharts and

jqwidgets components. •  Tomcat and GemFire

embedded client. •  Websockets.

Page 24: Real Time Event Processing and Decision Making

Dropped Calls •  Geographic dropped call locations. •  Uses streaming dropped calls feed. •  OpenLayers functionality utilized for

proximity dropped call count. –  Rules used for color coding. –  Radius set to 35 miles.

•  System uses EPSG:4326 encoding standard then we project to map coordinate system.

Page 25: Real Time Event Processing and Decision Making

Client contract alerts •  Alerts generated for a contract coming up for renewal that

has experienced dropped calls in real time. •  Intersect of client Id from contracts and dropped calls sets. •  Uses declarative predicates to filter data.

•  DroppedCall à dropped ? contractId : null; •  Contract à underreview and expired ? Id : null;

•  Grid displays all dropped calls for filtered client. •  Grid provided grouping function etc.

Page 26: Real Time Event Processing and Decision Making

Aggregated dropped calls by region •  Call records are tagged with region location using a geospatial location

service. •  UK regions are specified upfront via a set of uk region polygons. •  Geospatial processes occurs for each call to determine geographic region. •  Geo region count managed by cluster.

Page 27: Real Time Event Processing and Decision Making

High level architecture

Client

Contracts

Calls droppedCalls

reviewClients

GF PR

GF PR (colo)

Web

geoZonedDroppedCalls

filter(contract)

filter(dropped calls)

Set Widget

Geo Widget

Feed Storage Processing Results

Page 28: Real Time Event Processing and Decision Making

Conclusion

Page 29: Real Time Event Processing and Decision Making

Pivotal Real Time Intelligence

Some stream processing cases are CPU intensive.

Other cases benefit from colocation with volatile data.

Spring Integration and SpringXD provide support for elastic Staged Event Driven Architectures for processing high volume event streams.

runs Spring process flows inside of a managed data environment with new cluster-aware widgets

Page 30: Real Time Event Processing and Decision Making

? ?

? ?

Page 31: Real Time Event Processing and Decision Making

Learn More. Stay Connected.

•  Email [email protected]

•  Talk to us on Twitter: @springcentral •  Find Session replays on YouTube: spring.io/video