Professional Documents
Culture Documents
Kanchan Waikar
Senior Partner Solutions Architect at AWS
kanchanwaikar
Joseph Morais
AWS Evangelist/Cloud Partner Solutions Architect, Confluent
theejosephmorais
Event Streaming
And why you might care
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Every Industry is Moving from Batch/Manual to
Software-Defined
Software-using Software-defined
Banking Nightly credit-card fraud checks Real-time credit card fraud prevention
U.S. Defense
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
5 Agencies
Becoming Software-Defined is a Competitive
Requirement
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Platform Requirements for Becoming Software-
Defined
Software- Built for Scalable for Transient Raw data
using Historical Data Transactional Data
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Only Event Streaming Has All 4 Requirements
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Rise of Event Streaming
60%
Fortune 100 Companies
Using Apache Kafka
What or who is Kafka?
The Append-only log
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Both Kafkas like to write
Time
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka
Writers Readers
cluster
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scalability of a filesystem
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Guarantees of a Database
• Strict ordering
• Persistence
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Rewind & Replay
Reset to any point in the shared narrative
• Replication
• Fault Tolerance
• Partitioning
• Elastic Scaling
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Producing to Kafka
Time
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka Topics
my-topic
broker-1
my-topic-partition-0
broker-2
my-topic-partition-1
broker-3
my-topic-partition-2
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Partition Leadership and Replication
Topic1 Topic1 Topic1
partition1 partition1 partition1
Leader Follower
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Partition Leadership and Replication - node failure
Topic1 Topic1 Topic1
partition1 partition1 partition1
Leader Follower
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Producing to
Kafka
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Serializer
Kafka doesn’t care about what you send to it as long as it’s been
converted to a byte stream beforehand.
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Record Keys and why they’re important - Ordering
Record keys determine the partition with the default Kafka partitioner
Producer Record
Topic
[Partition]
[Key] partitioner
Value
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Record Keys and why they’re important - Ordering
Record keys determine the partition with the default Kafka partitioner,
and therefore guarantee order for a key
Producer Record
Topic
[Partition]
AAAA partitioner
Value
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Record Keys and why they’re important - Ordering
Producer Record
Topic
[Partition]
BBBB
partitioner
Value
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Record Keys and why they’re important - Ordering
Producer Record
Topic
[Partition]
CCCC
partitioner
Value
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Record Keys and why they’re important - Ordering
Record keys determine the partition with the default Kafka partitioner,
and therefore guarantee order for a key
Producer Record
Topic
[Partition]
DDDD
partitioner
Value
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Producer Guarantees
Producer Properties
Leader Follower
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Producer Guarantees
P
ack
Producer Properties
Leader Follower
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Producer Guarantees
Producer Properties
Leader Follower
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming
from Kafka
Consuming together is better
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Single Consumer
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Grouped Consumer
CC
C1
CC
C2
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Grouped Consumer
C C
C C
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Grouped Consumer
0 1
2 3
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Grouped Consumer
0 1
2 3
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Consuming From Kafka - Grouped Consumer
0,
1
3
2 3
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka APIs
Making Kafka an event-streaming platform
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka Connect and Kafka Streams
Your App
KAFKA
STREAMS
Source Sink
KAFKA KAFKA
CONNECT CONNECT
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka Connect: Reliable and scalable integration
of Kafka with other systems
• Centralized management and configuration • Fault tolerant and automatically load balanced
• Support for hundreds of technologies including • Extensible API
RDBMS, Elasticsearch, HDFS, S3
• Single Message Transforms
• Supports CDC ingest of events from RDBMS
• Part of Apache Kafka
• Preserves data schema
{
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"connection.url": "jdbc:mysql://localhost:3306/demo?user=rmoff&password=foo",
"table.whitelist": "sales,orders,customers"
}
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kafka Streams: Write standard Java apps and
microservices to process your data in real-time
• No separate processing cluster required • Perfect for small, medium, large use cases
• Develop on Mac, Linux, Windows • Fully integrated with Kafka security
• Deploy to containers, VMs, bare metal, cloud • Exactly-once processing semantics
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Stream processing with Kafka
Main
Logic
Example: Using Kafka’s Streams API for writing elastic, scalable, fault-tolerant Java and
Scala applications
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ksqlDB to the rescue
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kanchan Waikar
Senior Partner Solutions Architect at AWS
kanchanwaikar
A real-world streaming use-case
Use-case:
A non-compliance identification and notification system
Goal: Construction
work-site
Reduce accidents by identifying and correcting non-compliance
Infrastructure-scale:
Tens of thousands of surveillance cameras, hundreds of construction sites, thousands of construction
workers
Project Requirement:
Design an automated PPE non-compliance reporting system that reports incidences in matter of minutes.
Technical requirements:
Must scale up-and-down automatically based on loads (Cameras turned ON and OFF based on shift hours)
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example video: construction site surveillance
Courtesy - https://pixabay.com/videos/construction-road-excavator-worker-26239/
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary Logs
(Start) HH:mm:SSS-(End) HH:mm:SSS : Alarm/No alarm : Status Details
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Building an ML-driven streaming application
Event Streaming platform KSQLDB Data Visualization tool Interactive Query service Metadata storage
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Pre-trained
ML Models
Mobile
client
Safety
Administrator
Amazon Simple
Amazon Notification
SageMaker Service
Email notification
AWS Lambda
ksqlDB
ksqlDB
Construction
work-site
S3 Bucket
S3 Sink S3 Bucket Amazon Athena
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML Models
AKTE - Forklift Detector GluonCV SSD Object Detector Construction Worker Detection Social Distancing Detector
Pre-trained Model Pre-trained Model Pre-trained Model Pre-trained Model
Helmet & Vest Detector for Worker Safety PPE Detector for Laboratory Safety Construction Machines Detector
Pre-trained Model Pre-trained Model Pre-trained Model
TensorIoT CV PPE Mask Detection Hard Hat Detector for Worker Safety
Pre-trained Model Pre-trained Model
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Marketplace for Machine Learning Amazon SageMaker
14 industry segments
61 sellers
Speech
Video recognition
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deploying ML models from AWS Marketplace
SECURE YOUR DATA BY DEPLOYING MODELS IN YOUR VPC, IN
NETWORK ISOLATION MODE
Model from
AWS
Real-time
Amazon
Marketplace
inference
SageMaker
1 2 3 4
https://aws.amazon.com/marketplace/solutions/machine-learning/pre-trained-models
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How to deploy ML
models with
Amazon Sagemaker
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Marketplace
8,000+
listings
1,600+ ISVs
24
regions
290,000+
customers
1.5M+
subscriptions
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Confluent Cloud
DEVELOPER OPERATOR/INFOSEC ARCHITECT/LOB
Rich Pre-built Ecosystem Enterprise-grade Security & Compliance Enterprise-grade Security & Compliance
Connectors | Schema Registry | ksqlDB Authorization | Authentication | Encryption Authorization | Authentication | Encryption
Apache Kafka
Enterprise Professional
Committer-driven Expertise Training Partners
Support Services
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Real-time analysis
Store & Analyze
Ingest & Process Stream data into your AWS data lake or data warehouse to execute
queries on streaming data for real-time and batch analytics
ANALYZE VISUALIZE
Schema
Registry
Mobile
Amazon AWS Lake Amazon Amazon
Redshift Sink Redshift Formation Athena Elasticsearch
Web
Events
TRANSFORM
S3 Sink
IoT Amazon
Source S3
connectors
Data store
AWS & On-prem Amazon AWS Data AWS
EMR Pipeline Glue
ksqlDB
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless integrations
Schema
Registry
S3 Sink
Data stores Source
Amazon Amazon Amazon
Connectors
S3 Athena Redshift
ksqlDB
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Modernization
Bridge
Hybrid cloud streaming to enable event-driven architecture
MAINFRAME Replicator
Redshift Sink
Lambda Sink
LEGACY DB
ksqlDB Amazon Amazon
JDBC / CDC AWS Direct DynamoDB Aurora
connectors Connect
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Integrations via connectors available in
Amazon Kinesis
Amazon S3
Source Sink
Kafka Cluster
syslog
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Disney+hotstar powers explosive growth
with real-time event streaming on Confluent Platform
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Confluent on the AWS Marketplace (free trial)
https://aws.amazon.com/marketplace
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Marketplace can help you get started
Find Buy Deploy
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Webinar summary
Think about Kafka for your event-based architectures and consider pre-build ML
models with Amazon Sagemaker to get started quickly
Look to AWS partners like Confluent to help you scale and provide support
Use AWS Marketplace to help you discovery, experiment and innovate with new tools
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.