SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Build event driven microservices with
Apache Kafka and Apache Flink
Ali Alemi (Sr. Streaming SA)
Amazon Web Services
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Agenda
Why Microservices?
Why Event Driven Architecture?
Why Data Streaming?
Why is State important?
Why Apache Flink?
Call to action
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Why microservices?
Microservices
Agility
Easier to scale
Accelerating time to
market for new features
Developer choice
Faster to develop
Enabling innovation
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Are you Well Architected?
Anticipate Failure?
Can recover by itself?
Performant?
Secure?
Cost effective?
Sustainable?
Network
Products Recommendation
DB
Orders
DB
User profile
DB
Marketing
DB
Inventory
DB
DB
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Loosely couple your microservices with
Event Driven Architecture
User
registration
User
verification
User profile Connections Recommendation
Apache Kafka
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Oh! it is more difficult than we thought!
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Change the synchronous way of writing code
1. profile = userService.getProfile(‘user_id’);
2. profile.views += 1;
3. userService.saveProfile(profile);
4. Print (“Yaaay!!”)
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Because… “The World is A-synchronous”
Bank Corporate
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Build Asynchronous Event Driven Microservices
Web service
Central State Manager
Web service Web service
Web service
Web service
Web service
Choreography
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Application /
Business logic
Application /
Business logic
Application /
Business logic
Application /
Business logic
I want my microservices “Stateless”
Input events
stream
Output events
stream
Application/
Business logic
Database
Traditional
database-backed
microservice
JDBC/REST
Input events
stream
Output events
stream
State
Manager
Service
Application/
Business logic
HTTP/gRPC
Event-driven
function
state
state
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
However, State is not your only problem
Number of topics = Number of Microservices X 2 (request + response)
Number of Partitions = Max. Parallelism of consumers X Number of topics
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Why Apache Flink? is a framework and
distributed processing engine for stateful
computations over data stream. Flink has been
designed to perform computations at in-memory
speed and at any scale.
Composable event processing
State management
Performance and scale
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Apache Flink Stateful Functions
P O L Y G L O T E V E N T - D R I V E N F U N C T I O N S F O R D I S T R I B U T E D S T A T E F U L A P P L I C A T I O N S
FaaS
HTTP/gRPC
K8s deployment
(containerized functions)
Event streams ingress Event streams egress
Apache Flink StateFun cluster
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Apache Flink Stateful Functions
event ingress
Apache Flink
StateFun
event egress
fx
fx
fx
fx
fx
fx
state
state
state
state
state
state
State snapshots
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Logical co-location, physical separation
Each function has a unique address which is used as a
reference
Function instances are virtual
Functions can run remotely, with the event and state
provided as part of the request
Event sourcing, state access/updates and function
invocations are managed tightly together
If an Function instance has no state and is not actively
running, then it occupies no CPU, no threads, and no
memory.
fx Address
Function Type
+ Namespace
+ Name
ID
fx
instance
fx
instance
fx
instance
fx
instance
fx
instance
fx
instance
fx
instance
fx
instance
fx
instance
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Here's how it all comes together
Stateful Functions
cluster
Application/Business logic
HTTP/gRPC
Amazon MSK Amazon MSK
Amazon Kinesis Data Analytics
for Apache Flink
Input streams
Output
streams
State snapshots on
Amazon S3
Amazon API Gateway
state
state
Remote functions Remote functions
Amazon Kinesis Data
Analytics for Apache Flink
Realtime Analytics
Amazon Kinesis
Data Streams
Amazon MSK
JDBC End Points
Amazon Kinesis
Data Firehose
Amazon S3
Amazon
Elasticsearch
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Event-driven applications with Data Streaming
ü Clearly defined ingress and egress
ü Simplified composability
ü Decoupling of application logic and state management
ü Locally embedded state – no databases required
ü Idempotency and Exactly once semantics
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Call to action
• https://aws.amazon.com/architecture/well-architected
• https://flink.apache.org/
• https://nightlies.apache.org/flink/flink-statefun-docs-stable/
• https://aws.amazon.com/msk/features/msk-serverless/
• https://aws.amazon.com/kinesis/data-analytics/
• https://aws.amazon.com/lambda/
• https://aws.amazon.com/blogs/aws/introducing-amazon-kinesis-
data-analytics-studio-quickly-interact-with-streaming-data-using-sql-
python-or-scala/
• https://aws-blogs-prod.amazon.com/big-data/how-to-choose-the-
right-amazon-msk-cluster-type-for-you/
© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Thank you!

Contenu connexe

Tendances

The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022
Kai Wähner
 

Tendances (20)

Securing the Onion: 5G Cloud Native Infrastructure
Securing the Onion: 5G Cloud Native InfrastructureSecuring the Onion: 5G Cloud Native Infrastructure
Securing the Onion: 5G Cloud Native Infrastructure
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy FarkasVirtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
 
Spark (Structured) Streaming vs. Kafka Streams
Spark (Structured) Streaming vs. Kafka StreamsSpark (Structured) Streaming vs. Kafka Streams
Spark (Structured) Streaming vs. Kafka Streams
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
 
