SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Fan-out, fan-in & the multiplexer
Replication recipes for global platform distribution
Introduction
Alex Hilton
Engineering Manager
Foreign Exchange Team
Passions
- ! Family
- 🍹 Mixology
- 🎲 Online Catan
- 🚀 Building the worlds next gen financial infrastructure
+ +
Global Platform Distribution Challenge
How best to centrally manage events generated in remote clusters?
HQ
Distribution across remote clusters yields great portability
Global Platform Distribution Challenge
How best to centrally manage events generated in remote clusters?
• Why does this challenge exist?
• Kafka distribution best practices & mistakes
• Mirror Maker replication recipes
• Topic Multiplexing
• Separate global distribution concerns from application domain
• Improve observability & monitoring
1
2
3
Information Distribution Challenge
Foreign Exchange
Platform
FX Partners
(Centralized)
Globally distributed APIs:
• Payment
• Transfer
• Card
• Wallet
Information Distribution Challenge
Foreign Exchange
Platform
Desired Experience:
🌏 Local
🚀 Fast
⭐ High availability
Our Constraints:
🎯 Central connections
Aggregation opportunities
Key Learning – Kafka promotes decomposition
Isolation benefits
• Single responsibility
• Single writer
From monolith… …to pluggable microservice pipeline
Why is Kafka a good fit? Pluggability
Kafka is a universal application dependency
Workflows modelled as chain of microservices
Pluggability benefits
- Unburden critical path
- Support innovation
- Composable capability
- Portability
API on Kafka Pattern
Price distribution
API on Kafka Pattern
• Push state & all decision making to very edge of system
• Fast API response time
🚀 Fast (API latency)
• Read API driven from in-memory state
• Write API publish instructions as events
⭐ High availability
• Convenient horizonal scalability
• Reduce dependencies on critical path
🌏 Local
• How to solve…? Instruction execution
Learnings – Simplify the critical path for API responses
• Burden Client with Kafka RPC
• Exactly once semantics
Do Don't
• Embrace eventual consistency
• Enforce idempotency
Global Distribution Pattern 🌏
Global Distribution Pattern
• Remote Kafka clusters power global API distribution
• Mirror maker (v2) used to synchronize clusters
• Fan out vs Fan in
🚀 Fast (API latency)
• Internalize the cost of WAN distribution
⭐ High availability
• Opportunities for DR / cross region fallback (cross cluster)
🌏 Local
• We can deploy APIs near customers
• Kafka yields application portability & composability
M
irror m
aker
M
irror m
aker
Multi-cluster Challenges - Fan out
Fan out replication Pattern
• Mirror maker pull model
• Avoid monolithic replication processor
• MM instance deployed to each remote region
• Topic data is cloned (but not offsets).
• Topic name remains the same
• Offsets vary
Mirror Maker Best Practice - Isolation
MM Isolation Best Practice
• Separate MM instances for each region
• Isolate meta data per source-destination combination
• Version meta data to support case reset / remodel
⭐ Benefits
• Limit blast radius of cluster stability issues
• Flexibility to shutdown / maintain regions
• Migration pathway to support MM upgrades
MM Kafka cluster naming convention:
version.source.dest.[dest,src]
v5 . HQ . US . dest
Sample Mirror Maker Metadata
Fan in… and the multiplexer
Multi-cluster Challenges - Fan in
Fan in challenge
Compromised isolation on merged topic
• Harder to reconcile / monitor
• Violate single writer principal
Multi-cluster Challenges - Fan in
Fan in – better isolation
Isolation ✅
• Region, topic, mirror maker
Portability ❌
• Application & env burden
• API & topic region
• Processor consumption
Scalability 😐
• Multiple workflows
Monitoring 😐
• How to monitor replication during off peak periods?
Fan in – the naïve way
Multiplexing to the rescue!
a method by which multiple analog or digital signals are combined into one signal over a shared medium.
The aim is to share a scarce resource.
Multiplexing to the rescue!
Could multiplexing techniques help us to abstract distribution / replication concerns away from
application / business domain?
Apply multiplex concept to fan-in challenge
We can solve isolation, distribution, portability, replication monitoring
concerns without burdening our application
• Multiplex service can interlace all source topics into a single channel
• Simpler replication, easier to isolate, easier to monitor
• Demux service can deinterlace multiplexed byte stream
Multiplexing unburdens application domain from distribution concern
Isolation ✅
Portability ✅
Scalability ✅
Monitoring ❓
Generating Mux Stream & Partitioning
Multiplexing is not difficult – entire mux service is 300 lines of Kotlin
Respect source partition sequence.
PartitionKey = srcTopic + srcPartition
Can use ByteArray serdes to copy
record key & value to mux topic.
No need to use original schema
Kafka headers provide convenient way
to carry original context to demux
(the source partition & topic name)
Kafka Header Metadata
Improving observability & monitoring
Throughput and latency metrics
• Kafka mux headers carry source region to help improve event observability
• Demultiplexer exposes latency / throughput metrics to power rich dashboard
Improving observability & monitoring
Improving observability & monitoring
Dead replication alerts
• Synthetic ‘keepalive’ events generated to keep replication & monitor warm during off-peak time
• Synthetic events internalized to multiplexer / demultiplexer & do not affect business workflow
Mux Dashboard
Kafka Distribution Patterns – Fan in Fan out & the Multiplexer
✅ Isolation
✅ Portability
✅ Scalability
✅ Monitoring
🌏 Local
🚀 Fast
⭐ High availability
Fan In + Multiplexer
Fan Out
Conclusions
- Install Kafka cluster in each customer region
- Keep API processing simple
- Strive for strong isolation between regions
- Separate application & distribution concerns
What Next…?
Support Multiple HQ Regions
Share The Multiplexer Code
Read more on our Blog!
medium.com/airwallex-engineering
Feedback / questions: alex.hilton@airwallex.com
airwallex.com/careers

