SlideShare ist ein Scribd-Unternehmen logo
1 von 21
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Migrating Applications to Serverless
Apache Kafka and KSQL
Tim Berglund
S e s s i o n I D
Sr. Director, Developer Relations
Confluent
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Our Movie Rating Service, Legacy Edition
• Users rate movies, ratings go into Kafka
• Monolithic, database-centric application calculates averages
• Serves them to users through a web UI and API
Movie
Ratings
Users
Movies
Top Rated Movies
My Favorite Movie
Moviegoers
Kafka served well
• Decouples event input from processing
• Easily understood abstraction for event processing
• Not exactly a pleasure to operate, but we can’t complain
Movie
Ratings
Users
Movies
Top Rated Movies
My Favorite Movie
Moviegoers
Or can we?
Our Monolith’s Problems
• It will do a bad job managing complexity as our service grows
• The Kafka Consumer code is bespoke
• It is a textbook pre-cloud architecture
• We cannot trivially scale to larger message volumes
Movie
Ratings
Users
Movies
Top Rated Movies
My Favorite Movie
Moviegoers
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Our Refactoring Plan
• Capture Users and Movies as Kafka topics
• Migrate all topics to Confluent Cloud using Confluent Replicator
• Refactor monolith to microservices
• Keep web UI nearly untouched
• Never touch the on-prem system until the migration is complete
Movie
Ratings
Users
Movies
Top Rated Movies
My Favorite Movie
Moviegoers
Step One: Fewer Databases
• Use Kafka Connect to extract Users and Movies tables to Kafka topics
Movie
Ratings
Moviegoers
Movies
Users
Kafka
Connect
Step Two: Spin up a Confluent Cloud cluster
• We want to get out of the business of managing Kafka ourselves
Movie
Ratings
Movies
Users
Step Three: Deploy Confluent Replicator
• Use Kafka Connect to extract Users and Movies tables to Kafka topics
Movie
Ratings
Movies
Users
Movie
Ratings
Movies
Users
Replicator
Replicator
Replicator
Step Four: Convert to KSQL
• Bespoke Consumer code implements non-differentiated functionality
Movie
Ratings
Movies
Users
CREATE TABLE movie_ratings AS
SELECT title,
SUM(rating)/COUNT(rating) AS avg_rating,
COUNT(rating) AS num_ratings
FROM ratings
LEFT OUTER JOIN movies
ON ratings.movie_id = movies.movie_id
GROUP BY title;
Step Four: Convert to KSQL
• The rating averaging query
Movie
Ratings
Movies
Users
Rated
Movies
KSQL
magic goes here
Step Four: Convert to KSQL
• The user favorite query
Movie
Ratings
Movies
Users
Rated
Movies
KSQL
magic goes here
more
KSQL
magic goes here
User
Favorites
Step Five: Extract the rating average service
• Now serve rating averages from KSQL output
• Monolith no longer serves these results
Rating Averages
Rated
Movies
Step Six: Extract the user favorite service
• Now serve rating averages from KSQL output
• Monolith no longer serves these results
User Favorites User
Favorites
Step Seven: Stand down the monolith
• Now serve rating averages from KSQL output
• Monolith no longer serves these results
User Favorites
Rated Movies
User
Favorites
Movie
Ratings
Moviegoers
Rated
Movies
so much
KSQL
magic
Movies
Users
Step Eight: Stand down Replicator
• All data is in Confluent Cloud now
• For hybrid on-prem/cloud deployment
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tim Berglund
@tlberglund
https://kafka-tutorials.confluent.io
https://slackpass.io/confluentcommunity
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Nitin Kumar
 

Was ist angesagt? (20)

StreamSQL Feature Store (Apache Pulsar Summit)
StreamSQL Feature Store (Apache Pulsar Summit)StreamSQL Feature Store (Apache Pulsar Summit)
StreamSQL Feature Store (Apache Pulsar Summit)
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
 
Encrypting Kafka messages at rest to secure applications | Robert Barnes, Has...
Encrypting Kafka messages at rest to secure applications | Robert Barnes, Has...Encrypting Kafka messages at rest to secure applications | Robert Barnes, Has...
Encrypting Kafka messages at rest to secure applications | Robert Barnes, Has...
 
