SlideShare a Scribd company logo
1 of 36
Confidential – © 2020 Revolut
Event Streaming
The hard Revolut way
César Luis Alvargonzález
Confidential – © 2020 Revolut
César Luis Alvargonzález
Senior Software Engineer at Revolut
Platform team Jan 2019 - Ongoing
Twitter: @sisa989
Email: cesar.alvargonzalez@revolut.com
Opinions are my own
Confidential – © 2020 Revolut
Agenda
- Alpha Framework
- Motivations
- Eventstore architecture
- Write path
- Streaming
- Partitioning
- Flow of an Event
- Conclusion
Confidential – © 2020 Revolut
What’s Revolut?
Confidential – © 2020 Revolut
Revolut’s Architecture
Around 160 services
Synchronous & asynchronous communication
Java 11, Kotlin and Scala
Postgres 12 and Redis
Confidential – © 2020 Revolut
Alpha Framework [DDD Framework]
Action Model
Action Event Model Event
1 n
Confidential – © 2020 Revolut
Requirements
Strong consistency
At least once delivery
Low latency
High Scalability
Easy to operate
Confidential – © 2020 Revolut
Confidential – © 2020 Revolut
Why not Kafka?
Ad-hoc queries & filters
Querying by time
Guaranteed consistency between state changes and persisted
events.
One to many relation between Action-Event and Model-Event
Allow archiving events
EventStore & EventStream
Confidential – © 2020 Revolut
EventStore in numbers
Streaming
Events per month
Retention
Years of available data
Ingestion
Events per month 3.7B1B
Growth
Year over year10x 4y
Confidential – © 2020 Revolut
Fraud Detection
🕵🕵
FX-Risk
Calculation
🕵
Marketing and
Promotion.
📢
Derived Systems
🕵🕵
Use Cases
Confidential – © 2020 Revolut
Technologies
Confidential – © 2020 Revolut
EventStore
Persistence
Confidential – © 2020 Revolut
Write-Path - Publisher
Write ahead log
Atomic Operation
Reconciler
Confidential – © 2020 Revolut
Write-Path - Server Side
PostgreSQL Native Partitioning
Partitioning per month
PG Partman extension
Confidential – © 2020 Revolut
Write-Path - Server Side
Streaming - Client Side
Confidential – © 2020 Revolut
Streaming Architecture
Confidential – © 2020 Revolut
Consumers control
public final class AddressChangeConsumer extends
SingleEventConsumer {
AddressChangeConsumer() {
super(USER_MODEL_TYPE,
USER_ADDRESS_CHANGED_EVENT);
}
@Override
public void handle(ModelEvent event) {
// Business Logic
}
}
public final class TransactionRevertedEventConsumer
extends MultiEventConsumer {
public TransactionRevertedEventConsumer() {
super(TRANSACTION_MODEL_TYPE, Set.of(
TRANSACTION_REVERTED_EVENT,
TRANSACTION_REFUNDED_EVENT,
TRANSACTION_PARTIALLY_REFUNDED_EVENT
);
}
@Override
public void handle(final ModelEvent event) {
// Business Logic
}
}
Confidential – © 2020 Revolut
Event Processor
Execute Several Consumers
Execute Several Partitions
Relies on distributed locks
final List<EventStoreConsumerWithQuery> consumers =
List.of(
new AddressChangeConsumer(),
new TransactionRevertedEventConsumer()
);
final EventStreamProcessor processor =
eventStreamProcessor("com.revolut.my-app", config)
.consumers(consumers)
.build();
processor.run();
Confidential – © 2020 Revolut
Partitioning
Sequential
Virtual Partitions
Increase throughput by adding partitions
Confidential – © 2020 Revolut
Consumers Execution
Parallel Sequential
Single threaded
Parallelize consumers
Confidential – © 2020 Revolut
Stream
Built-in repartitioning
Confidential – © 2020 Revolut
Checkpointing
Commit per event
Persist on Redis
Record per partition
Streaming - Server Side
Confidential – © 2020 Revolut
Anatomy of a Subscription
Offline stream: Historical events
Live Stream: Real Time events
Confidential – © 2020 Revolut
Offline Stream
offset.isBefore(
Instant.now().minusSeconds(600));
!offset.isBefore(
Instant.now().minusSeconds(600));
Confidential – © 2020 Revolut
Live Stream
Confidential – © 2020 Revolut
Live Stream
Confidential – © 2020 Revolut
Reactive Streams
Lazy
Built-in backpressure
Non-blocking
Consumers control the pace
Confidential – © 2020 Revolut
Guarantee of Processing
Dead Letter Queue
Processing Guarantee Policy:
- Unlimited
- Expiring
- Disabled
Replay Strategy:
- Startup
- Periodic
- Disabled
Confidential – © 2020 Revolut
Flow of an Event
1 2 3
4 6 5a
5b
78
Confidential – © 2020 Revolut
Q & A
www.revolut.com

More Related Content

What's hot

Data Culture Keynote and Exec Track Birm Dec 8th
Data Culture Keynote and Exec Track Birm Dec 8thData Culture Keynote and Exec Track Birm Dec 8th
Data Culture Keynote and Exec Track Birm Dec 8thJonathan Woodward
 
Sydney Water Target Operating Model Design
Sydney Water Target Operating Model DesignSydney Water Target Operating Model Design
Sydney Water Target Operating Model DesignSheng Zhong (Steven)
 
Davai Pitchdeck
Davai Pitchdeck Davai Pitchdeck
Davai Pitchdeck davaiapp
 
IT4IT real life examples & myths and rumors dispelled
IT4IT real life examples & myths and rumors dispelledIT4IT real life examples & myths and rumors dispelled
IT4IT real life examples & myths and rumors dispelledTony Price
 
Business intelligence competency centre strategy and road map
Business intelligence competency centre strategy and road mapBusiness intelligence competency centre strategy and road map
Business intelligence competency centre strategy and road mapOmar Khan
 
Risk Management Toolkit - Framework, Best Practices and Templates
Risk Management Toolkit - Framework, Best Practices and TemplatesRisk Management Toolkit - Framework, Best Practices and Templates
Risk Management Toolkit - Framework, Best Practices and TemplatesAurelien Domont, MBA
 
Big Data Fabric: A Recipe for Big Data Initiatives
Big Data Fabric: A Recipe for Big Data InitiativesBig Data Fabric: A Recipe for Big Data Initiatives
Big Data Fabric: A Recipe for Big Data InitiativesDenodo
 
Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture Rajesh Kumar
 
Value Chain Canvas Model an Enterprise Architecture Framework
Value Chain Canvas Model an Enterprise Architecture FrameworkValue Chain Canvas Model an Enterprise Architecture Framework
Value Chain Canvas Model an Enterprise Architecture FrameworkRené MANDEL
 
Business Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachBusiness Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachDATAVERSITY
 
Harvest Pre-Seed Pitch Deck
Harvest Pre-Seed Pitch DeckHarvest Pre-Seed Pitch Deck
Harvest Pre-Seed Pitch DeckTory Reiss
 
Business Intelligence (BI) and Data Management Basics
Business Intelligence (BI) and Data Management  Basics Business Intelligence (BI) and Data Management  Basics
Business Intelligence (BI) and Data Management Basics amorshed
 
data-analytics-strategy-ebook.pptx
data-analytics-strategy-ebook.pptxdata-analytics-strategy-ebook.pptx
data-analytics-strategy-ebook.pptxMohamedHendawy17
 
The Sales Hacker Deck On Sales Decks
The Sales Hacker Deck On Sales DecksThe Sales Hacker Deck On Sales Decks
The Sales Hacker Deck On Sales DecksSales Hacker
 
Basics of BI and Data Management (Summary).pdf
Basics of BI and Data Management (Summary).pdfBasics of BI and Data Management (Summary).pdf
Basics of BI and Data Management (Summary).pdfamorshed
 
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...Erwin de Kreuk
 
Reinventing Enterprise Operations
Reinventing Enterprise OperationsReinventing Enterprise Operations
Reinventing Enterprise Operationsaccenture
 
Data storytelling with personas, Utrecht
Data storytelling with personas, UtrechtData storytelling with personas, Utrecht
Data storytelling with personas, UtrechtCREATIVE COMPANION
 

What's hot (20)

Data Culture Keynote and Exec Track Birm Dec 8th
Data Culture Keynote and Exec Track Birm Dec 8thData Culture Keynote and Exec Track Birm Dec 8th
Data Culture Keynote and Exec Track Birm Dec 8th
 
Sydney Water Target Operating Model Design
Sydney Water Target Operating Model DesignSydney Water Target Operating Model Design
Sydney Water Target Operating Model Design
 
Powering B2B Sales with Digital
Powering B2B Sales with DigitalPowering B2B Sales with Digital
Powering B2B Sales with Digital
 
Tojin Eapen - Augmenting Creativity Using Gen AI.pdf
Tojin Eapen - Augmenting Creativity Using Gen AI.pdfTojin Eapen - Augmenting Creativity Using Gen AI.pdf
Tojin Eapen - Augmenting Creativity Using Gen AI.pdf
 
Davai Pitchdeck
Davai Pitchdeck Davai Pitchdeck
Davai Pitchdeck
 
IT4IT real life examples & myths and rumors dispelled
IT4IT real life examples & myths and rumors dispelledIT4IT real life examples & myths and rumors dispelled
IT4IT real life examples & myths and rumors dispelled
 
Business intelligence competency centre strategy and road map
Business intelligence competency centre strategy and road mapBusiness intelligence competency centre strategy and road map
Business intelligence competency centre strategy and road map
 
Risk Management Toolkit - Framework, Best Practices and Templates
Risk Management Toolkit - Framework, Best Practices and TemplatesRisk Management Toolkit - Framework, Best Practices and Templates
Risk Management Toolkit - Framework, Best Practices and Templates
 
Big Data Fabric: A Recipe for Big Data Initiatives
Big Data Fabric: A Recipe for Big Data InitiativesBig Data Fabric: A Recipe for Big Data Initiatives
Big Data Fabric: A Recipe for Big Data Initiatives
 
Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture
 
Value Chain Canvas Model an Enterprise Architecture Framework
Value Chain Canvas Model an Enterprise Architecture FrameworkValue Chain Canvas Model an Enterprise Architecture Framework
Value Chain Canvas Model an Enterprise Architecture Framework
 
Business Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachBusiness Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected Approach
 
Harvest Pre-Seed Pitch Deck
Harvest Pre-Seed Pitch DeckHarvest Pre-Seed Pitch Deck
Harvest Pre-Seed Pitch Deck
 
Business Intelligence (BI) and Data Management Basics
Business Intelligence (BI) and Data Management  Basics Business Intelligence (BI) and Data Management  Basics
Business Intelligence (BI) and Data Management Basics
 
data-analytics-strategy-ebook.pptx
data-analytics-strategy-ebook.pptxdata-analytics-strategy-ebook.pptx
data-analytics-strategy-ebook.pptx
 
The Sales Hacker Deck On Sales Decks
The Sales Hacker Deck On Sales DecksThe Sales Hacker Deck On Sales Decks
The Sales Hacker Deck On Sales Decks
 
Basics of BI and Data Management (Summary).pdf
Basics of BI and Data Management (Summary).pdfBasics of BI and Data Management (Summary).pdf
Basics of BI and Data Management (Summary).pdf
 
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...
Azure Key Vault, Azure Dev Ops and Azure Synapse - how these services work pe...
 
Reinventing Enterprise Operations
Reinventing Enterprise OperationsReinventing Enterprise Operations
Reinventing Enterprise Operations
 
Data storytelling with personas, Utrecht
Data storytelling with personas, UtrechtData storytelling with personas, Utrecht
Data storytelling with personas, Utrecht
 

Similar to Event Streaming The hard Revolut way

Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
CARE initiative technical prospectus
CARE initiative technical prospectusCARE initiative technical prospectus
CARE initiative technical prospectusMartin Geddes
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareHostedbyConfluent
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsconfluent
 
Event Horizon at Solace Connect Singapore
Event Horizon at Solace Connect SingaporeEvent Horizon at Solace Connect Singapore
Event Horizon at Solace Connect SingaporeSolace
 
Moving existing apps to the cloud
 Moving existing apps to the cloud Moving existing apps to the cloud
Moving existing apps to the cloudRam Maddali
 
Lets dance- Dutch Architecture Conference (LAC) 2018
Lets dance- Dutch Architecture Conference (LAC) 2018Lets dance- Dutch Architecture Conference (LAC) 2018
Lets dance- Dutch Architecture Conference (LAC) 2018Yenlo
 
Red Hat Openshift on Microsoft Azure
Red Hat Openshift on Microsoft AzureRed Hat Openshift on Microsoft Azure
Red Hat Openshift on Microsoft AzureJohn Archer
 
See Inside the Middleware Black Box
See Inside the Middleware Black Box See Inside the Middleware Black Box
See Inside the Middleware Black Box CA Technologies
 
Introduction to the Wave Platform API
Introduction to the Wave Platform APIIntroduction to the Wave Platform API
Introduction to the Wave Platform APISalesforce Developers
 
Building modern secure API Products and Monetise with MuleSoft Anypoint Platform
Building modern secure API Products and Monetise with MuleSoft Anypoint PlatformBuilding modern secure API Products and Monetise with MuleSoft Anypoint Platform
Building modern secure API Products and Monetise with MuleSoft Anypoint PlatformHarshana Martin
 
Projects Worked on at Autumn Leaf
Projects Worked on at Autumn LeafProjects Worked on at Autumn Leaf
Projects Worked on at Autumn LeafLourens G
 
3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...DevOps.com
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Richard Banks
 
We are Net3 Technology
We are Net3 TechnologyWe are Net3 Technology
We are Net3 TechnologyKate Bissinger
 
Microservices: Breaking Apart the Monolith
Microservices:  Breaking Apart the Monolith Microservices:  Breaking Apart the Monolith
Microservices: Breaking Apart the Monolith Iron.io
 
Building event-driven (Micro)Services with Apache Kafka
Building event-driven (Micro)Services with Apache Kafka Building event-driven (Micro)Services with Apache Kafka
Building event-driven (Micro)Services with Apache Kafka Guido Schmutz
 
How to Build Streaming Apps with Confluent II
How to Build Streaming Apps with Confluent IIHow to Build Streaming Apps with Confluent II
How to Build Streaming Apps with Confluent IIconfluent
 

Similar to Event Streaming The hard Revolut way (20)

Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
CARE initiative technical prospectus
CARE initiative technical prospectusCARE initiative technical prospectus
CARE initiative technical prospectus
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Event Horizon at Solace Connect Singapore
Event Horizon at Solace Connect SingaporeEvent Horizon at Solace Connect Singapore
Event Horizon at Solace Connect Singapore
 
Adopting the Cloud
Adopting the CloudAdopting the Cloud
Adopting the Cloud
 
Moving existing apps to the cloud
 Moving existing apps to the cloud Moving existing apps to the cloud
Moving existing apps to the cloud
 
Lets dance- Dutch Architecture Conference (LAC) 2018
Lets dance- Dutch Architecture Conference (LAC) 2018Lets dance- Dutch Architecture Conference (LAC) 2018
Lets dance- Dutch Architecture Conference (LAC) 2018
 
Red Hat Openshift on Microsoft Azure
Red Hat Openshift on Microsoft AzureRed Hat Openshift on Microsoft Azure
Red Hat Openshift on Microsoft Azure
 
See Inside the Middleware Black Box
See Inside the Middleware Black Box See Inside the Middleware Black Box
See Inside the Middleware Black Box
 
Introduction to the Wave Platform API
Introduction to the Wave Platform APIIntroduction to the Wave Platform API
Introduction to the Wave Platform API
 
Building modern secure API Products and Monetise with MuleSoft Anypoint Platform
Building modern secure API Products and Monetise with MuleSoft Anypoint PlatformBuilding modern secure API Products and Monetise with MuleSoft Anypoint Platform
Building modern secure API Products and Monetise with MuleSoft Anypoint Platform
 
Projects Worked on at Autumn Leaf
Projects Worked on at Autumn LeafProjects Worked on at Autumn Leaf
Projects Worked on at Autumn Leaf
 
3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016
 
ADC-as-a-Service
ADC-as-a-ServiceADC-as-a-Service
ADC-as-a-Service
 
We are Net3 Technology
We are Net3 TechnologyWe are Net3 Technology
We are Net3 Technology
 
Microservices: Breaking Apart the Monolith
Microservices:  Breaking Apart the Monolith Microservices:  Breaking Apart the Monolith
Microservices: Breaking Apart the Monolith
 
Building event-driven (Micro)Services with Apache Kafka
Building event-driven (Micro)Services with Apache Kafka Building event-driven (Micro)Services with Apache Kafka
Building event-driven (Micro)Services with Apache Kafka
 
How to Build Streaming Apps with Confluent II
How to Build Streaming Apps with Confluent IIHow to Build Streaming Apps with Confluent II
How to Build Streaming Apps with Confluent II
 

More from London Microservices

Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...London Microservices
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...London Microservices
 
Log and control all service-to-service traffic in one place (Kelvin Wong)
Log and control all service-to-service traffic in one place (Kelvin Wong)Log and control all service-to-service traffic in one place (Kelvin Wong)
Log and control all service-to-service traffic in one place (Kelvin Wong)London Microservices
 
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)London Microservices
 
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...London Microservices
 
