SlideShare a Scribd company logo
1 of 33
Download to read offline
Modernization Patterns to
Refactor a Legacy Application
Into Event-driven
Microservices
1
Bilgin Ibryam
Product Manager @Red Hat
@bibryam
2
We build our computers
the way we build our cities -
over time, without a plan,
on top of ruins.
Ellen Ullman
About me
3
▸ Product Manager at Red Hat
▸ Former Principal Architect
▸ Committer at Apache Camel
▸ Author
・ Camel Design Patterns
・ Kubernetes Patterns
▸ @ bibryam
▸ https://www.ofbizian.com
About this talk
4
Application migration/modernization Rs
▸ Rehosting - lift-and-shift
▸ Replatorming - lift, tinker, and shift
▸ Refactor / Re-architect
・ Debezium
・ Apache Kafka
・ Kubernetes
Starting point
5
Challenges with monolithic applications
▸ Frequent deployment is difficult
▸ Obstacle to scaling development
▸ Scaling the application can be difficult
Expected modernization benefits
▸ Reduce time to market
▸ Greater team autonomy
▸ Improved automation
▸ Increased application performance
Target state
6
Cloud native microservices’ characteristics
▸ Independently deployable
▸ Modeled around a business domain
▸ Own their data
▸ Emit events (based on EDA)
▸ Built on open source technology such as
Kubernetes, Apache Kafka, Debezium
Measuring the results
▸ Lead time for change
▸ Deployment frequency
▸ Mean time to recovery
Migration
Challenges
Strangler Pattern
8
High-level steps
▸ Identify functional boundary
▸ Migrate/reimplement functionality
▸ Synchronize data
▸ Reroute traffic to new service
▸ Decomposition old service
Main benefits
▸ No big bang migration
▸ Minimal changes to the monolith
▸ Low risk with the ability to fall back
Functional boundary
9
Functional boundary considerations
▸ Aggregates, bounded context based on DDD
▸ Event Storming technique by A. Brandolini
▸ Data model coupling
▸ Module dependencies
Where to start from?
▸ Easy wins
▸ Noticeable improvement
▸ A representative effort
Interception options
10
Prerequisites
▸ Ability to identify inbound calls
▸ Ability to direct calls to new service (and back)
Routing options
▸ Client redirection
▸ Transparent HTTP proxy
▸ Shared protocol translation proxy
▸ Embedded/sidecar proxy
What is Apache Camel?
11
Camel is an integration toolkit that offers:
▸ Hundreds of connectors
▸ Tens of integration patterns
▸ Multiple data formats and languages
▸ Domain specific languages: XML, Java, YAML
Interception options
12 https://k8spatterns.io/
Prerequisites
▸ Ability to identify inbound calls
▸ Ability to direct calls to new service (and back)
Routing options
▸ Client redirection
▸ Transparent HTTP proxy
▸ Shared protocol translation proxy
▸ Embedded/sidecar custom proxy
Kubernetes Pods
13
Deployment guarantees Lifecycle guarantees
Sidecar Pattern
14 https://k8spatterns.io/
Sidecar Pattern
15 https://k8spatterns.io/
Prerequisites
▸ Ability to identify inbound calls
▸ Ability to direct calls to new service (and back)
Routing options
▸ Client redirection
▸ Transparent HTTP proxy
▸ Shared protocol translation proxy
▸ Embedded/sidecar custom proxy
Database strangulation
16
Database first Database and code together
Code first
Data synchronization
17
Cons
▸ Polling delay, might miss updates
▸ Polling overhead
▸ Deletes not captured
▸ Not transparent to writing application
Pros
▸ Simple Installation and configuration
Cons
▸ Varying capabilities
▸ Limited integration capabilities
▸ Not portable
▸ Not easily testable
▸ Not transparent to source database
Pros
▸ No additional application required
Cons
▸ Requires specialized tools
▸ Requires database configuration
Pros
▸ All changes (deletes) are captured
▸ No polling delay or overhead
▸ Transparent to writing application
Triggers Log readers
Queries/Polling
What is Debezium?
18
Debezium in a nutshell
▸ Open source Change Data Capture platform
▸ Snapshotting, filtering, transformations
▸ MySQL, PostgreSQL, MongoDB, SQL Server,
Db2, Oracle, Vitess, Cassandra
▸ Use cases: data replication, cache updates, search index
updates, audit logs, sync data between services
Strangler Pattern with Debezium
19
Strangler Pattern with Debezium
▸ Transparent to the writing application
▸ Initial bulk import through snapshotting
▸ Schema, table, column filtering
▸ Single Message Transformations as anti-corruption layer
▸ Schema Registry for schema validation and
compatibility enforcement of data models
Debezium with Apache Kafka
▸ Guaranteed ordering, message compaction
▸ Pull based - re-read from start, or new changes
▸ Kafka Connect - offset tracking, fail over
Release steps
20
Steps so far
▸ Identified a functional boundary
▸ Migrated it as a new service
▸ Created a new data model in a new database
▸ Automated and deployed everything
▸ Bulk imported data and kept it in-sync
▸ No traffic routed to the new service
Release steps
21
Next step
▸ Route READ traffic to the new service
Release steps
22
Next steps
▸ Route READ and WRITE traffic to the new service
▸ Two-way data synchronization in progress
Release steps
23
Next steps
▸ Stop WRITE traffic to legacy system
▸ Stop data synchronization from legacy system
Release steps
24
Final steps
▸ STOP READ traffic to the legacy application
▸ Stop data synchronization to legacy system
▸ Decommission migrated module
New
Challenges
Modernization challenges
26
Migration challenges
▸ Low-risk changes with demonstrable progress
▸ Deliver enhancements and new “business value”
▸ Simultaneously delivering new services
Distributed systems challenges
▸ Automation and operations at scale
▸ Dual-writes and long-running business transactions
▸ Analytical and reporting data needs
Operating event-driven services at scale
27
Microservices on Kubernetes
▸ Deployment/rollback
▸ Placement/scheduling
▸ Configuration management
▸ Resource/failure isolation
▸ Auto heal/upgrade (through operators)
Event-driven applications on Kubernetes
▸ Strimzi - operating Apache Kafka cluster
▸ KEDA - event-driven workload autoscaling
▸ Debezium - change data capture platform
▸ Apicurio - Schema Registry and operators to run them
Outbox Pattern
28
Offers an approach for services to update their data store and
notify other services in a reliable and eventually consistent
manner.
▸ Addresses the dual-write problem
▸ Offers “read your own writes" semantics
▸ “at-least-once” semantics for consumers
Reliable Data Exchange With the Outbox Pattern
Saga Pattern
29
Splits up long-running business transactions into a series of
multiple local transactions. When implemented using the Outbox
Pattern, it offers the benefits of orchestration and asynchronous
communication.
▸ Orchestration based coordination
▸ Asynchronous communication with Apache Kafka
Saga Orchestration for Microservices Using the Outbox Pattern
Summary
30
Modern software systems are like cities - they evolve over time, on top of legacy systems. Using
proven patterns and standardized tools help create long-lasting systems that grow with your needs.
▸ Strangler Pattern - a low-risk application migration technique
▸ Outbox/Saga Patterns - reliable inter-service communication approach
▸ Debezium - a non-intrusive toolking for change data capture
▸ Kubernetes / Strimzi / Apache Kafka - de facto standards in their fields
Resources
31
▸ Monolith To Microservices
▸ Building Event-Driven Microservices
▸ Designing Data-Intensive Applications
▸ Kubernetes Patterns
▸ Debezium.io
▸ Keda.sh
▸ Strimzi.io
▸ github.com/windup
32
Red Hat OpenShift Streams
for Apache Kafka
a fully managed Apache Kafka service by Red Hat
http://red.ht/TryKafka
Try Apache Kafka in seconds
Thank you!
33
Bilgin Ibryam
Product Manager @Red Hat
@bibryam

