SlideShare une entreprise Scribd logo
1  sur  32
Where’s My Money
Gone?
Microservices in a Fin-Tech Business
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
$ whoami
• Thomas Badie
• Software Engineer @ Landbay since January
• Worked mainly in Advertising before
• From Marseille, France
• linkedin.com/in/thomasbadie
3
About Landbay
4
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
In A Previous Life…
• Advertising, 250M requests a day
• Service Oriented Architecture
• Each request has a very low value associated with it (<£0.01)
• Communication over HTTP (behind a proper HTTPS gateway)
• A server crashing would lose about ~250 requests
• Consequences:
• Monetary: ~£2.50
• Customer: Negligible
6
Life at Landbay
• Consequences in a similar scenario if similar setup:
• Could lose money movements
• Customer loses trust
• A big mistake => Lose FCA license
• Long story short: We cannot make any mistakes and
environment failures are not acceptable
7
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
Before Reaching Prod
• Agile/Scrum
• Design each ticket with at least one more person
• Unit + Service testing (minimum coverage required for build to
pass)
• Code review
• Continuous deployment
• More about our overall infrastructure and pipelines with Chris on
Tuesday at 2pm
9
Ensuring That It Works As Intended
• Monitoring (Dynatrace)
• Alerting (Dynatrace, slack, email)
• Reconciliation (Business side)
• Reconciliation (tech side – across services)
• Reconciliation (third parties)
10
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
Model of our Money Transfers
12
Cash Balance Investment
About Transactions (The Money Kind)
• We store everything in pennies (+10000)
• Each transaction represents a change to the account
(+301.50000)
• Concurrent inserts are fine but need to check for consistent
grouped selects (locks)
• We have several daily snapshots to prevent the system from
slowing down over time and archive
13
How Do We Ensure Resiliency?
• Services are replicated and hosted in different availability zones
• Database transaction
• Event driven
• RabbitMQ transactions (DB commit)
• In case of failure, each event retries 5 times before going in a dead
queue (requiring manual process from us)
• Cluster of rabbits (colony?) in different AWS availability zones
14
Conventions
15
Service
(+ Implicit DB)
Transaction
Service fails
HTTP MessageHTTP fails
Transaction
fails
On The Way To Resiliency – Simple Case
16
API Gateway Cash Balance
On The Way To Resiliency
• HTTP, only call investment if Cash Balance worked
• Obviously doesn’t work
17
API Gateway
Cash Balance
Investment
On The Way To Resiliency
• Distributed transaction Management
• Open same transaction in multiple services simultaneously.
• Hard to setup and maintain
18
API Gateway
Cash Balance
Investment
On The Way To Resiliency
• Cash Balance sends message to investment only if its
transaction works
19
API Gateway Cash Balance Investment
On The Way To Resiliency
• API Gateway may send messages listened to by different
services
20
Service 1 API Gateway Service 2
On The Way To Resiliency - Downsides
• The user may not immediately see the result of the operation he
ran, e.g. Registration and AML checks
• Require human intervention to recover
• Need to keep transactions small, leading to code generating
many concurrent transactions
21
Overview
• Introduction
• How is working in Financial Services different?
• General Processes
• How did we achieve resiliency?
• Case Studies
• Conclusion
1
Case Study 1 - Interest Payment
Version 1
23
Investment
Interest
Calculation
Cash Balance
Case Study 1 - Interest Payment
Version 1
• Triggered 1st of the month Cash Balance service receives the
amounts that need to go to each account
• Overall process estimated at a few hundred thousand
messages
• Lot of strain on network/platform
• It was working, but wasn’t the most optimal
24
Case Study 1 - Interest Payment Version
2
25
InterestInvestment Cash Balance
Case Study 1 - Interest Payment
Version 2
• Simpler and easier to maintain
• Fewer (bigger) messages
• In case of failure, we need to replay the whole message.
Heavier DB transaction, but light on the whole infrastructure.
• Use daily snapshots to figure out the amount to pay back
26
Case Study 2 - Diversification
27
DiversificationInvestment
Case Study 2 - Diversification
• Preventing our investors from ever saying “Where is my money
gone?!” is not only a tech problem
• We want to diversify everybody’s investments as much as
possible
• An average investor is funding 25 loans
• Built to accept failure:
• Works off stale data. If it’s incorrect we ignore the transaction
• Process runs at night, it’s unlikely that we will see many user generated
transactions running in parallel
• Runs every night, if we reached equilibrium, process does nothing
28
In Case Of Emergency
• Daily snapshots of DB
• Messages can be sent by hand through the RabbitMQ UI
• We have full audit of our messages stored in ElasticSearch (raw
messages that can be replayed)
• Each financial transaction represents a change, so we can
always modify them (even though very risky)
29
Conclusion
• Lightweight processes to ensure quality
• Transactions over messaging
• Sometimes we can bubble up the error to the user using HTTP,
but most of the time we work in the background
• It is useful to be flexible (ignoring some errors, …) in order to
achieve a simpler design
30
We’re Hiring!
• We’re recruiting…
• Software Engineers with 2+ years experience
• Scrum masters
• Product owners
• Email:
• thomas.badie@landbay.co.uk
•Any Questions?
31

