putting data to usefiles.informatandm.com/uploads/2018/10/putting... · • managed service for...

61
#ITDEVCONNECTIONS | ITDEVCONNECTIONS.COM PUTTING DATA TO USE Big Data and Analytics with AWS Karan Desai Solutions Architect AWS

Upload: others

Post on 25-Apr-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

#ITDEVCONNECTIONS | ITDEVCONNECTIONS.COM

PUTTING DATA TO USEBig Data and Analytics with AWS

Karan DesaiSolutions Architect

AWS

Page 2: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

speaker:~ $ whoami

> Solutions Architect at AWS since 2016

> Previously Akamai

> Previously Ericsson

> MS EE Virginia Tech

> San Francisco Bay Area resident

> Likes the cloud, airplanes, photography

Page 3: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

#ITDEVCONNECTIONS | ITDEVCONNECTIONS.COM

What to Expect from the Session

• Big data challenges• Architectural principles• Big data processing steps• What technologies should you use?

• Why?• How?

• Reference architecture• Design patterns

Page 4: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

What is Big Data?

Volume

Variety

Velocity

Veracity

Page 5: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Batch

processing

Stream

processing

Artificial

intelligence

Big Data Evolution

Page 6: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Virtual machines Managed services

Serverless

Cloud Services Evolution

Page 7: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Plethora of Tools

Amazon Glacier

Amazon S3 Amazon DynamoDB

Amazon RDS

Amazon EMR

Amazon Redshift

Amazon Kinesis

Lambda Amazon ML

Amazon SQS

ElastiCache

Amazon DynamoDBStreams

Amazon ES

Amazon Kinesis Analytics

Amazon QuickSight AWS Glue

Page 8: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Big Data Challenges

Why?

How?

What tools should I use?

Is there a reference architecture?

Page 9: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Architectural Principles

Page 10: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Architectural Principles

• Build decoupled systems

Data →

→ Store →

→ Process →

→ Analyze →

→ Answers

Page 11: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Architectural Principles

• Build decoupled systems• Data → Store → Process → Store → Analyze → Answers

• Use the right tool for the job• Data structure, latency, throughput, access patterns

• Leverage managed and serverless services • Scalable/elastic, available, reliable, secure, no/low admin

• Use log-centric design patterns• Immutable logs (data lake), materialized views

• Be cost-conscious• Big data ≠ big cost

• Enable your applications to use AI/ML

Page 12: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

What Is the Temperature of Your Data?

Page 13: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Hot Warm Cold

Volume MB–GB GB–TB PB–EB

Item size B–KB KB–MB KB–TB

Latency ms ms, sec min, hrs

Durability Low–high High Very high

Request rate Very high High LowCost/GB $$-$ $-¢¢ ¢

Hot data Warm data Cold data

Characterize your data: Hot, Warm, Cold

Page 14: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT STOREPROCESS/ANALYZE

CONSUME

Data Answers

Time to answer (Latency)

Throughput

Cost

Big Data Processing Steps

Page 15: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Choosing the Right Tools

Page 16: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT

Page 17: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT

DevicesSensors

IoT platformsAWS IoT STREAMS

IoT EventsData streams

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

FILES

Dat

a Tr

ansp

ort

& L

ogg

ing

Import/export

FilesLog files

Media files

Mobile apps

Web apps

Data centers AWS Direct Connect

RECORDSAp

plic

atio

ns

TransactionsData structures

Database records

Type of Data

Page 18: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

STORE

Page 19: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Events

Files

Transactions

COLLECT

DevicesSensors

IoT platformsAWS IoT STREAMS

IoT Data streams

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

FILES

Dat

a Tr

ansp

ort

& L

ogg

ing

Import/export

Log files

Media files

Mobile apps

Web apps

Data centers AWS Direct Connect

RECORDSAp

plic

atio

ns

Data structures

Database records

Type of Data STORE

NoSQL

In-memory

SQL

File/object store

Streamstorage

Page 20: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT

DevicesSensors

IoT platformsAWS IoT STREAMS

IoT

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail FILES

Dat

a Tr

ansp

ort

& L

ogg

ing

Import/export

Mobile apps

Web apps

Data centers AWS Direct Connect

RECORDS

Ap

plic

atio

ns

STORE

NoSQL

In-memory

SQL

File/object store

Streamstorage

Page 21: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Stream StorageCOLLECT

DevicesSensors

IoT platformsAWS IoT

STREAMS

IoT

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail FILES

Dat

a Tr