Weitere ähnliche Inhalte

Was ist angesagt?

Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
Kai Wähner
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 

Was ist angesagt? (20)

Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
 
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
 
Blockchain Technology In IOT
Blockchain Technology In IOTBlockchain Technology In IOT
Blockchain Technology In IOT
 
Unified Log Processing Architecture
Unified Log Processing ArchitectureUnified Log Processing Architecture
Unified Log Processing Architecture
 
Future of Integration | MuleSoft
Future of Integration | MuleSoftFuture of Integration | MuleSoft
Future of Integration | MuleSoft
 
Emv chip software Writer/Reader ( CHIPSO EMV)
Emv chip software  Writer/Reader ( CHIPSO EMV)Emv chip software  Writer/Reader ( CHIPSO EMV)
Emv chip software Writer/Reader ( CHIPSO EMV)
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
Demystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes ArchitectureDemystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes Architecture
 
VXLAN
VXLANVXLAN
VXLAN
 
Blockchain technology for the grid
Blockchain technology for the gridBlockchain technology for the grid
Blockchain technology for the grid
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
 
Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
 
Journey of saga pattern in microservice architecture
Journey of saga pattern in microservice architectureJourney of saga pattern in microservice architecture
Journey of saga pattern in microservice architecture
 
Using blockchains in the energy sector and beyond
Using blockchains in the energy sector and beyondUsing blockchains in the energy sector and beyond
Using blockchains in the energy sector and beyond
 
Network virtualization
Network virtualizationNetwork virtualization
Network virtualization
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQP
 
Blockchain - Use Cases
Blockchain - Use CasesBlockchain - Use Cases
Blockchain - Use Cases
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 

Ähnlich wie Fan-out, fan-in & the multiplexer: Replication recipes for global platform distribution | Alex Hilton, Airwallex

Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
confluent
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stack
Nitin Mehta
 

Ähnlich wie Fan-out, fan-in & the multiplexer: Replication recipes for global platform distribution | Alex Hilton, Airwallex (20)

Microservices.pdf
Microservices.pdfMicroservices.pdf
Microservices.pdf
 
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...
 
The evolution of data center network fabrics
The evolution of data center network fabricsThe evolution of data center network fabrics
The evolution of data center network fabrics
 
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stack
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
Availability of Kafka - Beyond the Brokers | Andrew Borley and Emma Humber, IBM
Availability of Kafka - Beyond the Brokers | Andrew Borley and Emma Humber, IBMAvailability of Kafka - Beyond the Brokers | Andrew Borley and Emma Humber, IBM
Availability of Kafka - Beyond the Brokers | Andrew Borley and Emma Humber, IBM
 
Taming the cost of your first cloud - CCCEU 2014
Taming the cost of your first cloud - CCCEU 2014Taming the cost of your first cloud - CCCEU 2014
Taming the cost of your first cloud - CCCEU 2014
 
Newt global meetup microservices
Newt global meetup microservicesNewt global meetup microservices
Newt global meetup microservices
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session I
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
 
Event Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache KafkaEvent Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache Kafka
 
Legion - AI Runtime Platform
Legion -  AI Runtime PlatformLegion -  AI Runtime Platform
Legion - AI Runtime Platform
 
DockerCon EU 2015: Using Docker and SDN for telco-grade applications
DockerCon EU 2015: Using Docker and SDN for telco-grade applicationsDockerCon EU 2015: Using Docker and SDN for telco-grade applications
DockerCon EU 2015: Using Docker and SDN for telco-grade applications
 

Mehr von 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
 

Mehr von 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
 

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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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 ...
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 