Contenu connexe

Similaire à MuCon - Where’s my money gone?

From no services to Microservices
From no services to MicroservicesFrom no services to Microservices
From no services to MicroservicesJoão Cavalheiro
 
Unbundling Of Financial Services: The Blockchain(s) Revolution
Unbundling Of Financial Services: The Blockchain(s) RevolutionUnbundling Of Financial Services: The Blockchain(s) Revolution
Unbundling Of Financial Services: The Blockchain(s) RevolutionGeorge Samuel Samman
 
2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)roblund
 
Blockchain-Explained-v2.09.pdf
Blockchain-Explained-v2.09.pdfBlockchain-Explained-v2.09.pdf
Blockchain-Explained-v2.09.pdfArvindKumar265041
 
Navigating Cash Payment Solutions Using Automation.pdf
Navigating Cash Payment Solutions Using Automation.pdfNavigating Cash Payment Solutions Using Automation.pdf
Navigating Cash Payment Solutions Using Automation.pdfHemantBabtiwale
 
Making Blockchain Real for Business Explained - ibm
Making Blockchain Real for Business Explained - ibmMaking Blockchain Real for Business Explained - ibm
Making Blockchain Real for Business Explained - ibmDiego Alberto Tamayo
 
Blockchain explained-v2.09
Blockchain explained-v2.09Blockchain explained-v2.09
Blockchain explained-v2.09Milan Hazra
 
Why Treasurers Should Adopt Multilateral Netting
Why Treasurers Should Adopt Multilateral NettingWhy Treasurers Should Adopt Multilateral Netting
Why Treasurers Should Adopt Multilateral NettingKyriba Corporation
 
Event Driven Microservices architecture
Event Driven Microservices architectureEvent Driven Microservices architecture
Event Driven Microservices architectureNikhilBarthwal4
 
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...Kyriba Corporation
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native ApplicationEmiliano Pecis
 
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...apidays
 
TransferWise - from Product to Platform
TransferWise - from Product to PlatformTransferWise - from Product to Platform
TransferWise - from Product to PlatformAmazon Web Services
 
Programmable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainProgrammable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainIngo Weber
 
Developer Day Tech Session at QuickBooks Connect Sydney 2017
Developer Day Tech Session at QuickBooks Connect Sydney 2017Developer Day Tech Session at QuickBooks Connect Sydney 2017
Developer Day Tech Session at QuickBooks Connect Sydney 2017Intuit Developer
 

Similaire à MuCon - Where’s my money gone? (20)

From no services to Microservices
From no services to MicroservicesFrom no services to Microservices
From no services to Microservices
 
Unbundling Of Financial Services: The Blockchain(s) Revolution
Unbundling Of Financial Services: The Blockchain(s) RevolutionUnbundling Of Financial Services: The Blockchain(s) Revolution
Unbundling Of Financial Services: The Blockchain(s) Revolution
 
Forex vc-pitch
Forex vc-pitchForex vc-pitch
Forex vc-pitch
 
2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)
 