ansp

ort

& L

ogg

ing

Import/export

Mobile apps

Web apps

Data centers AWS Direct Connect

RECORDSAp

plic

atio

ns

STORE

NoSQL

In-memory

SQL

File/object store

Amazon Kinesis Firehose

Amazon KinesisStreams

Apache Kafka

Apache Kafka• High throughput distributed

streaming platform

Amazon Kinesis Streams• Managed stream storage

Amazon Kinesis Firehose• Managed data delivery

Page 22: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Decouple producers & consumers

Persistent buffer

Collect multiple streams

Preserve client ordering

Parallel consumption

Streaming MapReduce

4 4 3 3 2 2 1 14 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

4 4 3 3 2 2 1 1

Producer 1

shard 1 / partition 1

shard 2 / partition 2

Consumer 1

Count of red = 4

Count of violet = 4

Consumer 2

Count of blue = 4

Count of green = 4

Producer 2

Producer 3

Producer nKey = Violet

DynamoDB stream Amazon Kinesis stream Kafka topic

Why Stream Storage?

Page 23: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

• Decouple producers & consumers

• Persistent buffer

• Collect multiple streams

• No client ordering (standard) • FIFO queue preserves client ordering

• No streaming MapReduce

• No parallel consumption• Amazon SNS can publish to multiple

SNS subscribers (queues or Lambdafunctions)

What About Amazon SQS?

Co

nsu

mer

s

4 3 2 1

12344 3 2 1

1234

2134

13342

Standard

FIFOProducers

Amazon SQS Queue

Publisher

Amazon SNS

Topic

AWS Lambdafunction

Amazon SQSqueue

Queue

Subscriber

Page 24: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Which Stream/Message Storage Should I Use?

Hot Warm

AmazonKinesisStreams

AmazonKinesis Firehose

Apache Kafka(on Amazon EC2)

Amazon SQS(Standard)

Amazon SQS (FIFO)

AWS managed Yes Yes No Yes Yes

Guaranteed ordering Yes No Yes No Yes

Delivery (deduping) At least once At least once At least/At most/exactly once

At least once Exactly once

Data retention period 7 days N/A Configurable 14 days 14 days

Availability 3 AZ 3 AZ Configurable 3 AZ 3 AZ

Scale / throughput

No limit /~ shards

No limit /automatic

No limit /~ nodes

No limits /automatic

300 TPS / queue

Parallel consumption Yes No Yes No No

Stream MapReduce Yes N/A Yes N/A N/A

Row/object size 1 MB Destination row/object size

Configurable 256 KB 256 KB

Cost Low Low Low (+admin) Low-medium Low-medium

Page 25: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT STORE

File

Apache Kafka

Amazon KinesisStreams

Amazon Kinesis Firehose

Ho

t

Stre

am

Mobile apps

Web apps

DevicesSensors

IoT platformsAWS IoT

Data centers AWS Direct Connect

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

RECORDS

FILES

STREAMS

Dat

a Tr

ansp

ort

& L

ogg

ing

IoT

Ap

plic

atio

ns

Import/export

NoSQL

In-memory

SQL

Amazon S3

Amazon S3Managed object storage service built to store and retrieve any amount of data

File/Object Storage

Page 26: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Use Amazon S3 as Your Persistent File Store

• Natively supported by big data frameworks (Spark, Hive, Presto, etc.)

• Decouple storage and compute• No need to run compute clusters for storage (unlike HDFS)

• Can run transient Amazon EMR clusters with Amazon EC2 Spot Instances

• Multiple & heterogeneous analysis clusters and services can use the same data

• Designed for 99.999999999% durability

• No need to pay for data replication within a region

• Secure: SSL, client/server-side encryption at rest

• Low cost

Page 27: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

What About HDFS & Data Tiering?

• Use HDFS for hottest datasets

(e.g. iterative read on the same datasets)

• Use Amazon S3 Standard for

frequently accessed data

• Use Amazon S3 Standard – IA for

less frequently accessed data

• Use Amazon Glacier for archiving cold data

Use S3 Analytics to optimize tiering strategy

S3 Analytics

Page 28: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT STORE

Amazon DynamoDB

Amazon RDS

Amazon Aurora

File

Mobile apps

Web apps

DevicesSensors

IoT platformsAWS IoT

Data centers AWS Direct Connect

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

RECORDS

FILES

STREAMS

Logg

ing

IoT

Ap

plic

atio

ns

Amazon S3

Amazon DAX

Amazon ElastiCache

