Taming IoT Data: Making Sense of Sensors with SQL Streaming

A presentation at Voxxed Days Zurich in March 2019 in Zürich, Switzerland by Hans-Peter Grahsl

Slide 1

Slide 1

Taming IoT Data: Making Sense of Sensors with SQL Streaming

Slide 2

Slide 2

$ whoami ” • Hans-Peter Grahsl • working & living in Graz • technical trainer at • independent consultant & engineer • associate lecturer • @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland irregular conference speaker 2

Slide 3

Slide 3

WHAT IS STREAMING ! ❓ ! ❓ @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 3

Slide 4

Slide 4

“a type of data processing that is designed with infinite data sets in mind” — Tyler Akidau

Slide 5

Slide 5

Streaming == BIG DEAL 1. unbounded data sets are prevalent ➡ never-ending data streams need purpose-built systems 2. people crave for timely information ➡ stream processing technology aids lower latencies @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 5

Slide 6

Slide 6

BIGGEST Challenge? @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 6

Slide 7

Slide 7

These and many many more…

Slide 8

Slide 8

Today the choice is mine

Slide 9

Slide 9

Apache Kafka @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 9

Slide 10

Slide 10

STREAMING PLATFORM

Slide 11

Slide 11

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 11

Slide 12

Slide 12

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 12

Slide 13

Slide 13

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 13

Slide 14

Slide 14

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 14

Slide 15

Slide 15

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 15

Slide 16

Slide 16

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 16

Slide 17

Slide 17

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 17

Slide 18

Slide 18

Kafka’s streaming SQL engine @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 18

Slide 19

Slide 19

declarative stream processing language @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 19

Slide 20

Slide 20

skyrocketing developer productivity

Slide 21

Slide 21

unlocks streaming for the masses

Slide 22

Slide 22

KSQL’s Nature • built on top of Kafka Streams • SQL only (not embedded) • NO(!) coding skills required • extremely low entry barrier • familiar syntax and semantics • concise and expressive • joins, aggregations, windowing • UD(A)Fs and UDTFs coming soon… @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 22

Slide 23

Slide 23

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 23

Slide 24

Slide 24

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 24

Slide 25

Slide 25

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 25

Slide 26

Slide 26

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 26

Slide 27

Slide 27

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 27

Slide 28

Slide 28

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 28

Slide 29

Slide 29

KSQL Queries • per-record streaming with milliseconds latency • compiled into Kafka Streams applications • follow same execution model • distributed over multiple KSQL servers • two operation modes / deployment options: • interactive vs. headless @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 29

Slide 30

Slide 30

KSQL interactive mode • KSQL servers accessed via REST API • offers ad-hoc stream analytics • share streams & tables across users • used for exploration and during development

Slide 31

Slide 31

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 31

Slide 32

Slide 32

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 32

Slide 33

Slide 33

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 33

Slide 34

Slide 34

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 34

Slide 35

Slide 35

KSQL headless mode • streaming queries given by a SQL file • KSQL servers process SQL file • use case specific isolation • “locked-down” ➡ NO REST API access • used for production deployments

Slide 36

Slide 36

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 36

Slide 37

Slide 37

Slide 38

Slide 38

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 38

Slide 39

Slide 39

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 39

Slide 40

Slide 40

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 40

Slide 41

Slide 41

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 41

Slide 42

Slide 42

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 42

Slide 43

Slide 43

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 43

Slide 44

Slide 44

@hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 44

Slide 45

Slide 45

step 1 ingest sensor data @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 45

Slide 46

Slide 46

step 2 KSQL streaming @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 46

Slide 47

Slide 47

“You think that’s a database table you are querying now?” — Morpheus

Slide 48

Slide 48

“Instead, only try to realize the truth… there is no database table.” — Spoon Boy

Slide 49

Slide 49

step 3 connecting NoSQL @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 49

Slide 50

Slide 50

step 4 reactive notifications @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 50

Slide 51

Slide 51

step 5 live dashboards @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 51

Slide 52

Slide 52

MISSION accomplished

Slide 53

Slide 53

KSQL wrap-up • streaming with SQL … and nothing but SQL • scalable & fault-tolerant • deployable anywhere: cloud or on prem • viable for use cases of any size (XS … XXXL) • exactly-once delivery guarantee semantics @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 53

Slide 54

Slide 54

“If I have been faster it’s by streaming on the shoulders of Apache Kafka.” — my other self

Slide 55

Slide 55

Your obsession tells you to do batching. I tell you to walk away and stream with KSQL The choice is yours folks!

Slide 56

Slide 56

THANK YOU Q&A? https://bit.ly/2FaLr7w @hpgrahsl | #VDZ19 @VoxxedZurich, 19th March 2019, Switzerland 56

Slide 57

Slide 57