Brkdct 3101
Brkdct 3101Brkdct 3101
Brkdct 3101
 
Pulsar - Distributed pub/sub platform
Pulsar - Distributed pub/sub platformPulsar - Distributed pub/sub platform
Pulsar - Distributed pub/sub platform
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
 
The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Using ibm mq in managed file transfer environments final
Using ibm mq in managed file transfer environments finalUsing ibm mq in managed file transfer environments final
Using ibm mq in managed file transfer environments final
 
Azure Security Overview
Azure Security OverviewAzure Security Overview
Azure Security Overview
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
MuleSoft MUnit Test Recorder Meetup
MuleSoft MUnit Test Recorder MeetupMuleSoft MUnit Test Recorder Meetup
MuleSoft MUnit Test Recorder Meetup
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
Using Modular Topologies in Kafka Streams to scale ksqlDB’s persistent querie...
Using Modular Topologies in Kafka Streams to scale ksqlDB’s persistent querie...Using Modular Topologies in Kafka Streams to scale ksqlDB’s persistent querie...
Using Modular Topologies in Kafka Streams to scale ksqlDB’s persistent querie...
 
Apache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial ServicesApache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial Services
 
Azure vnet
Azure vnetAzure vnet
Azure vnet
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 

Similaire à Build an Event-driven Microservices with Apache Kafka & Apache Flink with Ali Alemi

Similaire à Build an Event-driven Microservices with Apache Kafka & Apache Flink with Ali Alemi (20)

AWS Lambda Powertools walkthrough.pdf
AWS Lambda Powertools walkthrough.pdfAWS Lambda Powertools walkthrough.pdf
AWS Lambda Powertools walkthrough.pdf
 
Keynote Gregor Hohpe - Serverless Architectures
Keynote Gregor Hohpe - Serverless ArchitecturesKeynote Gregor Hohpe - Serverless Architectures
Keynote Gregor Hohpe - Serverless Architectures
 
kreuzwerker AWS Modernizing Legacy Operations with Containerized Solutions 20...
kreuzwerker AWS Modernizing Legacy Operations with Containerized Solutions 20...kreuzwerker AWS Modernizing Legacy Operations with Containerized Solutions 20...
kreuzwerker AWS Modernizing Legacy Operations with Containerized Solutions 20...
 
Get More from your Data: Accelerate Time-to-Value and Reduce TCO with Conflue...
Get More from your Data: Accelerate Time-to-Value and Reduce TCO with Conflue...Get More from your Data: Accelerate Time-to-Value and Reduce TCO with Conflue...
Get More from your Data: Accelerate Time-to-Value and Reduce TCO with Conflue...
 
Single View of Data
Single View of DataSingle View of Data
Single View of Data
 
Building Modern Streaming Analytics with Confluent on AWS
Building Modern Streaming Analytics with Confluent on AWSBuilding Modern Streaming Analytics with Confluent on AWS
Building Modern Streaming Analytics with Confluent on AWS
 
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
 
How to Architect and Bring to Market SaaS on AWS GovCloud (US)
How to Architect and Bring to Market SaaS on AWS GovCloud (US)How to Architect and Bring to Market SaaS on AWS GovCloud (US)
How to Architect and Bring to Market SaaS on AWS GovCloud (US)
 
Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...
Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...
Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...
 
AWS의 블록체인 서비스 활용 방법 - 박혜영 솔루션즈 아키텍트, AWS / 박선준 솔루션즈 아키텍트, AWS :: AWS Summit S...
AWS의 블록체인 서비스 활용 방법 - 박혜영 솔루션즈 아키텍트, AWS / 박선준 솔루션즈 아키텍트, AWS :: AWS Summit S...AWS의 블록체인 서비스 활용 방법 - 박혜영 솔루션즈 아키텍트, AWS / 박선준 솔루션즈 아키텍트, AWS :: AWS Summit S...
AWS의 블록체인 서비스 활용 방법 - 박혜영 솔루션즈 아키텍트, AWS / 박선준 솔루션즈 아키텍트, AWS :: AWS Summit S...
 
Building real-time serverless data applications with Confluent and AWS.pptx
Building real-time serverless data applications with Confluent and AWS.pptxBuilding real-time serverless data applications with Confluent and AWS.pptx
Building real-time serverless data applications with Confluent and AWS.pptx
 
Building real-time serverless data applications with Confluent and AWS - Lond...
Building real-time serverless data applications with Confluent and AWS - Lond...Building real-time serverless data applications with Confluent and AWS - Lond...
Building real-time serverless data applications with Confluent and AWS - Lond...
 
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
 
Taking serverless to the edge
Taking serverless to the edgeTaking serverless to the edge
Taking serverless to the edge
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
 
Extracting Insights from Industrial Data Using AWS IoT Services (IOT368) - AW...
Extracting Insights from Industrial Data Using AWS IoT Services (IOT368) - AW...Extracting Insights from Industrial Data Using AWS IoT Services (IOT368) - AW...
Extracting Insights from Industrial Data Using AWS IoT Services (IOT368) - AW...
 