Import/export

SQL

No

SQL

Cac

he

Amazon ElastiCache

• Managed Memcached or Redis service

Amazon DynamoDB Accelerator (DAX)

• Managed in-memory cache for DynamoDB

Amazon DynamoDB

• Managed NoSQL database service

Amazon RDS

• Managed relational database service

Cache & Database

Apache Kafka

Amazon KinesisStreams

Amazon Kinesis Firehose

Ho

t

Stre

am

Page 29: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Anti-Pattern

Page 30: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Best Practice: Use the Right Tool for the Job

SearchIn-memory SQLNoSQL

Applications

Database TierGraphDB

Amazon RDS/Aurora

Amazon DynamoDB

AmazonElasticache

SAP HANA

Amazon ES

Amazon CloudSearch

Amazon Neptune

Page 31: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Which Data Store Should I Use?

Depends on-

• Data structure → Fixed-schema, JSON, Key/Value

• Access patterns → Store data in the format you will access it

• Data characteristics → Hot, warm, cold

• Cost → Right cost

Page 32: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Data Structure and Access Patterns

Access Patterns What to use?

Put/Get (key, value) In-memory, NoSQL

Simple relationships → 1:N, M:N NoSQL

Multi-table joins, transaction, SQL SQL

Faceting, Search Search

Graph traversal GraphDB

Data Structure What to use?

Fixed schema SQL, NoSQL

Schema-free (JSON) NoSQL, Search

Key/Value In-memory, NoSQL

Graph GraphDB

Page 33: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

In-memorySQL

Request rateHigh Low

Cost/GBHigh Low

LatencyLow High

Data volumeLow High

Amazon Glacier

Stru

ctu

re

NoSQL

Hot data Warm data Cold data

Low

High

Page 34: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Amazon ElastiCache

Amazon DAX

AmazonDynamoDB

AmazonRDS (Aurora)

Amazon ES Amazon S3AmazonGlacier

Average Latency

µs-ms µs-ms ms ms, sec ms,sec ms,sec,min(~ size)

hrs

TypicalData Volume

GB GB GB–TBs(no limit)

GB–TB(64 TB max)

GB–TB MB–PB(no limit)

GB–PB(no limit)

TypicalItem Size

B-KB KB(400 KB max)

KB(400 KB max)

KB(64 KB max)

B-KB(2 GB max)

KB-TB(5 TB max)

GB(40 TB max)

Request Rate

High – very high

High – very high Very high(no limit)

High High Low – high(no limit)

Very low

Storage CostGB/Month

$$ $$ ¢¢ ¢¢ ¢¢ ¢ ¢4/10

Durability Low -moderate

NA Very high Very high High Very high Very high

Availability High2 AZ

High3 AZ

Very high3 AZ

Very high3 AZ

High2 AZ

Very high3 AZ

Very high3 AZ

Hot data Warm data Cold data

Which Data Store Should I Use?

Page 35: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Cost-Conscious Design

Example:

• “I’m currently scoping out a project. The design calls for many small files, perhaps up to a billion during peak. The total size would be on the order of 1.5 TB per month…”

Request rate (Writes/sec)

Object size(Bytes)

Total size(GB/month)

Objects per month

300 2048 1483 777,600,000

Should I use Amazon S3 or Amazon DynamoDB?

Page 36: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Request rate (writes/sec)

Object size(bytes)

Total size(GB/month)

Objects per month

300 2,048 1,483 77,760,000

Amazon S3 or Amazon DynamoDB?

https://calculator.s3.amazonaws.com/index.html

Page 37: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Amazon S3Wins!

300 23,730 777,600,000 32,768

Amazon DynamoDBWins!

Request rate(writes/sec)

Object size(bytes)

Total size(GB/month)

Objects per month

300 2,048 1,483 777,600,000

Scenario 2

Scenario 1

Amazon S3 Standard

Storage $34

Put/list requests $3,888

Total $3,922

Amazon DynamoDB

Provisioned throughput $273

Indexed data storage $383

Total $656

Amazon S3 Standard

Storage $545

Put/List Requests $3,888

Total $4,433

Amazon DynamoDB

Provisioned Throughput $4,556

Indexed Data Storage $5,944

Total $10,500

Amazon S3 or Amazon DynamoDB?

Page 38: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

PROCESS / ANALYZE

Page 39: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

• API-driven Services

• Amazon Lex – Deep-learning based chatbots

• Amazon Polly – Text to speech

• Amazon Rekognition – Image and video analysis