More Related Content

What's hot

Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
HostedbyConfluent
 

What's hot (20)

Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise Platform
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Kubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystemKubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystem
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservices
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka Tutorial - Introduction to Apache Kafka (Part 1)Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
 
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Automate Your Kafka Cluster with Kubernetes Custom Resources
Automate Your Kafka Cluster with Kubernetes Custom Resources Automate Your Kafka Cluster with Kubernetes Custom Resources
Automate Your Kafka Cluster with Kubernetes Custom Resources
 
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - Observability
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!
 
Container orchestration overview
Container orchestration overviewContainer orchestration overview
Container orchestration overview
 

Similar to Modernization patterns to refactor a legacy application into event driven microservices

Serverless Streaming Architectures and Algorithms for the Enterprise
Serverless Streaming Architectures and Algorithms for the EnterpriseServerless Streaming Architectures and Algorithms for the Enterprise
Serverless Streaming Architectures and Algorithms for the Enterprise
Arun Kejariwal
 

Similar to Modernization patterns to refactor a legacy application into event driven microservices (20)

(RivieraDev 2018) #serverless - 2 ans de retourS d'expérience
(RivieraDev 2018) #serverless - 2 ans de retourS d'expérience(RivieraDev 2018) #serverless - 2 ans de retourS d'expérience
(RivieraDev 2018) #serverless - 2 ans de retourS d'expérience
 
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Best Practices for Building Hybrid-Cloud Architectures | Hans Jespersen
Best Practices for Building Hybrid-Cloud Architectures | Hans JespersenBest Practices for Building Hybrid-Cloud Architectures | Hans Jespersen
Best Practices for Building Hybrid-Cloud Architectures | Hans Jespersen
 