Building Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptxBuilding Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptx
 
Data_Analytics_and_AI_ML
Data_Analytics_and_AI_MLData_Analytics_and_AI_ML
Data_Analytics_and_AI_ML
 
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
 

Plus de HostedbyConfluent

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
HostedbyConfluent
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
HostedbyConfluent
 

Plus de HostedbyConfluent (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit London
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and Kafka
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit London
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit London
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And Why
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka Clusters
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy Pub
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit London
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSL
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and Beyond
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink Apps
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC Ecosystem
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local Disks
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Build an Event-driven Microservices with Apache Kafka & Apache Flink with Ali Alemi

  • 1. Build event driven microservices with Apache Kafka and Apache Flink Ali Alemi (Sr. Streaming SA) Amazon Web Services
  • 2. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Agenda Why Microservices? Why Event Driven Architecture? Why Data Streaming? Why is State important? Why Apache Flink? Call to action
  • 3. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Why microservices? Microservices Agility Easier to scale Accelerating time to market for new features Developer choice Faster to develop Enabling innovation
  • 4. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Are you Well Architected? Anticipate Failure? Can recover by itself? Performant? Secure? Cost effective? Sustainable? Network Products Recommendation DB Orders DB User profile DB Marketing DB Inventory DB DB
  • 5. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Loosely couple your microservices with Event Driven Architecture User registration User verification User profile Connections Recommendation Apache Kafka
  • 6. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Oh! it is more difficult than we thought!
  • 7. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Change the synchronous way of writing code 1. profile = userService.getProfile(‘user_id’); 2. profile.views += 1; 3. userService.saveProfile(profile); 4. Print (“Yaaay!!”)
  • 8. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Because… “The World is A-synchronous” Bank Corporate
  • 9. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Build Asynchronous Event Driven Microservices Web service Central State Manager Web service Web service Web service Web service Web service Choreography
  • 10. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Application / Business logic Application / Business logic Application / Business logic Application / Business logic I want my microservices “Stateless” Input events stream Output events stream Application/ Business logic Database Traditional database-backed microservice JDBC/REST Input events stream Output events stream State Manager Service Application/ Business logic HTTP/gRPC Event-driven function state state
  • 11. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. However, State is not your only problem Number of topics = Number of Microservices X 2 (request + response) Number of Partitions = Max. Parallelism of consumers X Number of topics
  • 12. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Why Apache Flink? is a framework and distributed processing engine for stateful computations over data stream. Flink has been designed to perform computations at in-memory speed and at any scale. Composable event processing State management Performance and scale
  • 13. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Apache Flink Stateful Functions P O L Y G L O T E V E N T - D R I V E N F U N C T I O N S F O R D I S T R I B U T E D S T A T E F U L A P P L I C A T I O N S FaaS HTTP/gRPC K8s deployment (containerized functions) Event streams ingress Event streams egress Apache Flink StateFun cluster
  • 14. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Apache Flink Stateful Functions event ingress Apache Flink StateFun event egress fx fx fx fx fx fx state state state state state state State snapshots
  • 15. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Logical co-location, physical separation Each function has a unique address which is used as a reference Function instances are virtual Functions can run remotely, with the event and state provided as part of the request Event sourcing, state access/updates and function invocations are managed tightly together If an Function instance has no state and is not actively running, then it occupies no CPU, no threads, and no memory. fx Address Function Type + Namespace + Name ID fx instance fx instance fx instance fx instance fx instance fx instance fx instance fx instance fx instance
  • 16. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Here's how it all comes together Stateful Functions cluster Application/Business logic HTTP/gRPC Amazon MSK Amazon MSK Amazon Kinesis Data Analytics for Apache Flink Input streams Output streams State snapshots on Amazon S3 Amazon API Gateway state state Remote functions Remote functions Amazon Kinesis Data Analytics for Apache Flink Realtime Analytics Amazon Kinesis Data Streams Amazon MSK JDBC End Points Amazon Kinesis Data Firehose Amazon S3 Amazon Elasticsearch
  • 17. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Event-driven applications with Data Streaming ü Clearly defined ingress and egress ü Simplified composability ü Decoupling of application logic and state management ü Locally embedded state – no databases required ü Idempotency and Exactly once semantics
  • 18. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Call to action • https://aws.amazon.com/architecture/well-architected • https://flink.apache.org/ • https://nightlies.apache.org/flink/flink-statefun-docs-stable/ • https://aws.amazon.com/msk/features/msk-serverless/ • https://aws.amazon.com/kinesis/data-analytics/ • https://aws.amazon.com/lambda/ • https://aws.amazon.com/blogs/aws/introducing-amazon-kinesis- data-analytics-studio-quickly-interact-with-streaming-data-using-sql- python-or-scala/ • https://aws-blogs-prod.amazon.com/big-data/how-to-choose-the- right-amazon-msk-cluster-type-for-you/
  • 19. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Thank you!