• Amazon Comprehend – NLP, sentiment analysis

• Managed ML Platforms

• Amazon Sagemaker

• Amazon DeepLens

• MXNet and TensorFlow on AWS

• AWS Deep Learning AMI

• Pre-installed with MXNet, TensorFlow, Caffe2, Theano, Torch, Microsoft Cognitive Toolkit, and Keras; plus DL tools/drivers

Predictive AnalyticsPROCESS / ANALYZE

Pre

dic

tive

Am

azo

n A

I Lex PollyAML Rekognition

AWS DL AMI

Developers

Data scientists

Deep learningexperts

Page 40: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

PROCESS / ANALYZE

Amazon Redshift& Spectrum

Amazon Athena

Bat

chIn

tera

ctiv

e

Amazon ES

Interactive and Batch Analytics• Amazon Elasticsearch Service

• Managed Service for Elasticsearch

• Amazon Redshift and Amazon Redshift Spectrum• Managed Data Warehouse

• Spectrum enables querying Amazon S3

• Amazon Athena• Serverless Interactive Query Service

• Amazon EMR• Managed Hadoop Framework for running Apache Spark, Flink,

Presto, Tez, Hive, Pig, HBase, etc.

Presto

AmazonEMR

Page 41: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Stream/Real-time Analytics

Spark Streaming on Amazon EMR

Amazon Kinesis Analytics• Managed Service for running SQL on Streaming data

Amazon Kinesis Client Library

AWS Lambda• Run code Serverless (without provisioning or managing

servers)

• Services such as S3 can publish events to Lambda

• Lambda can pool event from a Kinesis

PROCESS / ANALYZE

KCLApps

AWS Lambda

Amazon Kinesis Analytics

Stre

am

StreamingAmazon EMR

Page 42: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Which Analytics Should I Use?PROCESS / ANALYZE

BatchTakes minutes to hoursExample: Daily/weekly/monthly reportsAmazon EMR (MapReduce, Hive, Pig, Spark)

InteractiveTakes secondsExample: Self-service dashboardsAmazon Redshift, Amazon Athena, Amazon EMR (Presto, Spark)

StreamTakes milliseconds to secondsExample: Fraud alerts, 1 minute metricsAmazon EMR (Spark Streaming), Amazon Kinesis Analytics, KCL, AWS Lambda

PredictiveTakes milliseconds (real-time) to minutes (batch)Example: Fraud detection, Forecasting demand, Speech recognitionAmazon AI (Lex, Polly, Sagemaker, Amazon Rekognition), Amazon EMR (Spark

ML), Deep Learning AMI (MXNet, TensorFlow, Theano, Torch, CNTK, Caffe)

Streaming

Amazon Kinesis Analytics

KCLApps

AWS Lambda

Stre

am

Amazon EMR

Fast

Amazon ES

Amazon Redshift& Spectrum

Presto

AmazonEMR

Amazon Athena

Bat

chIn

tera

ctiv

e Fast

Slo

w

Pre

dic

tive

Am

azo

n A

I Lex PollyAML Rekognition

AWS DL AMI

Page 43: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Which Stream Processing Technology Should I Use?

Amazon EMR (Spark Streaming)

KCL Application Amazon Kinesis Analytics AWS Lambda

Managed Service Yes No (EC2 + Auto Scaling) Yes Yes

Serverless No No Yes Yes

Scale/ThroughputNo limits /~ nodes

No limits /~ nodes

No limits / automatic

No limits /automatic

Availability Single AZ Multi-AZ Multi-AZ Multi-AZ

ProgrammingLanguages

Java, Python, ScalaJava, others via MultiLangDaemon

ANSI SQL with extensions Node.js, Java, Python

Sliding WindowFunctions

Build-in App needs to implementBuilt-in No

ReliabilityKCL and Spark checkpoints

Managed by KCLManaged by AmazonKinesis Analytics

Managed by AWS Lambda

Fast

Page 44: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Which Analytics Tool Should I Use?Amazon Redshift

Amazon RedshiftSpectrum

Amazon AthenaAmazon EMR

Presto Spark Hive

Use caseOptimized for data

warehousingQuery S3 data from

Amazon RedshiftInteractive Queries

over S3 dataInteractive

QueryGeneral purpose Batch

Scale/Throughput ~Nodes~Nodes

Automatic ~ Nodes

Managed Service Yes Yes Yes, Serverless Yes

Storage Local storage Amazon S3 Amazon S3 Amazon S3, HDFS

