SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Bridging the Gap:
Connecting AWS and Kafka
Ryanne Dolan & Jason Li
LinkedIn
Overview
● Motivation
● What is Kinesis?
● Architecture
● Checkpointing
● Metrics
● DynamoDB Streams
● Validation
Story starts at Bizo
● Originally batch-oriented architecture: AWS S3, Spark
● Started converting to stream-oriented architecture in 2013: AWS Kinesis
● Acquired by LinkedIn in 2014
● Originally batch-oriented integration with LinkedIn’s data centers
● Started bridge project in 2015
● Other teams (including other startups) have started using it
Use Cases
● User-tracking events from Bizo Kinesis -> LI Kafka
● Leverage LI A/B tooling from AWS (requires Kafka events)
● Leverage LI ELK stack from AWS (Kinesis -> Kafka -> ELK)
● Leverage LI call tracing, site speed, and other metrics, reports
● Ship application and CloudWatch metric from AWS to LI (Kinesis -> Kafka -
> inGraph)
Requirements
● encoding agnostic (Thrift, Avro, JSON, etc)
● to/from Kafka
● to/from Kinesis
● preserve partitioning
● near real-time bidirectional replication
● stream multiplexing and joining
● support multiple AWS accounts
● multiple metrics endpoints (including CloudWatch)
Kinesis Highlights
● VERY similar to Kafka
● Dynamic, scalable “shards” (instead of static partitions)
● Throughput and cost tied to # of shards
● Each shard:
○ $0.015/hour
○ 1000 records/second
○ 1MB/s ingress
○ 2MB/s egress
● Integration with AWS services, e.g. “Firehose” -> S3
Kinesis-Kafka
Bridge
Kinesis-Kafka Bridge
● Samza job
● Kinesis System (Producer and Consumer)
● BridgeTask
● input/output mapping
● Repartitioner
● Transcoder
BridgeTask
Kinesis
Consumer
Repartitioner Transcoder
Kinesis
Producer
Kafka
Consumer
Bridge
Mapping
Kafka
Producere.g. Partition 1 ->
shard-000001
e.g. Thrift -> Avro e.g. llama.abc ->
kafka.xyz
Transcoders
Thrift-encoded
bytes
AvroEnvelope
Transcoder
AvroEnvelope with
Thrift-encoded
payload
AvroSerde
Avro-encoded
bytes
Bridge Mappings
BridgeTask again (notice multiple outputs!)
Kinesis
Consumer
Repartitioner Transcoder
Kinesis
Producer
Kafka
Consumer
Bridge
Mapping
Kafka
Producere.g. Partition 1 ->
shard-000001
e.g. Thrift -> Avro e.g. llama.abc ->
kafka.xyz
BridgeTask
The Kinesis
System
KinesisConsumer
● wraps the Kinesis Consumer Library (KCL)
● extends Samza’s BlockingEnvelopeMap
● creates one KCL Worker per Shard
● at least one Worker per KinesisConsumer instance
● Workers push envelopes into queue
KinesisProducer
● uses Kinesis PutRecords API (batch)
● enqueues envelopes (async)
● flushes off-thread
KinesisSystemAdmin
● queries Kinesis API for # shards at start-up
● tells Samza: # partitions == # shards
● # shards may change at any time, but OK in practice
● KCL will load-balance Workers automatically
The
Checkpointing
Problem
Checkpointing
● TWO sources of checkpoints: Samza and KCL
○ Samza checkpoints to a Kafka topic
○ KCL checkpoints to a DynamoDB table
○ similar semantics
● both systems must agree
● otherwise, possible DATA LOSS
Checkpointing Data Loss
1. KCL consumes a record
2. KCL checkpoints
3. Bridge replays the record to Kafka
4. container crashes before Kafka buffer flushed
5. container restarts
6. KCL restarts at checkpoint
--> buffered records lost
Checkpointing Solution
Checkpoint Kinesis Records only after they are flushed to Kafka.
Checkpoint Kafka Records only after they are flushed to Kinesis.
Producers must notify Consumers when it is safe to checkpoint.
Consumers must be able to request and wait for a Producer flush.
CheckpointableEnvelope
● KinesisConsumer registers onSynced listener
● BridgeTask registers listeners for each output stream
● KafkaProducer fires event after successful flush
● envelope is checkpointed only after ALL output streams have flushed
● each individual envelope is tracked this way, but...
● checkpoints only occur at sentinel envelopes at the end of each
GetRecords batch
● (for non-sentinels, onSynced is a noop)
CheckpointableEnvelope
SyncedProducerProxy wraps KafkaProducer
Metrics
Two Stacks...
● Bizo infra is on AWS CloudWatch, including metrics, alarms, paging
● LinkedIn has inGraphs for same purpose
Need to be able to monitor the bridge from both.
https://engineering.linkedin.com/32/eric-intern-origin-ingraphs
a custom MetricTracker
● publishes metrics to CW and inGraphs
● locally aggregates metrics to minimize API calls
● each metric has dimensions:
○ shard
○ partition
○ stream
○ system
● each metric re-published with hierarchy of dimensions
shard-level metrics
partition-level metrics
stream-level metrics
system-level metrics
application-level metrics
heartbeat metrics
(due to 1 minute buffer)
30sec RTT
DynamoDB Stream to
Kafka Bridge
Motivation
● Some of our services are running on AWS, e.g. video transcoding
● We want to replicate AWS data in LinkedIn data center
○ Serve requests from LinkedIn data center directly
○ Migrate off AWS easily
What is DynamoDB Stream
“A DynamoDB stream is an ordered flow of information about changes to items
in an Amazon DynamoDB table. When you enable a stream on a table,
DynamoDB captures information about every modification to data items in the
table.”
AWS documentation
Example DynamoDB Stream Record
{
"EventID":"f561f0491ce42a95a60ad1fc082ae98b",
"EventName":"MODIFY",
"EventVersion":"1.0",
"EventSource":"aws:dynamodb",
"AwsRegion":"us-east-1",
"Dynamodb":{
"Keys":{
"uuid":{
"S":"255"
}
},
"NewImage":{
<json representation of new image>
},
"OldImage":{
<json representation of old image>
},
"SequenceNumber":"593721700000000002066915768",
"SizeBytes":326,
"StreamViewType":"NEW_AND_OLD_IMAGES"
}
}
DynamoDB Stream Bridge Design
DynamoDB Stream Record to Kafka Message
● Concatenate sorted DynamoDB keys as Kafka partition key
● Put the DynamoDB Stream record in Kafka message. e.g.
{'kafkaMessageSegmentHeader': None, 'payload': '{"EventID":"f5b5e336f056f2656b23bfeed3cd45c8","
EventName":"MODIFY","EventVersion":"1.0","EventSource":"aws:dynamodb","AwsRegion":"us-east-1","Dynamodb":
{"Keys":{"RecordId":{"N":"0"}},"NewImage":{"ReadableTime":{"S":"Wed Feb 17 01:13:02 UTC 2016"},"RecordId":
{"N":"0"},"Timestamp":{"N":"1455671582888"}},"OldImage":{"ReadableTime":{"S":"Wed Feb 17 01:13:02 UTC
2016"},"RecordId":{"N":"0"},"Timestamp":{"N":"1455671582394"}},"SequenceNumber":"
29102800000000002523034570","SizeBytes":141,"StreamViewType":"NEW_AND_OLD_IMAGES"}}'}
Use Cases
● Replicate rich media platform video transcoding metadata to LinkedIn data
center (DynamoDB Stream -> Kafka -> Espresso)
Kinesis vs DynamoDB Stream
Validation
validation pipeline
Summary
With the ability to ship data from AWS Stream to LinkedIn Kafka and vice versa
using Samza, we can now seamlessly integrate AWS with LinkedIn.
Q & A

Mais conteúdo relacionado

Mais procurados

Exactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsExactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsGuozhang Wang
 
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...HostedbyConfluent
 
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...HostedbyConfluent
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using KafkaKnoldus Inc.
 
Introduction to Apache Kafka and why it matters - Madrid
Introduction to Apache Kafka and why it matters - MadridIntroduction to Apache Kafka and why it matters - Madrid
Introduction to Apache Kafka and why it matters - MadridPaolo Castagna
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaAngelo Cesaro
 
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...DataWorks Summit/Hadoop Summit
 
Capture the Streams of Database Changes
Capture the Streams of Database ChangesCapture the Streams of Database Changes
Capture the Streams of Database Changesconfluent
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaSteven Wu
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformJean-Paul Azar
 
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...HostedbyConfluent
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsSlim Baltagi
 
Kafka Summit SF 2017 - Kafka and the Polyglot Programmer
Kafka Summit SF 2017 - Kafka and the Polyglot ProgrammerKafka Summit SF 2017 - Kafka and the Polyglot Programmer
Kafka Summit SF 2017 - Kafka and the Polyglot Programmerconfluent
 
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails? Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails? confluent
 
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLKafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLconfluent
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...HostedbyConfluent
 
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020confluent
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...confluent
 

Mais procurados (20)

Exactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsExactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka Streams
 
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
 
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Introduction to Apache Kafka and why it matters - Madrid
Introduction to Apache Kafka and why it matters - MadridIntroduction to Apache Kafka and why it matters - Madrid
Introduction to Apache Kafka and why it matters - Madrid
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache Kafka
 
Kafka aws
Kafka awsKafka aws
Kafka aws
 
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
 
Capture the Streams of Database Changes
Capture the Streams of Database ChangesCapture the Streams of Database Changes
Capture the Streams of Database Changes
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platform
 
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiasts
 
Kafka Summit SF 2017 - Kafka and the Polyglot Programmer
Kafka Summit SF 2017 - Kafka and the Polyglot ProgrammerKafka Summit SF 2017 - Kafka and the Polyglot Programmer
Kafka Summit SF 2017 - Kafka and the Polyglot Programmer
 
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails? Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
 
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLKafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
 
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
 
Kafka blr-meetup-presentation - Kafka internals
Kafka blr-meetup-presentation - Kafka internalsKafka blr-meetup-presentation - Kafka internals
Kafka blr-meetup-presentation - Kafka internals
 

Destaque

Automated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSAutomated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSSonatype
 
Neuigkeiten von DEPAROM & Co
Neuigkeiten von DEPAROM & CoNeuigkeiten von DEPAROM & Co
Neuigkeiten von DEPAROM & CoArne Krueger
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesAngelos Kapsimanis
 
Reproducible Science with Python
Reproducible Science with PythonReproducible Science with Python
Reproducible Science with PythonAndreas Schreiber
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
e-Extortion Trends and Defense
e-Extortion Trends and Defensee-Extortion Trends and Defense
e-Extortion Trends and DefenseErik Iker
 
Astricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionAstricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionDan Jenkins
 
Gartner 2017 London: How to re-invent your IT Architecture?
Gartner 2017 London: How to re-invent your IT Architecture?Gartner 2017 London: How to re-invent your IT Architecture?
Gartner 2017 London: How to re-invent your IT Architecture?LeanIX GmbH
 
Fostering a Culture of Analytics
Fostering a Culture of AnalyticsFostering a Culture of Analytics
Fostering a Culture of AnalyticsAlex Welch
 
Reversing malware analysis training part2 introduction to windows internals
Reversing malware analysis training part2 introduction to windows internalsReversing malware analysis training part2 introduction to windows internals
Reversing malware analysis training part2 introduction to windows internalsCysinfo Cyber Security Community
 
Streaming architecture with HDP & ELK
Streaming architecture with HDP & ELKStreaming architecture with HDP & ELK
Streaming architecture with HDP & ELKAlain Douangpraseuth
 
Business selectors
Business selectorsBusiness selectors
Business selectorsbenwaine
 
Apostila De Dispositivos EléTricos
Apostila De Dispositivos EléTricosApostila De Dispositivos EléTricos
Apostila De Dispositivos EléTricoselkbcion
 
IM World presentation from Chris Swan: Application centric – how the cloud ha...
IM World presentation from Chris Swan: Application centric – how the cloud ha...IM World presentation from Chris Swan: Application centric – how the cloud ha...
IM World presentation from Chris Swan: Application centric – how the cloud ha...Cohesive Networks
 
Catálogo 15 16 elksport
Catálogo 15 16 elksportCatálogo 15 16 elksport
Catálogo 15 16 elksportElk Sport
 
#speakgeek - Open Source Software Infrastructure at iconnect360
#speakgeek - Open Source Software Infrastructure at iconnect360#speakgeek - Open Source Software Infrastructure at iconnect360
#speakgeek - Open Source Software Infrastructure at iconnect360Derek Chan
 

Destaque (20)

CV
CVCV
CV
 
Automated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSAutomated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSS
 
Risk management
Risk managementRisk management
Risk management
 
Neuigkeiten von DEPAROM & Co
Neuigkeiten von DEPAROM & CoNeuigkeiten von DEPAROM & Co
Neuigkeiten von DEPAROM & Co
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
 
Reproducible Science with Python
Reproducible Science with PythonReproducible Science with Python
Reproducible Science with Python
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
e-Extortion Trends and Defense
e-Extortion Trends and Defensee-Extortion Trends and Defense
e-Extortion Trends and Defense
 
Astricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionAstricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and Production
 
Gartner 2017 London: How to re-invent your IT Architecture?
Gartner 2017 London: How to re-invent your IT Architecture?Gartner 2017 London: How to re-invent your IT Architecture?
Gartner 2017 London: How to re-invent your IT Architecture?
 
Fostering a Culture of Analytics
Fostering a Culture of AnalyticsFostering a Culture of Analytics
Fostering a Culture of Analytics
 
Analyze, Influence and Engage Your Customer - v1.7
Analyze, Influence and Engage Your Customer - v1.7Analyze, Influence and Engage Your Customer - v1.7
Analyze, Influence and Engage Your Customer - v1.7
 
Reversing malware analysis training part2 introduction to windows internals
Reversing malware analysis training part2 introduction to windows internalsReversing malware analysis training part2 introduction to windows internals
Reversing malware analysis training part2 introduction to windows internals
 
Streaming architecture with HDP & ELK
Streaming architecture with HDP & ELKStreaming architecture with HDP & ELK
Streaming architecture with HDP & ELK
 
Kelompok 2
Kelompok 2Kelompok 2
Kelompok 2
 
Business selectors
Business selectorsBusiness selectors
Business selectors
 
Apostila De Dispositivos EléTricos
Apostila De Dispositivos EléTricosApostila De Dispositivos EléTricos
Apostila De Dispositivos EléTricos
 
IM World presentation from Chris Swan: Application centric – how the cloud ha...
IM World presentation from Chris Swan: Application centric – how the cloud ha...IM World presentation from Chris Swan: Application centric – how the cloud ha...
IM World presentation from Chris Swan: Application centric – how the cloud ha...
 
Catálogo 15 16 elksport
Catálogo 15 16 elksportCatálogo 15 16 elksport
Catálogo 15 16 elksport
 
#speakgeek - Open Source Software Infrastructure at iconnect360
#speakgeek - Open Source Software Infrastructure at iconnect360#speakgeek - Open Source Software Infrastructure at iconnect360
#speakgeek - Open Source Software Infrastructure at iconnect360
 

Semelhante a Bridging the Gap: Connecting AWS and Kafka

Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1Dmitry Skaredov
 
Event Driven Microservices
Event Driven MicroservicesEvent Driven Microservices
Event Driven MicroservicesFabrizio Fortino
 
Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...Omid Vahdaty
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZconfluent
 
AWS Webcast - AWS Kinesis Webinar
AWS Webcast - AWS Kinesis WebinarAWS Webcast - AWS Kinesis Webinar
AWS Webcast - AWS Kinesis WebinarAmazon Web Services
 
Un'introduzione a Kafka Streams e KSQL... and why they matter!
Un'introduzione a Kafka Streams e KSQL... and why they matter!Un'introduzione a Kafka Streams e KSQL... and why they matter!
Un'introduzione a Kafka Streams e KSQL... and why they matter!Paolo Castagna
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudIan Massingham
 
Confluent Tech Talk Korea
Confluent Tech Talk KoreaConfluent Tech Talk Korea
Confluent Tech Talk Koreaconfluent
 
Event Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBEvent Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBScyllaDB
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
GraphQL API on a Serverless Environment
GraphQL API on a Serverless EnvironmentGraphQL API on a Serverless Environment
GraphQL API on a Serverless EnvironmentItai Yaffe
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thingaspyker
 
Netflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsNetflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsAll Things Open
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKevin Lynch
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1Ruslan Meshenberg
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture PatternsAmazon Web Services
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfAmazon Web Services
 

Semelhante a Bridging the Gap: Connecting AWS and Kafka (20)

AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1
 
Event Driven Microservices
Event Driven MicroservicesEvent Driven Microservices
Event Driven Microservices
 
Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZ
 
AWS Webcast - AWS Kinesis Webinar
AWS Webcast - AWS Kinesis WebinarAWS Webcast - AWS Kinesis Webinar
AWS Webcast - AWS Kinesis Webinar
 
Un'introduzione a Kafka Streams e KSQL... and why they matter!
Un'introduzione a Kafka Streams e KSQL... and why they matter!Un'introduzione a Kafka Streams e KSQL... and why they matter!
Un'introduzione a Kafka Streams e KSQL... and why they matter!
 
Best of re:Invent
Best of re:InventBest of re:Invent
Best of re:Invent
 
Serverless Node.js
Serverless Node.jsServerless Node.js
Serverless Node.js
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
 
Confluent Tech Talk Korea
Confluent Tech Talk KoreaConfluent Tech Talk Korea
Confluent Tech Talk Korea
 
Event Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDBEvent Streaming Architectures with Confluent and ScyllaDB
Event Streaming Architectures with Confluent and ScyllaDB
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
 
GraphQL API on a Serverless Environment
GraphQL API on a Serverless EnvironmentGraphQL API on a Serverless Environment
GraphQL API on a Serverless Environment
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thing
 
Netflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsNetflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger Things
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdf
 

Último

Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptbibisarnayak0
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectssuserb6619e
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Último (20)

Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.ppt
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

Bridging the Gap: Connecting AWS and Kafka

  • 1. Bridging the Gap: Connecting AWS and Kafka Ryanne Dolan & Jason Li LinkedIn
  • 2. Overview ● Motivation ● What is Kinesis? ● Architecture ● Checkpointing ● Metrics ● DynamoDB Streams ● Validation
  • 3. Story starts at Bizo ● Originally batch-oriented architecture: AWS S3, Spark ● Started converting to stream-oriented architecture in 2013: AWS Kinesis ● Acquired by LinkedIn in 2014 ● Originally batch-oriented integration with LinkedIn’s data centers ● Started bridge project in 2015 ● Other teams (including other startups) have started using it
  • 4. Use Cases ● User-tracking events from Bizo Kinesis -> LI Kafka ● Leverage LI A/B tooling from AWS (requires Kafka events) ● Leverage LI ELK stack from AWS (Kinesis -> Kafka -> ELK) ● Leverage LI call tracing, site speed, and other metrics, reports ● Ship application and CloudWatch metric from AWS to LI (Kinesis -> Kafka - > inGraph)
  • 5. Requirements ● encoding agnostic (Thrift, Avro, JSON, etc) ● to/from Kafka ● to/from Kinesis ● preserve partitioning ● near real-time bidirectional replication ● stream multiplexing and joining ● support multiple AWS accounts ● multiple metrics endpoints (including CloudWatch)
  • 6. Kinesis Highlights ● VERY similar to Kafka ● Dynamic, scalable “shards” (instead of static partitions) ● Throughput and cost tied to # of shards ● Each shard: ○ $0.015/hour ○ 1000 records/second ○ 1MB/s ingress ○ 2MB/s egress ● Integration with AWS services, e.g. “Firehose” -> S3
  • 8. Kinesis-Kafka Bridge ● Samza job ● Kinesis System (Producer and Consumer) ● BridgeTask ● input/output mapping ● Repartitioner ● Transcoder
  • 12. BridgeTask again (notice multiple outputs!) Kinesis Consumer Repartitioner Transcoder Kinesis Producer Kafka Consumer Bridge Mapping Kafka Producere.g. Partition 1 -> shard-000001 e.g. Thrift -> Avro e.g. llama.abc -> kafka.xyz
  • 15. KinesisConsumer ● wraps the Kinesis Consumer Library (KCL) ● extends Samza’s BlockingEnvelopeMap ● creates one KCL Worker per Shard ● at least one Worker per KinesisConsumer instance ● Workers push envelopes into queue
  • 16. KinesisProducer ● uses Kinesis PutRecords API (batch) ● enqueues envelopes (async) ● flushes off-thread
  • 17. KinesisSystemAdmin ● queries Kinesis API for # shards at start-up ● tells Samza: # partitions == # shards ● # shards may change at any time, but OK in practice ● KCL will load-balance Workers automatically
  • 19. Checkpointing ● TWO sources of checkpoints: Samza and KCL ○ Samza checkpoints to a Kafka topic ○ KCL checkpoints to a DynamoDB table ○ similar semantics ● both systems must agree ● otherwise, possible DATA LOSS
  • 20. Checkpointing Data Loss 1. KCL consumes a record 2. KCL checkpoints 3. Bridge replays the record to Kafka 4. container crashes before Kafka buffer flushed 5. container restarts 6. KCL restarts at checkpoint --> buffered records lost
  • 21. Checkpointing Solution Checkpoint Kinesis Records only after they are flushed to Kafka. Checkpoint Kafka Records only after they are flushed to Kinesis. Producers must notify Consumers when it is safe to checkpoint. Consumers must be able to request and wait for a Producer flush.
  • 23. ● KinesisConsumer registers onSynced listener ● BridgeTask registers listeners for each output stream ● KafkaProducer fires event after successful flush ● envelope is checkpointed only after ALL output streams have flushed ● each individual envelope is tracked this way, but... ● checkpoints only occur at sentinel envelopes at the end of each GetRecords batch ● (for non-sentinels, onSynced is a noop) CheckpointableEnvelope
  • 26. Two Stacks... ● Bizo infra is on AWS CloudWatch, including metrics, alarms, paging ● LinkedIn has inGraphs for same purpose Need to be able to monitor the bridge from both.
  • 28. a custom MetricTracker ● publishes metrics to CW and inGraphs ● locally aggregates metrics to minimize API calls ● each metric has dimensions: ○ shard ○ partition ○ stream ○ system ● each metric re-published with hierarchy of dimensions
  • 35. (due to 1 minute buffer) 30sec RTT
  • 37. Motivation ● Some of our services are running on AWS, e.g. video transcoding ● We want to replicate AWS data in LinkedIn data center ○ Serve requests from LinkedIn data center directly ○ Migrate off AWS easily
  • 38. What is DynamoDB Stream “A DynamoDB stream is an ordered flow of information about changes to items in an Amazon DynamoDB table. When you enable a stream on a table, DynamoDB captures information about every modification to data items in the table.” AWS documentation
  • 39. Example DynamoDB Stream Record { "EventID":"f561f0491ce42a95a60ad1fc082ae98b", "EventName":"MODIFY", "EventVersion":"1.0", "EventSource":"aws:dynamodb", "AwsRegion":"us-east-1", "Dynamodb":{ "Keys":{ "uuid":{ "S":"255" } }, "NewImage":{ <json representation of new image> }, "OldImage":{ <json representation of old image> }, "SequenceNumber":"593721700000000002066915768", "SizeBytes":326, "StreamViewType":"NEW_AND_OLD_IMAGES" } }
  • 41. DynamoDB Stream Record to Kafka Message ● Concatenate sorted DynamoDB keys as Kafka partition key ● Put the DynamoDB Stream record in Kafka message. e.g. {'kafkaMessageSegmentHeader': None, 'payload': '{"EventID":"f5b5e336f056f2656b23bfeed3cd45c8"," EventName":"MODIFY","EventVersion":"1.0","EventSource":"aws:dynamodb","AwsRegion":"us-east-1","Dynamodb": {"Keys":{"RecordId":{"N":"0"}},"NewImage":{"ReadableTime":{"S":"Wed Feb 17 01:13:02 UTC 2016"},"RecordId": {"N":"0"},"Timestamp":{"N":"1455671582888"}},"OldImage":{"ReadableTime":{"S":"Wed Feb 17 01:13:02 UTC 2016"},"RecordId":{"N":"0"},"Timestamp":{"N":"1455671582394"}},"SequenceNumber":" 29102800000000002523034570","SizeBytes":141,"StreamViewType":"NEW_AND_OLD_IMAGES"}}'}
  • 42. Use Cases ● Replicate rich media platform video transcoding metadata to LinkedIn data center (DynamoDB Stream -> Kafka -> Espresso)
  • 46. Summary With the ability to ship data from AWS Stream to LinkedIn Kafka and vice versa using Samza, we can now seamlessly integrate AWS with LinkedIn.
  • 47. Q & A