DevoxxFR 2018 #serverless - Mettez-le en œuvre dans votre entreprise et arriv...
DevoxxFR 2018 #serverless - Mettez-le en œuvre dans votre entreprise et arriv...DevoxxFR 2018 #serverless - Mettez-le en œuvre dans votre entreprise et arriv...
DevoxxFR 2018 #serverless - Mettez-le en œuvre dans votre entreprise et arriv...
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
Dual write strategies for microservices
Dual write strategies for microservicesDual write strategies for microservices
Dual write strategies for microservices
 
Serverless Streaming Architectures and Algorithms for the Enterprise
Serverless Streaming Architectures and Algorithms for the EnterpriseServerless Streaming Architectures and Algorithms for the Enterprise
Serverless Streaming Architectures and Algorithms for the Enterprise
 
DIMT 2023 SG - Hands-on Workshop_ Getting started with Confluent Cloud.pdf
DIMT 2023 SG - Hands-on Workshop_ Getting started with Confluent Cloud.pdfDIMT 2023 SG - Hands-on Workshop_ Getting started with Confluent Cloud.pdf
DIMT 2023 SG - Hands-on Workshop_ Getting started with Confluent Cloud.pdf
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Cloud computing: highlights
Cloud computing: highlightsCloud computing: highlights
Cloud computing: highlights
 
Unleash the Power of Open Networking
Unleash the Power of Open NetworkingUnleash the Power of Open Networking
Unleash the Power of Open Networking
 
Streaming Time Series Data With Kenny Gorman and Elena Cuevas | Current 2022
Streaming Time Series Data With Kenny Gorman and Elena Cuevas | Current 2022Streaming Time Series Data With Kenny Gorman and Elena Cuevas | Current 2022
Streaming Time Series Data With Kenny Gorman and Elena Cuevas | Current 2022
 
The impact of SaaS on cloud integration
The impact of SaaS on cloud integrationThe impact of SaaS on cloud integration
The impact of SaaS on cloud integration
 
An introduction to Serverless
An introduction to ServerlessAn introduction to Serverless
An introduction to Serverless
 
lect15_cloud.ppt
lect15_cloud.pptlect15_cloud.ppt
lect15_cloud.ppt
 
cloud computng
cloud computng cloud computng
cloud computng
 
Modern application delivery with Consul
Modern application delivery with ConsulModern application delivery with Consul
Modern application delivery with Consul
 
Why Cloud-Native Kafka Matters: 4 Reasons to Stop Managing it Yourself
Why Cloud-Native Kafka Matters: 4 Reasons to Stop Managing it YourselfWhy Cloud-Native Kafka Matters: 4 Reasons to Stop Managing it Yourself
Why Cloud-Native Kafka Matters: 4 Reasons to Stop Managing it Yourself
 
cloudintroduction.ppt
cloudintroduction.pptcloudintroduction.ppt
cloudintroduction.ppt
 

More from Bilgin Ibryam

More from Bilgin Ibryam (11)

Dapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any LanguageDapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any Language
 
How to financially survive while growing a small open source project
How to financially survive while growing a small open source projectHow to financially survive while growing a small open source project
How to financially survive while growing a small open source project
 
What next after microservices
What next after microservicesWhat next after microservices
What next after microservices
 
The Evolution of Distributed Systems on Kubernetes
The Evolution of Distributed Systems on KubernetesThe Evolution of Distributed Systems on Kubernetes
The Evolution of Distributed Systems on Kubernetes
 