OptimizationColumnar storage, data compression, and zone

maps

AVRO, PARQUETTEXT, SEQRCFILE, ORC, etc.

AVRO, PARQUETTEXT, SEQRCFILE, ORC, etc.

Framework dependent

MetadataAmazon Redshift

CatalogGlue Catalog Glue Catalog

Glue Catalog orHive Meta-store

Auth/Access controlsIAM, Users, groups, and

access controlsIAM, Users, groups, and access controls

IAM IAM, LDAP & Kerberos

UDF support Yes (Scalar) Yes (Scalar) No Yes

Slow

Page 45: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

What About Extract Transform and Load?

ETLSTORE PROCESS / ANALYZE

Data Integration PartnersReduce the effort to move, cleanse, synchronize, manage, and automatize data-related processes.

• Fully managed (serverless) ETL service• Simple and cost-effective to categorize your

data, clean it, enrich it, and move it reliably between various data stores.

Data Catalog Job Authoring Job Execution

AWS Glue

Page 46: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

COLLECT STORE PROCESS/ANALYZE

Apache Kafka

Amazon KinesisStreams

Amazon Kinesis Firehose

Amazon DynamoDB

Amazon ElastiCache

Amazon RDS

Amazon Aurora

Ho

tH

ot

War

m

SQL

N

oSQ

L

Cac

he

File

Stre

am

Mobile apps

Web apps

DevicesSensors

IoT platformsAWS IoT

Data centers AWS Direct Connect

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

RECORDS

FILES

STREAMS

Dat

a Tr

ansp

ort

&

Logg

ing

IoT

Ap

plic

atio

ns

Slo

w

Amazon S3

Amazon ES

Amazon Redshift& Spectrum

Presto

AmazonEMR

Fast

Amazon Athena

Bat

chIn

tera

ctiv

e

Amazon DAX

Import/export

Pre

dic

tiv

eA

maz

on

AI Lex PollyAML Rekognition

AWS DL AMI

ETL

Streaming

Amazon Kinesis Analytics

KCLApps

Fast

Stre

am

Amazon EMR

AWS Lambda

Fast

CONSUME

Page 47: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

CONSUME

Page 48: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

• BI/AI Applications• Amazon EC2 or ECS/EKS Containers

• AWS Greengrass

• Data Science• Notebooks

• DS Platforms

• IDEs

• Analysis and Visualization• Amazon QuickSight

• Tableau

• ….

COLLECT STORECONSUM

EPROCESS/ANALYZEETL

Amazon QuickSight

An

alys

is &

vis

ual

izat

ion

Model

Train/Eval

Models

Deploy

Dat

aSc

ein

ce

AI AppsAmazon ECS

Ap

ps

AWS Greengrass

Pre

dic

tive

Am

azo

n A

I Lex PollyAML Rekognition

AWS DL AMI

Businessusers

DevOps

Data Scientists

Page 49: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Putting It All Together

Page 50: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Streaming

Amazon Kinesis Analytics

KCLApps

AWS Lambda

COLLECT STORE CONSUMEPROCESS/ANALYZE

Amazon ES

Apache Kafka

Amazon KinesisStreams

Amazon Kinesis Firehose

Amazon DynamoDB

Amazon ElastiCache

Amazon RDS

Amazon Aurora

Ho

tH

ot

War

m

Fast

Stre

am

SQL

N

oSQ

L C

ach

eFi

leSt

rea

m

Mobile apps

Web apps

DevicesSensors

IoT platformsAWS IoT

Data centers AWS Direct Connect

MigrationSnowball

Logging

Amazon CloudWatch

AWS CloudTrail

RECORDS

FILES

STREAMS

Amazon QuickSight

An

alys

is &

vis

ual

izat

ion

Dat

a Sc

ien

ce

Dat

a Tr

ansp

ort

&

Logg

ing

IoT

Ap

plic

atio

ns

Amazon EMR

Amazon Redshift& Spectrum

Presto

AmazonEMR

Fast

Slo

w

Amazon Athena

Bat

chIn

tera

ctiv

eP

red

icti

ve

Am

azo

n A

I

Amazon S3

Amazon DAX

Import/export

Lex PollyAML Rekognition

AWS DL AMI

AI AppsAmazon ECS

Ap

ps

Model

Train/Eval

Models

Deploy

ETL

AWS Greengrass

Page 51: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Spark Streaming AWS Lambda

KCL apps

Amazon Redshift

AmazonRedshift

Hive

Spark Presto

Pro