Blockchain-Explained-v2.09.pdf
Blockchain-Explained-v2.09.pdfBlockchain-Explained-v2.09.pdf
Blockchain-Explained-v2.09.pdf
 
Navigating Cash Payment Solutions Using Automation.pdf
Navigating Cash Payment Solutions Using Automation.pdfNavigating Cash Payment Solutions Using Automation.pdf
Navigating Cash Payment Solutions Using Automation.pdf
 
Digital Transformation and Blockchain
Digital Transformation and BlockchainDigital Transformation and Blockchain
Digital Transformation and Blockchain
 
1 introduction
1 introduction1 introduction
1 introduction
 
Making Blockchain Real for Business Explained - ibm
Making Blockchain Real for Business Explained - ibmMaking Blockchain Real for Business Explained - ibm
Making Blockchain Real for Business Explained - ibm
 
Blockchain explained-v2.09
Blockchain explained-v2.09Blockchain explained-v2.09
Blockchain explained-v2.09
 
Why Treasurers Should Adopt Multilateral Netting
Why Treasurers Should Adopt Multilateral NettingWhy Treasurers Should Adopt Multilateral Netting
Why Treasurers Should Adopt Multilateral Netting
 
Event Driven Microservices architecture
Event Driven Microservices architectureEvent Driven Microservices architecture
Event Driven Microservices architecture
 
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...
How Trek Bicycles Enhanced Its Operations Globally While Mitigating Payment F...
 
Blockchain Explained for Devlopers
Blockchain Explained for DevlopersBlockchain Explained for Devlopers
Blockchain Explained for Devlopers
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native Application
 
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...
apidays LIVE Singapore - Connecting clients, custodians and counterparties wi...
 
TransferWise - from Product to Platform
TransferWise - from Product to PlatformTransferWise - from Product to Platform
TransferWise - from Product to Platform
 
Programmable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on BlockchainProgrammable Money and Business Process Management on Blockchain
Programmable Money and Business Process Management on Blockchain
 
Developer Day Tech Session at QuickBooks Connect Sydney 2017
Developer Day Tech Session at QuickBooks Connect Sydney 2017Developer Day Tech Session at QuickBooks Connect Sydney 2017
Developer Day Tech Session at QuickBooks Connect Sydney 2017
 
Simply pay
Simply paySimply pay
Simply pay
 

