+ All Categories
Home > Documents > Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams......

Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams......

Date post: 20-May-2020
Category:
Upload: others
View: 26 times
Download: 0 times
Share this document with a friend
48
TechArch Day 2018 Architecting Fast Data Applications Gerard Maas
Transcript
Page 1: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

TechArch Day 2018

Architecting Fast Data Applications

Gerard Maas

Page 2: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Architecting Fast Data Applications

TechArch Day 2018 - Helsinki, October 3, 2018

Gerard MaasSenior SW Engineer, Lightbend, Inc.

Page 3: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Gerard MaasSeñor SW Engineer

[email protected]

@maasg

https://github.com/maasg

https://www.linkedin.com/in/gerardmaas/

https://stackoverflow.com/users/764040/maasg

Page 4: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session
Page 5: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Why Streaming?

Fast Data Architectures

((( Quick Demo )))

The Future of Fast Data

Page 6: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Why Streaming?

Page 7: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Fast Data Use Cases

Real-time marketing based on behavior, location, inventory levels, product promotions, etc.

Real-time Personalization

Drive better business outcomes through real-time risk, fraud detection, compliance, audit, governance, etc.

Real-time Financial ProcessesPredictive Analytics

Apply ML models to large volumes of device data to pre-empt failures / outages

Real-time consumer and industrial Device and Supply Chain management at scale

IoT

https://www.lightbend.com/customers

Page 8: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Fast Data Use Cases

Real-time marketing based on behavior, location, inventory levels, product promotions, etc.

Real-time Personalization

Drive better business outcomes through real-time risk, fraud detection, compliance, audit, governance, etc.

Real-time Financial ProcessesPredictive Analytics

Apply ML models to large volumes of device data to pre-empt failures / outages

Real-time consumer and industrial Device and Supply Chain management at scale

IoT

https://www.lightbend.com/customers

Page 9: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

•ML models applied to device telemetry to detect anomalies

•Preemptive maintenance prevents potential failures that would impact users

Predictive Analytics

Page 10: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Predictive Analytics - Core Idea

AnomalyHandler

TelemetryRecords

Probable Anomalies

CorrectiveActions

Anomaly Detection:

Model

Page 11: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Predictive Analytics - Core Idea

AnomalyHandler

TelemetryRecords

Probable Anomalies

CorrectiveActions

Ingest telemetry from edge devices.

Train models to look for anomalies… and score

incoming telemetry.

Handle anomaly: move activity off component, schedule maintenance window to replace it.

Anomaly Detection

Model

Page 12: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Page 13: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Session Mngmt,Restful msvcs

Page 14: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Model Scoring

Page 15: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Model Training

Page 16: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Ingest Device Telemetry

Page 17: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Periodically Train Anomaly Detection Model

Page 18: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Updated model parameters are written back to Kafka

Page 19: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Updated model parameters are also written to secondary storage for resilience

Page 20: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Ingest model parameters in the low-latency microservice for serving

Page 21: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Ingest telemetry data to score it, looking for anomalies.

Page 22: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Write detected anomalies back to Kafka in a new topic

Page 23: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Read anomaly information into microservices that manage the devices remotely

Page 24: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

microservicesmicroservicesMicroservice

Kafka

Storage

Akka Streams

Kafka Streams

...

Low LatencyMicroservices

Spark

Data Center

Streaming, Batch Processing

Device SessionMicroservices

Example Architecture

ModelTraining

ModelStorage

ModelServing

ScoresIngestion

Telemetry

CorrectiveAction

Take corrective action, e.g., download patches, disable, reset, ...

Page 25: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Fast Data Architectures

Page 26: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session
Page 27: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Requirements?● Latency. How Low?● Throughput. How High?● Which kind of data processing?● How do you want to build, deploy,

and manage those services?

Page 28: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kubernetes, Mesos, YARN

Cloud | On-prem

On-Prem Cloud

Substrate

Page 29: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kubernetes, Mesos, YARN

Cloud | On-prem

Substrate Messaging Backbone

Page 30: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kafka

Batch

Kubernetes, Mesos, YARN

Cloud | On-prem

Streams Streams

Substrate Messaging Backbone ProcessingEngine

Page 31: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kafka

Spark

Flink

Stream ProcMicroservices

Akka Streams

Kafka Streams

Spark

Batch

Kubernetes, Mesos, YARN

Cloud | On-prem

Substrate Messaging Backbone ProcessingEngine

Microservices

Page 32: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kafka

Storage

Spark

Flink

Stream Proc

Reactive Platform

Go node.js

Microservices

Akka Streams

Kafka Streams

Spark

Batch

HDFS

S3...

SQL NoSQL

Kubernetes, Mesos, YARN

Cloud | On-prem

Substrate Messaging Backbone ProcessingEngineMicroservices Storage

Page 33: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kafka

Storage

Spark

Flink

Stream Proc

Reactive Platform

Go node.js

Microservices

Akka Streams

Kafka Streams

Spark

Batch

HDFS

S3...

SQL NoSQL

Kubernetes, Mesos, YARN

Cloud | On-prem

Substrate Messaging Backbone ProcessingEngineMicroservices Storage Monitoring &Management

Page 34: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Kafka

Storage

Spark

Flink

Stream Proc

Reactive Platform

Go node.js

Microservices

Akka Streams

Kafka Streams

Spark

Batch

HDFS

S3...

SQL NoSQL

Files

Sockets

REST

Kubernetes, Mesos, YARN

Cloud | On-prem

Page 35: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

((( Quick Demo )))

Page 36: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

{...}

Aggregator records

Page 37: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Call-Record-Aggregatordatamodelakka-cdr-ingestor

akka-java-aggr-outspark-aggregation

Page 38: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Call-Record-Aggregatordatamodelakka-cdr-ingestor

akka-java-aggr-outspark-aggregation

CDRs

HTTPIngress

Aggregator

ConsoleOut

Page 39: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

$>_

Page 40: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

The Future of Fast Data

Page 41: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

ReactiveSystems

FastData

Applications

BigData

Microservices

The Evolution of Current Trends

Growing number of workloads are moving from “data at rest” to “data in motion”

Streaming data pipelines are being served by Microservices

Page 42: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Microservices Stream Processing

ContainerizationOrchestration

Page 43: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

"This is what makes time travel possible." —Doc Brown

Img src: http://backtothefuture.wikia.com/wiki/Flux_capacitor

The Flux Capacitor

Page 44: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Microservices are a part of a streaming pipeline

A pipeline can now be exposed as Microservices

Packaged, deployed and managed as cloud-native applications with the right tools

Page 45: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

lightbend.com/fast-data-platform

Learn more

Page 46: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

lightbend.com/fast-data-platform

Page 47: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session
Page 48: Architecting Fast Data Applications - TechArch Day · Kafka Storage Akka Streams Kafka Streams... Low Latency Microservices Spark Data Center Streaming, Batch Processing Device Session

Thank you


Recommended