Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Rise of Reactive Microservices

SQUER Solutions
June 15, 2022
240

The Rise of Reactive Microservices

WeAreDevelopers — Berlin

SQUER Solutions

June 15, 2022
Tweet

Transcript

  1. @duffleit User <μService> Account <μService> Legder <μService> WebBanking New Payment

    💸 Perform Payment € 20, 00 👧 Lisa to David from transferMoney triggerPayment createTransactions
  2. @duffleit User <μService> Account <μService> Legder <μService> WebBanking Your payment

    was successfully executed. transferMoney triggerPayment createTransactions ✅
  3. @duffleit User <μService> Account <μService> Legder <μService> WebBanking New Payment

    💸 Perform Payment € 20, 00 👧 Lisa to David from transferMoney triggerPayment createTransactions <μService> Legder Legder <μService>
  4. @duffleit User <μService> Account <μService> Legder <μService> WebBanking Your payment

    was successfully executed. transferMoney triggerPayment createTransactions ✅ Retries Timeouts Circuit Breakers Synchronise
  5. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment New Payment

    💸 € 20, 00 👧 Lisa to David from Perform Payment <μService> Legder
  6. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment New Payment

    💸 € 20, 00 👧 Lisa to David from Perform Payment <μService> Legder
  7. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Queue <μService> Legder
  8. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Queue <μService> Legder
  9. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Queue <μService> Legder
  10. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Queue <μService> Legder
  11. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Queue <μService> Legder
  12. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions Queue

    <μService> Legder Your payment was accepted. ✅ Legder <μService> Queue
  13. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions Queue

    <μService> Legder Your payment was accepted. ✅ Legder <μService> Queue Queue
  14. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Legder <μService> Queue Queue Queue
  15. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Legder <μService> Queue Queue Queue As a Customer, I want my transaction to be booked by the ledger.
  16. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Legder <μService> Queue Queue Queue As a Customer, I want the account service to update my balance.
  17. @duffleit User <μService> Account <μService> WebBanking transferMoney triggerPayment createTransactions New

    Payment 💸 € 20, 00 👧 Lisa to David from Perform Payment Legder <μService> Queue Queue Queue As a Customer, I want to transfer money to someone else.
  18. @duffleit “ On the Criteria To Be Used in Decomposing

    Systems into Modules — Parnas, 1972
  19. @duffleit User <μService> Account <μService> WebBanking New Payment 💸 €

    20, 00 👧 Lisa to David from Perform Payment Legder <μService> Payments <μService> Domain Services Journey Services As a Customer, I want to transfer money to someone else.
  20. @duffleit User <μService> Account <μService> WebBanking New Payment 💸 €

    20, 00 👧 Lisa to David from Perform Payment Legder <μService> Web-BFF <μService> Domain Services Backend For Frontends As a Customer, I want to transfer money to someone else. Mobile-BFF <μService> Mobile Banking € 20, 00 Pay Payment Flow Payment Flow
  21. @duffleit No Domain Logic in Backend For Frontends. It's about

    Ui-Specific Aggregation, to get rid of over-fetching and over-requesting.
  22. @duffleit User <μService> Account <μService> WebBanking New Payment 💸 €

    20, 00 👧 Lisa to David from Perform Payment Legder <μService> Payments <μService> Domain Services Journey Services
  23. @duffleit User <μService> Account <μService> WebBanking New Payment 💸 €

    20, 00 👧 Lisa to David from Perform Payment Legder <μService> Payments <μService> Domain Services Journey Services Balance <μService>
  24. @duffleit User Account WebBanking New Payment 💸 € 20, 00

    👧 Lisa to David from Perform Payment Transactions Payments Domain Services Journey Services Onboarding Fraud Detection User Account Account Transactions
  25. @duffleit User Account WebBanking New Payment 💸 € 20, 00

    👧 Lisa to David from Perform Payment Transactions Payments Domain Services Journey Services Onboarding Fraud Detection User Account Account Transactions ⚡ ⚡ ⚡
  26. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Service Autnomy
  27. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Data Duplication ⚡
  28. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Data Syncronisation 🤯 ⚡
  29. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions
  30. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Synchronous Calls 😔
  31. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Synchronous Calls 😔
  32. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Cache Account Transactions Synchronous Calls 😔
  33. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream
  34. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream
  35. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream
  36. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream
  37. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  38. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  39. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  40. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  41. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream
  42. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  43. @duffleit Eventual Consistency Eventual Divergence Dashboard User (age: 22) UserChanged

    (age: 21) UserChanged (age: 22) Profile User (age: 21) ⚡ timestamp timestamp
  44. @duffleit Eventual Consistency Eventual Divergence Eventual Variance Ledger Dashboard Stream

    🔥 Transaction (+10€) Transaction (+10€) Balance: 20€
  45. @duffleit Eventual Consistency Eventual Divergence Eventual Variance Eventual Latency Service

    B Stream UserChanged (age: 21) UserChanged (age: 22) Profile User (age: 21) Dashboard User (age: 21) User (age: 22)
  46. Single User Context @duffleit Eventual Consistency Eventual Divergence Eventual Variance

    Eventual Latency Service B Stream UserChanged (age: 21) UserChanged (age: 22) Profile User (age: 21) Dashboard User (age: 21) User (age: 22) 🕰
  47. @duffleit Eventual Consistency Eventual Divergence Eventual Variance Eventual Latency same

    events, different results. same events, different quantity. same events, different realisation. Ordering Guarantees Optimistic UIs At-Least-Once Delivery Deduplication Mechanisms
  48. @duffleit tl/dr: Eventual Consistency is often used as a knock-out

    argument but isn't, in most cases. @duffleit
  49. @duffleit WebBanking New Payment 💸 € 20, 00 👧 Lisa

    to David from Perform Payment Payments Journey Services Onboarding Fraud Detection User Account Account Transactions User Account Transactions Stream Projections
  50. @duffleit Mobile Banking Usage 93% — Show balance & last

    transactions 3% — Initiate new payment 4% — Any other functionality
  51. @duffleit Payments Journey Services Onboarding Overview User Account Account Transactions

    User Account Transactions Stream 93% of what our users need can still be performed. WebBanking Current Balance: 200€ 👧 You sent Lisa 100€ Christoph sent you 300€
  52. @duffleit WebBanking Current Balance: 200€ 👧 You sent Lisa 100€

    Christoph sent you 300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream Overview Transactions We can easily scale horizontally.
  53. @duffleit WebBanking Current Balance: 200€ 👧 You sent Lisa 100€

    Christoph sent you 300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream Overview Transactions We can easily scale horizontally.
  54. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  55. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  56. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  57. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  58. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  59. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  60. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment
  61. @duffleit WebBanking of David Current Balance: 300€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment 👧 Lisa sent you 20€
  62. @duffleit WebBanking of David Current Balance: 320€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment 👧 Lisa sent you 20€
  63. @duffleit WebBanking of David Current Balance: 320€ Christoph sent you

    300€ Payments Journey Services Onboarding Overview User Account Transactions User Account Transactions Stream WebBanking of Lisa 👧 New Payment 💸 € 20, 00 David to 👧 Lisa from Perform Payment 👧 Lisa sent you 20€ GraphQL subscriptions mutations Out-of-the-box real-time capabilities.
  64. @duffleit WebBanking of David Current Balance: 320€ Christoph sent you

    300€ Payments Journey Services Legacy System Accounts Stream 👧 Lisa sent you 20€ User 😮 💨😮 💨 😮 💨 Change Data Capture (CDC) User User
  65. Third Generation of MicroServices Built on Reactive Data-Streams @duffleit High

    Resilience 🔥 Horizontal Scaling ↔ Real Time Integration ⏱ Good Integration with Legacy Systems 🏚
  66. Dimensions of Scaling Vertical Horizontal Service Service' Service'' User from

    User from Users from Service Service Service Sharding
  67. @duffleit Stream UserTriggeredPayment Partition 0 Partition 1 Partition 2 UserTriggeredPayment

    Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2
  68. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection PaymentCheckedAgainstFraud
  69. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2
  70. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger TransactionBooked
  71. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger Partition 0 Partition 1 Partition 2 Stream TransactionBooked
  72. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger Partition 0 Partition 1 Partition 2 Projecting Transactions Streams Flink Stream PaymentChecked Stream TransactionBooked Independent Shards
  73. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger Partition 0 Partition 1 Partition 2 Stream TransactionBooked Shard 0 Shard 1 Shard 2 DataSink Streams Flink Projecting Transactions WebBanking WebBanking WebBanking
  74. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger Partition 0 Partition 1 Partition 2 Stream TransactionBooked Shard 0 Shard 1 Shard 2 DataSink Streams Flink Projecting Transactions WebBanking WebBanking WebBanking
  75. Fraud Detection Fraud Detection @duffleit Stream UserTriggeredPayment Partition 0 Partition

    1 Partition 2 UserTriggeredPayment Payments Payments Payments Stream ValidPaymentReceived Partition 0 Partition 1 Partition 2 Fraud Detection Stream PaymentChecked Partition 0 Partition 1 Partition 2 Ledger Ledger Ledger Partition 0 Partition 1 Partition 2 Stream TransactionBooked Shard 0 Shard 1 Shard 2 DataSink 🚀 We can scale nearly unlimited. Projecting Transactions WebBanking WebBanking WebBanking
  76. Forth Generation of MicroServices Shared and fully Stream Based @duffleit

    Massive Throughput 🚀 Extremely Scalable ↔
  77. Monolith Reactive Push-Based Async Pull-Based Streamed Availability 🟢 , Resilience

    🦺 , Scalability ↔ , Throughput 🚀 Complexity 💰 @duffleit The Rise of Reactive Microservices. And the future of fully Stream Based Architectures.