Slide 1

Slide 1 text

[email protected] www.rittmanmead.com @rittmanmead 1 Enabling Rapid Business Insight into Fast Data with Oracle Stream Analytics and Oracle GoldenGate Robin Moffatt, Rittman Mead OUGN 2017 Slides: speakerdeck.com/rmoff/ Twitter: @rmoff

Slide 2

Slide 2 text

[email protected] www.rittmanmead.com @rittmanmead Robin Moffatt 2 • Head of R&D, Rittman Mead • Previously OBIEE/DW developer at large UK retailer • Previously SQL Server DBA, Business Objects, 
 DB2, COBOL…. • Oracle ACE • Frequent blogger : http://ritt.md/rmoff and http://rmoff.net • Twitter: @rmoff • IRC: rmoff / #obihackers / freenode

Slide 3

Slide 3 text

[email protected] www.rittmanmead.com @rittmanmead Rittman Mead 3 • Oracle Gold Partner with offices in the UK and USA • 70+ staff delivering Oracle BI, DW, Big Data and Advanced Analytics projects • Significant web presence with the Rittman Mead Blog 
 (http://www.rittmanmead.com) • Hadoop R&D lab for “dogfooding” solutions developed for customers

Slide 4

Slide 4 text

[email protected] www.rittmanmead.com @rittmanmead 4 “Stream” Processing…

Slide 5

Slide 5 text

[email protected] www.rittmanmead.com @rittmanmead 5 “Stream” Processing… This uses Environment Agency flood and river level data from the real-time data API (Beta)

Slide 6

Slide 6 text

[email protected] www.rittmanmead.com @rittmanmead Oracle Stream Analytics 6 • Stream processing runtime with GUI • Previously known as Oracle Stream Explorer - Part of Fusion Middleware • Custom runtime (not WLS) - Future : Spark Streaming

Slide 7

Slide 7 text

[email protected] www.rittmanmead.com @rittmanmead Create Connection 7

Slide 8

Slide 8 text

[email protected] www.rittmanmead.com @rittmanmead Create Stream 8

Slide 9

Slide 9 text

[email protected] www.rittmanmead.com @rittmanmead Exploration 9

Slide 10

Slide 10 text

[email protected] www.rittmanmead.com @rittmanmead Derivations and Calculations 10

Slide 11

Slide 11 text

[email protected] www.rittmanmead.com @rittmanmead Aggregations 11

Slide 12

Slide 12 text

[email protected] www.rittmanmead.com @rittmanmead Patterns 12 • Pre-built templates to create Explorations • Simple transformation and aggregation • Built-in algorithms and spatial functionality

Slide 13

Slide 13 text

[email protected] www.rittmanmead.com @rittmanmead Join the Streams (but never cross them…) 13

Slide 14

Slide 14 text

[email protected] www.rittmanmead.com @rittmanmead References 14

Slide 15

Slide 15 text

[email protected] www.rittmanmead.com @rittmanmead Join the Streams (but never cross them…) 15

Slide 16

Slide 16 text

[email protected] www.rittmanmead.com @rittmanmead Under the Covers… 16

Slide 17

Slide 17 text

[email protected] www.rittmanmead.com @rittmanmead Join the Streams 17

Slide 18

Slide 18 text

[email protected] www.rittmanmead.com @rittmanmead Spatial Pattern 18 • Uses geofencing to overlay stream events and tag them as ‘entering’, ‘leaving’, or ‘staying’ in an area

Slide 19

Slide 19 text

[email protected] www.rittmanmead.com @rittmanmead Map 19

Slide 20

Slide 20 text

[email protected] www.rittmanmead.com @rittmanmead Spatial Pattern 20

Slide 21

Slide 21 text

[email protected] www.rittmanmead.com @rittmanmead Stream Processing Pipeline 21 This uses Environment Agency flood and river level data from the real-time data API (Beta)

Slide 22

Slide 22 text

[email protected] www.rittmanmead.com @rittmanmead Your Database Transactions Are Events! Transaction Log Kafka Oracle GoldenGate Connector Oracle GoldenGate for Big Data Change Data Capture (CDC) streams every change made to the database into Kafka Data resides in Kafka ready for streaming by one or more consumers Oracle Stream Analytics Each database table is a stream of events in Oracle Stream Analytics

Slide 23

Slide 23 text

[email protected] www.rittmanmead.com @rittmanmead Streaming from OGG to Kafka 23 • Oracle GoldenGate for Big Data is required • Set up extract as before • Replicat is defined as KafkaConnect, with JSON encoding - gg.handler.confluent.type=
 oracle.goldengate.kafkaconnect.KafkaConnectHandler - value.converter=
 org.apache.kafka.connect.json.JsonConverter • See https://www.confluent.io/blog/streaming-data-oracle-using-oracle-goldengate-kafka-connect/

Slide 24

Slide 24 text

[email protected] www.rittmanmead.com @rittmanmead Handling Nested JSON 24 • OSA currently only works with “flat” JSON • OGG nests the ‘payload’ in a sublevel of the message - e.g. OSA can’t currently reference payload.LOGON_ID

Slide 25

Slide 25 text

[email protected] www.rittmanmead.com @rittmanmead Logstash to the Rescue! 25 • Stream processing tool from Elastic • Very easy to configure • Ref: - http://stackoverflow.com/a/ 40131532/350613 - https://github.com/logstash-plugins/ logstash-filter-mutate/issues/90 input { kafka { zk_connect => 'localhost:2181' topic_id => 'ORCL.SOE.ORDERS' } } filter { ruby { code => " event.to_hash.delete_if {|k, v| k != 'payload'} event.to_hash.update(event['payload'].to_hash) event.to_hash.delete_if {|k, v| k == 'payload'} " } } output { kafka { topic_id => "ORCL.SOE.ORDERS_flat" bootstrap_servers => "localhost:9092" }}

Slide 26

Slide 26 text

[email protected] www.rittmanmead.com @rittmanmead Flattened JSON 26

Slide 27

Slide 27 text

[email protected] www.rittmanmead.com @rittmanmead View All Data Changes As They Happen 27

Slide 28

Slide 28 text

[email protected] www.rittmanmead.com @rittmanmead Filter and Chart Stream Values 28

Slide 29

Slide 29 text

[email protected] www.rittmanmead.com @rittmanmead Stream Aggregates 29

Slide 30

Slide 30 text

[email protected] www.rittmanmead.com @rittmanmead Join Streams 30

Slide 31

Slide 31 text

[email protected] www.rittmanmead.com @rittmanmead Output to Kafka 31 $ kafka-console-consumer \ --zookeeper localhost:2181 \ -—topic order_aggregates { "ts": 1487253152764000000, "count_30sec": 16, "avg_order_total_30sec": 8138.75, "max_order_total_30sec": 15102 } { "ts": 1487253162686000000, "count_30sec": 17, "avg_order_total_30sec": 5898.5884, "max_order_total_30sec": 15102 }

Slide 32

Slide 32 text

[email protected] www.rittmanmead.com @rittmanmead Stream Processing with Oracle Stream Analytics Transaction Log Kafka Oracle GoldenGate Connector Oracle GoldenGate for Big Data Oracle Stream Analytics HDFS connector HDFS/Hive Impala

Slide 33

Slide 33 text

[email protected] www.rittmanmead.com @rittmanmead Tool vs Hand-Coding 33 • Several powerful open-source frameworks - e.g. Spark Streaming, Apache Flink, Apache Kafka Streams, Google DataFlow/Apache Beam • Generally requires specialist coders and infrastructure/ops understanding • Parallel arguments with
 ETL tools vs PL/SQL

Slide 34

Slide 34 text

[email protected] www.rittmanmead.com @rittmanmead Tool vs Hand-Coding 34 • Faster to prototype and deploy • Accessible by non-coders • Built-in visualisation capabilities • Easier to support • Less flexibility • Slower to adopt new capabilities of streaming frameworks • License costs

Slide 35

Slide 35 text

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Fault Tolerant, Highly Available, Extreme Streaming – “with Big Data brings massive flows of Data Streams” New Enabling Runtime Infrastructure : Spark Streaming with Kafka Messaging Layer Oracle Stream Analytics – Driving New Innovation }

Slide 36

Slide 36 text

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Streaming predictive probability scoring – “I don’t know what I don’t know” New PMML Pattern offering that enables OSA integration with ORE (and SparkML) Oracle Stream Analytics – Driving New Innovation Predictive Analytics Data Warehouse Streaming Probability Scoring Oracle Stream Analytics

Slide 37

Slide 37 text

[email protected] www.rittmanmead.com @rittmanmead EOF 37 email
 [email protected] web
 http://ritt.md/rmoff http://rmoff.net twitter
 @rmoff irc
 rmoff @ #obihackers #EOF speakerdeck.com/rmoff/

Slide 38

Slide 38 text

[email protected] www.rittmanmead.com @rittmanmead Reading and References 38 • Simple developer download/install process for OSA • Docker image exists, enabling you to very quickly get up and running with OSA, on Mac or Windows too! • https://www.rittmanmead.com/blog/tag/osa/ • https://www.rittmanmead.com/blog/tag/spark-streaming/