cess

ing

Tech

no

logy

Fast

Slo

w

Answers

Hive

Native appsKCL appsAWS Lambda

Amazon Athena

Amazon Kinesis Amazon DynamoDBRDS/Aurora

Amazon S3Data

Hot Cold

Data Store

Page 52: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Reference Architectures

Page 53: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Real-time Analytics

Amazon EMR

KCL app

AWS Lambda

SparkStreaming

AmazonAI

Real-time prediction

AmazonElastiCache

(Redis)

AmazonDynamoDB

AmazonRDS

AmazonES

App state orMaterializedView

KPI

Process

Store

AmazonKinesis

Stream

Amazon KinesisAnalytics

Amazon SNS NotificationsAlerts

AmazonS3

Log

Amazon KinesisFan out Downstream

Page 54: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Interactive andBatch Analytics

process

store Batch

Interactive

Amazon EMR

Hive

Pig

Spark

AmazonAI

Batch prediction

Real-time prediction

Amazon S3

Files

StreamAmazon Kinesis

Firehose

Amazon KinesisAnalytics

Amazon Redshift

Amazon ES

Consume

Amazon EMR

Presto

Spark

Amazon Athena

Page 55: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Real-time

App state orMaterializedView

InteractiveandBatch

Data Lake

Amazon S3

Amazon Redshift

Amazon EMR

Presto

Hive

Pig

Spark

AmazonElastiCache

AmazonDynamoDB

AmazonRDS

AmazonES

AWS Lambda

Spark Streaming on Amazon EMR

Ap

pl

ic

at

io

nsAmazon

KinesisKCL

AmazonAI

AmazonDynamoDB

AmazonRDS

Change Data Capture or Export

Transactions

Stream

Files

Amazon KinesisAnalytics

Amazon Athena

Amazon KinesisFirehose

Amazon ES

Page 56: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

What about Metadata?

• Glue Catalog• Hive Metastore compliant

• Crawlers - Detect new data, schema, partitions

• Search - Metadata discovery

• Amazon Athena, Amazon EMR, and Amazon Redshift Spectrum compatible

• Hive Metastore (Presto, Spark, Hive, Pig) • Can be hosted on Amazon RDS

Data Catalog Metastore RDS

GlueCatalog

AWS Glue

Page 57: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Security & Governance

• AWS Identity and Access Management (IAM)

• Amazon Cognito

• Amazon CloudWatch & AWS CloudTrail

• AWS KMS and Secrets Manager

• AWS Directory Service

• Apache Ranger

Security & Governance IAM Amazon CloudWatch AWS

CloudTrailAWS

AWS KMSAWS

CloudHSMAWS Directory ServiceAmazon

Cognito

Page 58: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Data AnalyticsReference Architecture

Summary

Data Catalog Metastore RDS

GlueCatalog

AWS Glue

Security & Governance IAM Amazon CloudWatch AWS

CloudTrailAWS

AWS KMSAWS

CloudHSMAWS Directory ServiceAmazon

Cognito

Page 59: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

The Challenge

Equipment sensor data from 900 GE Power sites worldwide

500,000 data records per second to collect and process

Low-latency automatic alerts when equipment issues detected

Solution

Amazon Kinesis Data Streams ingest 20 billion records per day

Amazon EMR processes data in near-realtime

Analytical data stored on Amazon S3 for archiving

Impact

Better, faster visibility into their power plant operations

“Promptly identified a problem with a customer’s power plant combustion system early enough to schedule equipment shutdown and repaired the problem at a fraction of what a catastrophic failure would have cost. They saved millions of dollars as a result.”

Page 60: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

Summary

• Build decoupled systems• Data → Store → Process → Store → Analyze → Answers

• Use the right tool for the job• Data structure, latency, throughput, access patterns

• Leverage AWS managed and serverless services • Scalable/elastic, available, reliable, secure, no/low admin

• Use log-centric design patterns• Immutable logs, data lake

• Be cost-conscious• Big data ≠ Big cost

• Enable your applications to use AI/ML

Page 61: PUTTING DATA TO USEfiles.informatandm.com/uploads/2018/10/Putting... · • Managed Service for running SQL on Streaming data Amazon Kinesis Client Library AWS Lambda • Run code

#ITDEVCONNECTIONS | ITDEVCONNECTIONS.COM

Thank You!

Karan DesaiSolutions ArchitectAWS

Email: [email protected] Twitter: @somecloudguy

PUTTING DATA TO USEBig Data and Analytics with AWS