Robots and Food (Orfeo Nicolai, Karakuri)
Robots and Food (Orfeo Nicolai, Karakuri)Robots and Food (Orfeo Nicolai, Karakuri)
Robots and Food (Orfeo Nicolai, Karakuri)London Microservices
 
Cloud Native Patterns (Jamie Dobson, Container Solutions)
Cloud Native Patterns (Jamie Dobson, Container Solutions)Cloud Native Patterns (Jamie Dobson, Container Solutions)
Cloud Native Patterns (Jamie Dobson, Container Solutions)London Microservices
 
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)London Microservices
 

More from London Microservices (8)

Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
 
Log and control all service-to-service traffic in one place (Kelvin Wong)
Log and control all service-to-service traffic in one place (Kelvin Wong)Log and control all service-to-service traffic in one place (Kelvin Wong)
Log and control all service-to-service traffic in one place (Kelvin Wong)
 
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
 
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
 
Robots and Food (Orfeo Nicolai, Karakuri)
Robots and Food (Orfeo Nicolai, Karakuri)Robots and Food (Orfeo Nicolai, Karakuri)
Robots and Food (Orfeo Nicolai, Karakuri)
 
Cloud Native Patterns (Jamie Dobson, Container Solutions)
Cloud Native Patterns (Jamie Dobson, Container Solutions)Cloud Native Patterns (Jamie Dobson, Container Solutions)
Cloud Native Patterns (Jamie Dobson, Container Solutions)
 
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Event Streaming The hard Revolut way

  • 1. Confidential – © 2020 Revolut Event Streaming The hard Revolut way César Luis Alvargonzález
  • 2. Confidential – © 2020 Revolut César Luis Alvargonzález Senior Software Engineer at Revolut Platform team Jan 2019 - Ongoing Twitter: @sisa989 Email: cesar.alvargonzalez@revolut.com
  • 4. Confidential – © 2020 Revolut Agenda - Alpha Framework - Motivations - Eventstore architecture - Write path - Streaming - Partitioning - Flow of an Event - Conclusion
  • 5. Confidential – © 2020 Revolut What’s Revolut?
  • 6. Confidential – © 2020 Revolut Revolut’s Architecture Around 160 services Synchronous & asynchronous communication Java 11, Kotlin and Scala Postgres 12 and Redis
  • 7. Confidential – © 2020 Revolut Alpha Framework [DDD Framework] Action Model Action Event Model Event 1 n
  • 8. Confidential – © 2020 Revolut Requirements Strong consistency At least once delivery Low latency High Scalability Easy to operate
  • 9. Confidential – © 2020 Revolut
  • 10. Confidential – © 2020 Revolut Why not Kafka? Ad-hoc queries & filters Querying by time Guaranteed consistency between state changes and persisted events. One to many relation between Action-Event and Model-Event Allow archiving events
  • 12. Confidential – © 2020 Revolut EventStore in numbers Streaming Events per month Retention Years of available data Ingestion Events per month 3.7B1B Growth Year over year10x 4y
  • 13. Confidential – © 2020 Revolut Fraud Detection 🕵🕵 FX-Risk Calculation 🕵 Marketing and Promotion. 📢 Derived Systems 🕵🕵 Use Cases
  • 14. Confidential – © 2020 Revolut Technologies
  • 15. Confidential – © 2020 Revolut EventStore
  • 17. Confidential – © 2020 Revolut Write-Path - Publisher Write ahead log Atomic Operation Reconciler
  • 18. Confidential – © 2020 Revolut Write-Path - Server Side PostgreSQL Native Partitioning Partitioning per month PG Partman extension
  • 19. Confidential – © 2020 Revolut Write-Path - Server Side
  • 21. Confidential – © 2020 Revolut Streaming Architecture
  • 22. Confidential – © 2020 Revolut Consumers control public final class AddressChangeConsumer extends SingleEventConsumer { AddressChangeConsumer() { super(USER_MODEL_TYPE, USER_ADDRESS_CHANGED_EVENT); } @Override public void handle(ModelEvent event) { // Business Logic } } public final class TransactionRevertedEventConsumer extends MultiEventConsumer { public TransactionRevertedEventConsumer() { super(TRANSACTION_MODEL_TYPE, Set.of( TRANSACTION_REVERTED_EVENT, TRANSACTION_REFUNDED_EVENT, TRANSACTION_PARTIALLY_REFUNDED_EVENT ); } @Override public void handle(final ModelEvent event) { // Business Logic } }
  • 23. Confidential – © 2020 Revolut Event Processor Execute Several Consumers Execute Several Partitions Relies on distributed locks final List<EventStoreConsumerWithQuery> consumers = List.of( new AddressChangeConsumer(), new TransactionRevertedEventConsumer() ); final EventStreamProcessor processor = eventStreamProcessor("com.revolut.my-app", config) .consumers(consumers) .build(); processor.run();
  • 24. Confidential – © 2020 Revolut Partitioning Sequential Virtual Partitions Increase throughput by adding partitions
  • 25. Confidential – © 2020 Revolut Consumers Execution Parallel Sequential Single threaded Parallelize consumers
  • 26. Confidential – © 2020 Revolut Stream Built-in repartitioning
  • 27. Confidential – © 2020 Revolut Checkpointing Commit per event Persist on Redis Record per partition
  • 29. Confidential – © 2020 Revolut Anatomy of a Subscription Offline stream: Historical events Live Stream: Real Time events
  • 30. Confidential – © 2020 Revolut Offline Stream offset.isBefore( Instant.now().minusSeconds(600)); !offset.isBefore( Instant.now().minusSeconds(600));
  • 31. Confidential – © 2020 Revolut Live Stream
  • 32. Confidential – © 2020 Revolut Live Stream
  • 33. Confidential – © 2020 Revolut Reactive Streams Lazy Built-in backpressure Non-blocking Consumers control the pace
  • 34. Confidential – © 2020 Revolut Guarantee of Processing Dead Letter Queue Processing Guarantee Policy: - Unlimited - Expiring - Disabled Replay Strategy: - Startup - Periodic - Disabled
  • 35. Confidential – © 2020 Revolut Flow of an Event 1 2 3 4 6 5a 5b 78
  • 36. Confidential – © 2020 Revolut Q & A www.revolut.com