Enterprise Integration for Ethereum
Enterprise Integration for EthereumEnterprise Integration for Ethereum
Enterprise Integration for Ethereum
 
The Kubernetes Effect
The Kubernetes EffectThe Kubernetes Effect
The Kubernetes Effect
 
Designing Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with KubernetesDesigning Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with Kubernetes
 
Cloud Native Patterns
Cloud Native PatternsCloud Native Patterns
Cloud Native Patterns
 
Cloud Native Java Development Patterns
Cloud Native Java Development PatternsCloud Native Java Development Patterns
Cloud Native Java Development Patterns
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
 

Recently uploaded

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Recently uploaded (20)

Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptx
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 

Modernization patterns to refactor a legacy application into event driven microservices

  • 1. Modernization Patterns to Refactor a Legacy Application Into Event-driven Microservices 1 Bilgin Ibryam Product Manager @Red Hat @bibryam
  • 2. 2 We build our computers the way we build our cities - over time, without a plan, on top of ruins. Ellen Ullman
  • 3. About me 3 ▸ Product Manager at Red Hat ▸ Former Principal Architect ▸ Committer at Apache Camel ▸ Author ・ Camel Design Patterns ・ Kubernetes Patterns ▸ @ bibryam ▸ https://www.ofbizian.com
  • 4. About this talk 4 Application migration/modernization Rs ▸ Rehosting - lift-and-shift ▸ Replatorming - lift, tinker, and shift ▸ Refactor / Re-architect ・ Debezium ・ Apache Kafka ・ Kubernetes
  • 5. Starting point 5 Challenges with monolithic applications ▸ Frequent deployment is difficult ▸ Obstacle to scaling development ▸ Scaling the application can be difficult Expected modernization benefits ▸ Reduce time to market ▸ Greater team autonomy ▸ Improved automation ▸ Increased application performance
  • 6. Target state 6 Cloud native microservices’ characteristics ▸ Independently deployable ▸ Modeled around a business domain ▸ Own their data ▸ Emit events (based on EDA) ▸ Built on open source technology such as Kubernetes, Apache Kafka, Debezium Measuring the results ▸ Lead time for change ▸ Deployment frequency ▸ Mean time to recovery
  • 8. Strangler Pattern 8 High-level steps ▸ Identify functional boundary ▸ Migrate/reimplement functionality ▸ Synchronize data ▸ Reroute traffic to new service ▸ Decomposition old service Main benefits ▸ No big bang migration ▸ Minimal changes to the monolith ▸ Low risk with the ability to fall back
  • 9. Functional boundary 9 Functional boundary considerations ▸ Aggregates, bounded context based on DDD ▸ Event Storming technique by A. Brandolini ▸ Data model coupling ▸ Module dependencies Where to start from? ▸ Easy wins ▸ Noticeable improvement ▸ A representative effort
  • 10. Interception options 10 Prerequisites ▸ Ability to identify inbound calls ▸ Ability to direct calls to new service (and back) Routing options ▸ Client redirection ▸ Transparent HTTP proxy ▸ Shared protocol translation proxy ▸ Embedded/sidecar proxy
  • 11. What is Apache Camel? 11 Camel is an integration toolkit that offers: ▸ Hundreds of connectors ▸ Tens of integration patterns ▸ Multiple data formats and languages ▸ Domain specific languages: XML, Java, YAML
  • 12. Interception options 12 https://k8spatterns.io/ Prerequisites ▸ Ability to identify inbound calls ▸ Ability to direct calls to new service (and back) Routing options ▸ Client redirection ▸ Transparent HTTP proxy ▸ Shared protocol translation proxy ▸ Embedded/sidecar custom proxy
  • 15. Sidecar Pattern 15 https://k8spatterns.io/ Prerequisites ▸ Ability to identify inbound calls ▸ Ability to direct calls to new service (and back) Routing options ▸ Client redirection ▸ Transparent HTTP proxy ▸ Shared protocol translation proxy ▸ Embedded/sidecar custom proxy
  • 16. Database strangulation 16 Database first Database and code together Code first
  • 17. Data synchronization 17 Cons ▸ Polling delay, might miss updates ▸ Polling overhead ▸ Deletes not captured ▸ Not transparent to writing application Pros ▸ Simple Installation and configuration Cons ▸ Varying capabilities ▸ Limited integration capabilities ▸ Not portable ▸ Not easily testable ▸ Not transparent to source database Pros ▸ No additional application required Cons ▸ Requires specialized tools ▸ Requires database configuration Pros ▸ All changes (deletes) are captured ▸ No polling delay or overhead ▸ Transparent to writing application Triggers Log readers Queries/Polling
  • 18. What is Debezium? 18 Debezium in a nutshell ▸ Open source Change Data Capture platform ▸ Snapshotting, filtering, transformations ▸ MySQL, PostgreSQL, MongoDB, SQL Server, Db2, Oracle, Vitess, Cassandra ▸ Use cases: data replication, cache updates, search index updates, audit logs, sync data between services
  • 19. Strangler Pattern with Debezium 19 Strangler Pattern with Debezium ▸ Transparent to the writing application ▸ Initial bulk import through snapshotting ▸ Schema, table, column filtering ▸ Single Message Transformations as anti-corruption layer ▸ Schema Registry for schema validation and compatibility enforcement of data models Debezium with Apache Kafka ▸ Guaranteed ordering, message compaction ▸ Pull based - re-read from start, or new changes ▸ Kafka Connect - offset tracking, fail over
  • 20. Release steps 20 Steps so far ▸ Identified a functional boundary ▸ Migrated it as a new service ▸ Created a new data model in a new database ▸ Automated and deployed everything ▸ Bulk imported data and kept it in-sync ▸ No traffic routed to the new service
  • 21. Release steps 21 Next step ▸ Route READ traffic to the new service
  • 22. Release steps 22 Next steps ▸ Route READ and WRITE traffic to the new service ▸ Two-way data synchronization in progress
  • 23. Release steps 23 Next steps ▸ Stop WRITE traffic to legacy system ▸ Stop data synchronization from legacy system
  • 24. Release steps 24 Final steps ▸ STOP READ traffic to the legacy application ▸ Stop data synchronization to legacy system ▸ Decommission migrated module
  • 26. Modernization challenges 26 Migration challenges ▸ Low-risk changes with demonstrable progress ▸ Deliver enhancements and new “business value” ▸ Simultaneously delivering new services Distributed systems challenges ▸ Automation and operations at scale ▸ Dual-writes and long-running business transactions ▸ Analytical and reporting data needs
  • 27. Operating event-driven services at scale 27 Microservices on Kubernetes ▸ Deployment/rollback ▸ Placement/scheduling ▸ Configuration management ▸ Resource/failure isolation ▸ Auto heal/upgrade (through operators) Event-driven applications on Kubernetes ▸ Strimzi - operating Apache Kafka cluster ▸ KEDA - event-driven workload autoscaling ▸ Debezium - change data capture platform ▸ Apicurio - Schema Registry and operators to run them
  • 28. Outbox Pattern 28 Offers an approach for services to update their data store and notify other services in a reliable and eventually consistent manner. ▸ Addresses the dual-write problem ▸ Offers “read your own writes" semantics ▸ “at-least-once” semantics for consumers Reliable Data Exchange With the Outbox Pattern
  • 29. Saga Pattern 29 Splits up long-running business transactions into a series of multiple local transactions. When implemented using the Outbox Pattern, it offers the benefits of orchestration and asynchronous communication. ▸ Orchestration based coordination ▸ Asynchronous communication with Apache Kafka Saga Orchestration for Microservices Using the Outbox Pattern
  • 30. Summary 30 Modern software systems are like cities - they evolve over time, on top of legacy systems. Using proven patterns and standardized tools help create long-lasting systems that grow with your needs. ▸ Strangler Pattern - a low-risk application migration technique ▸ Outbox/Saga Patterns - reliable inter-service communication approach ▸ Debezium - a non-intrusive toolking for change data capture ▸ Kubernetes / Strimzi / Apache Kafka - de facto standards in their fields
  • 31. Resources 31 ▸ Monolith To Microservices ▸ Building Event-Driven Microservices ▸ Designing Data-Intensive Applications ▸ Kubernetes Patterns ▸ Debezium.io ▸ Keda.sh ▸ Strimzi.io ▸ github.com/windup
  • 32. 32 Red Hat OpenShift Streams for Apache Kafka a fully managed Apache Kafka service by Red Hat http://red.ht/TryKafka Try Apache Kafka in seconds
  • 33. Thank you! 33 Bilgin Ibryam Product Manager @Red Hat @bibryam