Dernier

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Dernier (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

MuCon - Where’s my money gone?

  • 1. Where’s My Money Gone? Microservices in a Fin-Tech Business
  • 2. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 3. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 4. $ whoami • Thomas Badie • Software Engineer @ Landbay since January • Worked mainly in Advertising before • From Marseille, France • linkedin.com/in/thomasbadie 3
  • 6. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 7. In A Previous Life… • Advertising, 250M requests a day • Service Oriented Architecture • Each request has a very low value associated with it (<£0.01) • Communication over HTTP (behind a proper HTTPS gateway) • A server crashing would lose about ~250 requests • Consequences: • Monetary: ~£2.50 • Customer: Negligible 6
  • 8. Life at Landbay • Consequences in a similar scenario if similar setup: • Could lose money movements • Customer loses trust • A big mistake => Lose FCA license • Long story short: We cannot make any mistakes and environment failures are not acceptable 7
  • 9. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 10. Before Reaching Prod • Agile/Scrum • Design each ticket with at least one more person • Unit + Service testing (minimum coverage required for build to pass) • Code review • Continuous deployment • More about our overall infrastructure and pipelines with Chris on Tuesday at 2pm 9
  • 11. Ensuring That It Works As Intended • Monitoring (Dynatrace) • Alerting (Dynatrace, slack, email) • Reconciliation (Business side) • Reconciliation (tech side – across services) • Reconciliation (third parties) 10
  • 12. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 13. Model of our Money Transfers 12 Cash Balance Investment
  • 14. About Transactions (The Money Kind) • We store everything in pennies (+10000) • Each transaction represents a change to the account (+301.50000) • Concurrent inserts are fine but need to check for consistent grouped selects (locks) • We have several daily snapshots to prevent the system from slowing down over time and archive 13
  • 15. How Do We Ensure Resiliency? • Services are replicated and hosted in different availability zones • Database transaction • Event driven • RabbitMQ transactions (DB commit) • In case of failure, each event retries 5 times before going in a dead queue (requiring manual process from us) • Cluster of rabbits (colony?) in different AWS availability zones 14
  • 16. Conventions 15 Service (+ Implicit DB) Transaction Service fails HTTP MessageHTTP fails Transaction fails
  • 17. On The Way To Resiliency – Simple Case 16 API Gateway Cash Balance
  • 18. On The Way To Resiliency • HTTP, only call investment if Cash Balance worked • Obviously doesn’t work 17 API Gateway Cash Balance Investment
  • 19. On The Way To Resiliency • Distributed transaction Management • Open same transaction in multiple services simultaneously. • Hard to setup and maintain 18 API Gateway Cash Balance Investment
  • 20. On The Way To Resiliency • Cash Balance sends message to investment only if its transaction works 19 API Gateway Cash Balance Investment
  • 21. On The Way To Resiliency • API Gateway may send messages listened to by different services 20 Service 1 API Gateway Service 2
  • 22. On The Way To Resiliency - Downsides • The user may not immediately see the result of the operation he ran, e.g. Registration and AML checks • Require human intervention to recover • Need to keep transactions small, leading to code generating many concurrent transactions 21
  • 23. Overview • Introduction • How is working in Financial Services different? • General Processes • How did we achieve resiliency? • Case Studies • Conclusion 1
  • 24. Case Study 1 - Interest Payment Version 1 23 Investment Interest Calculation Cash Balance
  • 25. Case Study 1 - Interest Payment Version 1 • Triggered 1st of the month Cash Balance service receives the amounts that need to go to each account • Overall process estimated at a few hundred thousand messages • Lot of strain on network/platform • It was working, but wasn’t the most optimal 24
  • 26. Case Study 1 - Interest Payment Version 2 25 InterestInvestment Cash Balance
  • 27. Case Study 1 - Interest Payment Version 2 • Simpler and easier to maintain • Fewer (bigger) messages • In case of failure, we need to replay the whole message. Heavier DB transaction, but light on the whole infrastructure. • Use daily snapshots to figure out the amount to pay back 26
  • 28. Case Study 2 - Diversification 27 DiversificationInvestment
  • 29. Case Study 2 - Diversification • Preventing our investors from ever saying “Where is my money gone?!” is not only a tech problem • We want to diversify everybody’s investments as much as possible • An average investor is funding 25 loans • Built to accept failure: • Works off stale data. If it’s incorrect we ignore the transaction • Process runs at night, it’s unlikely that we will see many user generated transactions running in parallel • Runs every night, if we reached equilibrium, process does nothing 28
  • 30. In Case Of Emergency • Daily snapshots of DB • Messages can be sent by hand through the RabbitMQ UI • We have full audit of our messages stored in ElasticSearch (raw messages that can be replayed) • Each financial transaction represents a change, so we can always modify them (even though very risky) 29
  • 31. Conclusion • Lightweight processes to ensure quality • Transactions over messaging • Sometimes we can bubble up the error to the user using HTTP, but most of the time we work in the background • It is useful to be flexible (ignoring some errors, …) in order to achieve a simpler design 30
  • 32. We’re Hiring! • We’re recruiting… • Software Engineers with 2+ years experience • Scrum masters • Product owners • Email: • thomas.badie@landbay.co.uk •Any Questions? 31

Notes de l'éditeur

  1. User doesn’t choose the specific loan
  2. Losing our license = End of Landbay
  3. Monitoring: Webchecks
  4. Mention money only hosted in two services. Money is always somewhere (database or messaging)
  5. Fast inserts Using longs everywhere but for interest (account transaction)
  6. Dead message: Happens a few times a month, mostly due to deadlock in DB because too many messages happen at the same time.
  7. Mention API Gateway isn’t AWS product
  8. Hard to set the transaction up across services Think about how to roll back Performance
  9. Mention alerting, not dead message
  10. Upside: Safe and easy to parallelize Downside: Lot of strain on the platform/network
  11. Specify it works because of GET
  12. Passive investment Diverisify to mitigate risk.