Fan-out, fan-in & the multiplexer: Replication recipes for global platform distribution | Alex Hilton, Airwallex

  • 1. Fan-out, fan-in & the multiplexer Replication recipes for global platform distribution
  • 2. Introduction Alex Hilton Engineering Manager Foreign Exchange Team Passions - ! Family - 🍹 Mixology - 🎲 Online Catan - 🚀 Building the worlds next gen financial infrastructure + +
  • 3. Global Platform Distribution Challenge How best to centrally manage events generated in remote clusters? HQ Distribution across remote clusters yields great portability
  • 4. Global Platform Distribution Challenge How best to centrally manage events generated in remote clusters? • Why does this challenge exist? • Kafka distribution best practices & mistakes • Mirror Maker replication recipes • Topic Multiplexing • Separate global distribution concerns from application domain • Improve observability & monitoring 1 2 3
  • 5. Information Distribution Challenge Foreign Exchange Platform FX Partners (Centralized) Globally distributed APIs: • Payment • Transfer • Card • Wallet
  • 6. Information Distribution Challenge Foreign Exchange Platform Desired Experience: 🌏 Local 🚀 Fast ⭐ High availability Our Constraints: 🎯 Central connections Aggregation opportunities
  • 7. Key Learning – Kafka promotes decomposition Isolation benefits • Single responsibility • Single writer From monolith… …to pluggable microservice pipeline
  • 8. Why is Kafka a good fit? Pluggability Kafka is a universal application dependency Workflows modelled as chain of microservices Pluggability benefits - Unburden critical path - Support innovation - Composable capability - Portability
  • 9. API on Kafka Pattern Price distribution API on Kafka Pattern • Push state & all decision making to very edge of system • Fast API response time 🚀 Fast (API latency) • Read API driven from in-memory state • Write API publish instructions as events ⭐ High availability • Convenient horizonal scalability • Reduce dependencies on critical path 🌏 Local • How to solve…? Instruction execution
  • 10. Learnings – Simplify the critical path for API responses • Burden Client with Kafka RPC • Exactly once semantics Do Don't • Embrace eventual consistency • Enforce idempotency
  • 11. Global Distribution Pattern 🌏 Global Distribution Pattern • Remote Kafka clusters power global API distribution • Mirror maker (v2) used to synchronize clusters • Fan out vs Fan in 🚀 Fast (API latency) • Internalize the cost of WAN distribution ⭐ High availability • Opportunities for DR / cross region fallback (cross cluster) 🌏 Local • We can deploy APIs near customers • Kafka yields application portability & composability M irror m aker M irror m aker
  • 12. Multi-cluster Challenges - Fan out Fan out replication Pattern • Mirror maker pull model • Avoid monolithic replication processor • MM instance deployed to each remote region • Topic data is cloned (but not offsets). • Topic name remains the same • Offsets vary
  • 13. Mirror Maker Best Practice - Isolation MM Isolation Best Practice • Separate MM instances for each region • Isolate meta data per source-destination combination • Version meta data to support case reset / remodel ⭐ Benefits • Limit blast radius of cluster stability issues • Flexibility to shutdown / maintain regions • Migration pathway to support MM upgrades MM Kafka cluster naming convention: version.source.dest.[dest,src] v5 . HQ . US . dest
  • 15. Fan in… and the multiplexer
  • 16. Multi-cluster Challenges - Fan in Fan in challenge Compromised isolation on merged topic • Harder to reconcile / monitor • Violate single writer principal
  • 17. Multi-cluster Challenges - Fan in Fan in – better isolation Isolation ✅ • Region, topic, mirror maker Portability ❌ • Application & env burden • API & topic region • Processor consumption Scalability 😐 • Multiple workflows Monitoring 😐 • How to monitor replication during off peak periods?
  • 18. Fan in – the naïve way
  • 19. Multiplexing to the rescue! a method by which multiple analog or digital signals are combined into one signal over a shared medium. The aim is to share a scarce resource.
  • 20. Multiplexing to the rescue! Could multiplexing techniques help us to abstract distribution / replication concerns away from application / business domain?
  • 21. Apply multiplex concept to fan-in challenge We can solve isolation, distribution, portability, replication monitoring concerns without burdening our application • Multiplex service can interlace all source topics into a single channel • Simpler replication, easier to isolate, easier to monitor • Demux service can deinterlace multiplexed byte stream
  • 22. Multiplexing unburdens application domain from distribution concern Isolation ✅ Portability ✅ Scalability ✅ Monitoring ❓
  • 23. Generating Mux Stream & Partitioning Multiplexing is not difficult – entire mux service is 300 lines of Kotlin Respect source partition sequence. PartitionKey = srcTopic + srcPartition Can use ByteArray serdes to copy record key & value to mux topic. No need to use original schema Kafka headers provide convenient way to carry original context to demux (the source partition & topic name)
  • 25. Improving observability & monitoring Throughput and latency metrics • Kafka mux headers carry source region to help improve event observability • Demultiplexer exposes latency / throughput metrics to power rich dashboard
  • 27. Improving observability & monitoring Dead replication alerts • Synthetic ‘keepalive’ events generated to keep replication & monitor warm during off-peak time • Synthetic events internalized to multiplexer / demultiplexer & do not affect business workflow
  • 29. Kafka Distribution Patterns – Fan in Fan out & the Multiplexer ✅ Isolation ✅ Portability ✅ Scalability ✅ Monitoring 🌏 Local 🚀 Fast ⭐ High availability Fan In + Multiplexer Fan Out Conclusions - Install Kafka cluster in each customer region - Keep API processing simple - Strive for strong isolation between regions - Separate application & distribution concerns
  • 30. What Next…? Support Multiple HQ Regions Share The Multiplexer Code Read more on our Blog! medium.com/airwallex-engineering Feedback / questions: alex.hilton@airwallex.com airwallex.com/careers