Building a derived data store using Kafka
Building a derived data store using KafkaBuilding a derived data store using Kafka
Building a derived data store using Kafka
 
Introduction to Kafka
Introduction to KafkaIntroduction to Kafka
Introduction to Kafka
 
Kafka aws
Kafka awsKafka aws
Kafka aws
 
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
Kafka meetup seattle 2019 mirus reliable, high performance replication for ap...
 
How to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams SafeHow to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams Safe
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache Kafka
 
Confluent building a real-time streaming platform using kafka streams and k...
Confluent   building a real-time streaming platform using kafka streams and k...Confluent   building a real-time streaming platform using kafka streams and k...
Confluent building a real-time streaming platform using kafka streams and k...
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
 
Oops! I started a broker | Yinon Kahta, Taboola
Oops! I started a broker | Yinon Kahta, TaboolaOops! I started a broker | Yinon Kahta, Taboola
Oops! I started a broker | Yinon Kahta, Taboola
 
Distributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola ScaleDistributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola Scale
 
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
 
How did we move the mountain? - Migrating 1 trillion+ messages per day across...
How did we move the mountain? - Migrating 1 trillion+ messages per day across...How did we move the mountain? - Migrating 1 trillion+ messages per day across...
How did we move the mountain? - Migrating 1 trillion+ messages per day across...
 
Introduction to apache kafka
Introduction to apache kafkaIntroduction to apache kafka
Introduction to apache kafka
 
Becoming Protocol-Agnostic with Kafka, REST, GraphQL & gRPC | Tyler Mills, Sm...
Becoming Protocol-Agnostic with Kafka, REST, GraphQL & gRPC | Tyler Mills, Sm...Becoming Protocol-Agnostic with Kafka, REST, GraphQL & gRPC | Tyler Mills, Sm...
Becoming Protocol-Agnostic with Kafka, REST, GraphQL & gRPC | Tyler Mills, Sm...
 
Capture the Streams of Database Changes
Capture the Streams of Database ChangesCapture the Streams of Database Changes
Capture the Streams of Database Changes
 
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...
 

Ähnlich wie Migrating applications to serverless Apache Kafka + KSQL

Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014
Daniel Jacobson
 

Ähnlich wie Migrating applications to serverless Apache Kafka + KSQL (20)

Going Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
Going Cloud Native with IBM Cloud and NetflixOSS for Dev@PulseGoing Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
Going Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
 
Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2
 
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
 
Gcp intro-20160721
Gcp intro-20160721Gcp intro-20160721
Gcp intro-20160721
 
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
 
Active web page chapter for reading purpose
Active web page chapter for reading purposeActive web page chapter for reading purpose
Active web page chapter for reading purpose
 
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
 
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
Yelowsoft delivers super app to bbr one of the biggest ride hailing companies...
 
Oscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons LearnedOscon2014 Netflix API - Top 10 Lessons Learned
Oscon2014 Netflix API - Top 10 Lessons Learned
 
Can We Make Maps from Videos? ~From AI Algorithm to Engineering for Continuou...
Can We Make Maps from Videos? ~From AI Algorithm to Engineering for Continuou...Can We Make Maps from Videos? ~From AI Algorithm to Engineering for Continuou...
Can We Make Maps from Videos? ~From AI Algorithm to Engineering for Continuou...
 
Kaltura Inspire Webinar: API Driven Video Platform - The Key to Scalability a...
Kaltura Inspire Webinar: API Driven Video Platform - The Key to Scalability a...Kaltura Inspire Webinar: API Driven Video Platform - The Key to Scalability a...
Kaltura Inspire Webinar: API Driven Video Platform - The Key to Scalability a...
 
About captionator english 20150622
About captionator   english 20150622About captionator   english 20150622
About captionator english 20150622
 
Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
 
[AWS LA Media & Entertainment Event 2015]: M&E Ecosystem Update Q4 2015
[AWS LA Media & Entertainment Event 2015]: M&E Ecosystem Update Q4 2015[AWS LA Media & Entertainment Event 2015]: M&E Ecosystem Update Q4 2015
[AWS LA Media & Entertainment Event 2015]: M&E Ecosystem Update Q4 2015
 
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
Take a load off! Load testing your Oracle APEX or JDeveloper web applicationsTake a load off! Load testing your Oracle APEX or JDeveloper web applications
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
 
Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014
 
