Cos’è lo streaming e perché conta?

Dati in streaming con AWS Kinesis e Lambda

Maksim Pecherskiy

Data Engineer

Batch vs stream

chapter1_take_ms_dahkX.png

Dati in streaming con AWS Kinesis e Lambda

Batch vs stream

Batch

  • "Meglio"
  • Dataset più grandi
  • Analisi più complesse
  • Dati più lenti
  • Es. Report vendite giornaliero
  • Es. Previsione vendite del prossimo mese
  • Es. Churn prediction

Stream

  • "Più figo"
  • Analisi semplice: aggregazione/filtri
  • Record singoli / micro-batch
  • Dati velocissimi
  • Es. Rilevamento frodi
  • Es. Monitoraggio turbine eoliche
  • Es. Alert in tempo reale
Dati in streaming con AWS Kinesis e Lambda

Cody e la flotta

Cody

Cody accanto alla sua bici

La flotta

un collage di veicoli

Dati in streaming con AWS Kinesis e Lambda

Streaming telematico

chapter1_take_ms_IfvAm.png

chapter1_take_ms_tNX4d.png

chapter1_take_ms_frlCB.png

Dati in streaming con AWS Kinesis e Lambda

AWS Kinesis

Dati in streaming con AWS Kinesis e Lambda

Data Firehose

chapter1_take_ms_UPYak.png

Dati in streaming con AWS Kinesis e Lambda

Delivery streams

chapter1_take_ms_MDHnC.png

Dati in streaming con AWS Kinesis e Lambda

Delivery streams

chapter1_take_ms_ytekB.png

Dati in streaming con AWS Kinesis e Lambda

Delivery streams

chapter1_take_ms_gx6D1.png

Dati in streaming con AWS Kinesis e Lambda

Creare un client Firehose

import boto3

firehose = boto3.client('firehose',
aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET,
region_name='us-east-1')
Dati in streaming con AWS Kinesis e Lambda

Lavorare con i delivery stream

# Show created delivery streams
response = firehose.list_delivery_streams()

print(response['DeliveryStreamNames'])
['old-delivery-stream1', 'a-test-stream']
Dati in streaming con AWS Kinesis e Lambda

Eliminare stream

# Show created delivery streams
response = firehose.list_delivery_streams()

# Delete them all! for stream_name in response['DeliveryStreamNames']:
firehose.delete_delivery_stream(DeliveryStreamName=stream_name)
Dati in streaming con AWS Kinesis e Lambda

Riepilogo

  • Batch vs stream
  • Cody e raccolta telematica
  • AWS Kinesis
  • Kinesis Firehose Delivery Streams
  • AWS Kinesis Data Firehose
  • Elenca ed elimina i delivery stream Firehose
  • Producer -> generatore di dati
  • Destination -> destinazione dei dati
Dati in streaming con AWS Kinesis e Lambda

Ayo berlatih!

Dati in streaming con AWS Kinesis e Lambda

Preparing Video For Download...