Continuous Deployment of your Application - SpringOne Tour Dallas
Continuous Deployment of your Application - SpringOne Tour DallasContinuous Deployment of your Application - SpringOne Tour Dallas
Continuous Deployment of your Application - SpringOne Tour Dallas
 
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCCIBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
IBM Connect 2016: Speaker Session with Teresa Deane, Senior Developer, BCC
 
Yaron Inger - Enlight - Inside the app of the year
 Yaron Inger - Enlight - Inside the app of the year  Yaron Inger - Enlight - Inside the app of the year
Yaron Inger - Enlight - Inside the app of the year
 

Mehr von confluent

Mehr von confluent (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Migrating applications to serverless Apache Kafka + KSQL

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Migrating Applications to Serverless Apache Kafka and KSQL Tim Berglund S e s s i o n I D Sr. Director, Developer Relations Confluent
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 3. Our Movie Rating Service, Legacy Edition • Users rate movies, ratings go into Kafka • Monolithic, database-centric application calculates averages • Serves them to users through a web UI and API Movie Ratings Users Movies Top Rated Movies My Favorite Movie Moviegoers
  • 4. Kafka served well • Decouples event input from processing • Easily understood abstraction for event processing • Not exactly a pleasure to operate, but we can’t complain Movie Ratings Users Movies Top Rated Movies My Favorite Movie Moviegoers
  • 6. Our Monolith’s Problems • It will do a bad job managing complexity as our service grows • The Kafka Consumer code is bespoke • It is a textbook pre-cloud architecture • We cannot trivially scale to larger message volumes Movie Ratings Users Movies Top Rated Movies My Favorite Movie Moviegoers
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. Our Refactoring Plan • Capture Users and Movies as Kafka topics • Migrate all topics to Confluent Cloud using Confluent Replicator • Refactor monolith to microservices • Keep web UI nearly untouched • Never touch the on-prem system until the migration is complete Movie Ratings Users Movies Top Rated Movies My Favorite Movie Moviegoers
  • 9. Step One: Fewer Databases • Use Kafka Connect to extract Users and Movies tables to Kafka topics Movie Ratings Moviegoers Movies Users Kafka Connect
  • 10. Step Two: Spin up a Confluent Cloud cluster • We want to get out of the business of managing Kafka ourselves Movie Ratings Movies Users
  • 11. Step Three: Deploy Confluent Replicator • Use Kafka Connect to extract Users and Movies tables to Kafka topics Movie Ratings Movies Users Movie Ratings Movies Users Replicator Replicator Replicator
  • 12. Step Four: Convert to KSQL • Bespoke Consumer code implements non-differentiated functionality Movie Ratings Movies Users CREATE TABLE movie_ratings AS SELECT title, SUM(rating)/COUNT(rating) AS avg_rating, COUNT(rating) AS num_ratings FROM ratings LEFT OUTER JOIN movies ON ratings.movie_id = movies.movie_id GROUP BY title;
  • 13. Step Four: Convert to KSQL • The rating averaging query Movie Ratings Movies Users Rated Movies KSQL magic goes here
  • 14. Step Four: Convert to KSQL • The user favorite query Movie Ratings Movies Users Rated Movies KSQL magic goes here more KSQL magic goes here User Favorites
  • 15. Step Five: Extract the rating average service • Now serve rating averages from KSQL output • Monolith no longer serves these results Rating Averages Rated Movies
  • 16. Step Six: Extract the user favorite service • Now serve rating averages from KSQL output • Monolith no longer serves these results User Favorites User Favorites
  • 17. Step Seven: Stand down the monolith • Now serve rating averages from KSQL output • Monolith no longer serves these results User Favorites Rated Movies User Favorites Movie Ratings Moviegoers Rated Movies so much KSQL magic Movies Users
  • 18. Step Eight: Stand down Replicator • All data is in Confluent Cloud now • For hybrid on-prem/cloud deployment
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 20. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tim Berglund @tlberglund https://kafka-tutorials.confluent.io https://slackpass.io/confluentcommunity
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.