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

The Rise of Reactive Microservices

The Rise of Reactive Microservices

CodeCrafts Vienna 2022 — www.code-crafts.com

SQUER Solutions

May 18, 2022
Tweet

More Decks by SQUER Solutions

Other Decks in Technology

Transcript

  1. The Rise of Reactive
    Microservices
    @duffleit
    Vienna 2022

    View Slide

  2. David Leitner
    @duffleit
    Coding Architect
    [email protected]
    🐥 @duffleit

    View Slide

  3. Reactivity
    @duffleit
    and many more.
    “ Programming with, or designing upon,
    asynchronous data streams.

    View Slide

  4. It's about
    Streams.
    @duffleit

    View Slide

  5. @duffleit

    View Slide

  6. “ streams are just another data structure.
    @duffleit
    Time
    Space
    Value
    Getter Setter
    Collections
    Iterators Generators
    Promise
    Deferred Resolver
    Stream
    Subscriber Emitter

    View Slide

  7. “ streams are just another data structure.
    @duffleit

    View Slide

  8. @duffleit
    What has this to do
    with reactivity?
    🤔
    “ Programming with, or designing upon,
    asynchronous data streams.

    View Slide

  9. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    1
    2

    View Slide

  10. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    assert(doubled, 4);
    1
    2
    3
    4

    View Slide

  11. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    // updating the counter
    counter = 3;
    1
    2
    3
    4
    5

    View Slide

  12. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    // updating the counter
    counter = 3;
    assert(doubled, 6)
    1
    2
    3
    4
    5
    6
    7
    💔

    View Slide

  13. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    // updating the counter
    counter = 3;
    doubled = counter * 2;
    1
    2
    3
    4
    5
    6

    View Slide

  14. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    // updating the counter
    counter = 3;
    doubled = counter * 2;
    assert(doubled, 6)
    1
    2
    3
    4
    5
    6
    7
    8

    View Slide

  15. @duffleit
    var counter = 2;
    var doubled = counter * 2;
    // updating the counter
    counter = 3;
    doubled = counter * 2;
    assert(doubled, 6)
    1
    2
    3
    4
    5
    6
    7
    8

    doubled
    🔗
    counter
    paulstovell.com/reactive-programming/

    View Slide

  16. @duffleit
    var counter = 2;
    var doubled <= counter * 2;
    1
    2
    doubled
    🔗
    counter
    👆

    View Slide

  17. @duffleit
    var counter = 2;
    var doubled <= counter * 2;
    // updating the counter
    counter = 3;
    1
    2
    3
    4
    5
    doubled
    🔗
    counter

    View Slide

  18. @duffleit
    var counter = 2;
    var doubled <= counter * 2;
    // updating the counter
    counter = 3;
    assert(doubled, 6)
    1
    2
    3
    4
    5
    6
    7
    doubled
    🔗
    counter

    View Slide

  19. @duffleit
    var counter = stream(2);
    1
    🔗
    = streams
    👈 counter: [2]

    View Slide

  20. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    1
    2
    👈 counter: [2]

    View Slide

  21. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    1
    2
    🔗
    = streams
    👆
    counter: [2]

    View Slide

  22. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    1
    2 👆
    counter: [2]
    doubled: [4]

    View Slide

  23. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    1
    2
    “ we project the data from our counter stream into
    our doubled stream.
    👆
    counter: [2]
    doubled: [4]

    View Slide

  24. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    // updating the counter
    1
    2
    3
    4
    👈
    counter: [2]
    doubled: [4]

    View Slide

  25. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    // updating the counter
    counter.emit(3);
    1
    2
    3
    4
    5
    👈
    counter: [2]
    doubled: [4]

    View Slide

  26. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    // updating the counter
    counter.emit(3);
    1
    2
    3
    4
    5
    counter: [2, 3]
    doubled: [4]
    👈

    View Slide

  27. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    // updating the counter
    counter.emit(3);
    1
    2
    3
    4
    5
    counter: [2, 3]
    doubled: [4, 6]
    👈

    View Slide

  28. @duffleit
    var counter = stream(2);
    var doubled = counter.map(x -> x * 2)
    // updating the counter
    counter.emit(3);
    assert(doubled.value, 6)
    1
    2
    3
    4
    5
    6
    7
    👈
    counter: [2, 3]
    doubled: [4, 6]

    View Slide

  29. @duffleit

    View Slide

  30. @duffleit
    var counter = new BehaviorSubject(2);
    1
    👈

    View Slide

  31. @duffleit
    var counter = new BehaviorSubject(2);
    var doubled = counter.pipe(map(x -> x * 2));
    1
    2
    👈

    View Slide

  32. @duffleit
    var counter = new BehaviorSubject(2);
    var doubled = counter.pipe(map(x -> x * 2));
    // updating the counter
    counter.emit(3);
    1
    2
    3
    4
    5
    👈

    View Slide

  33. @duffleit
    var counter = new BehaviorSubject(2);
    var doubled = counter.pipe(map(x -> x * 2));
    // updating the counter
    counter.emit(3);
    assert(doubled.value, 6);
    1
    2
    3
    4
    5
    6
    7
    👈 ✅

    View Slide

  34. @duffleit

    View Slide

  35. @duffleit
    var counter = 2;
    1
    👈

    View Slide

  36. @duffleit
    var counter = 2;
    $: doubled = counter * 2;
    1
    2
    👈

    View Slide

  37. @duffleit
    var counter = 2;
    $: doubled = counter * 2;
    1
    2
    👈

    View Slide

  38. @duffleit
    var counter = 2;
    $: doubled = counter * 2;
    // updating the counter
    counter = 3;
    1
    2
    3
    4
    5
    👈

    View Slide

  39. @duffleit
    var counter = 2;
    $: doubled = counter * 2;
    // updating the counter
    counter = 3;
    assert(doubled, 6);
    1
    2
    3
    4
    5
    6
    7
    👈 ✅

    View Slide

  40. “ Programming with,
    or designing upon,
    asynchronous data
    streams.
    @duffleit

    View Slide

  41. @duffleit
    We can apply those
    Concepts of Reactive Programming
    on Architecture as well.
    * and hope they still make sense.

    View Slide

  42. @duffleit
    User

    Account

    Legder

    WebBanking
    New Payment
    💸
    Perform Payment
    € 20, 00
    👧
    Lisa
    to
    David
    from
    transferMoney
    triggerPayment
    createTransactions

    View Slide

  43. @duffleit
    User

    Account

    Legder

    WebBanking
    Your payment was
    successfully executed.
    transferMoney
    triggerPayment
    createTransactions

    View Slide

  44. @duffleit
    User

    Account

    Legder

    WebBanking
    New Payment
    💸
    Perform Payment
    € 20, 00
    👧
    Lisa
    to
    David
    from
    transferMoney
    triggerPayment
    createTransactions
    Legder
    Legder

    View Slide

  45. @duffleit
    User

    Account

    Legder

    WebBanking
    Your payment was
    successfully executed.
    transferMoney
    triggerPayment
    createTransactions

    Retries
    Timeouts
    Circuit Breakers
    Synchronise

    View Slide

  46. First Generation of MicroServices
    Synchronously Integrated
    @duffleit

    View Slide

  47. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment

    Legder

    View Slide

  48. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment

    Legder

    View Slide

  49. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Queue

    Legder

    View Slide

  50. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Queue

    Legder

    View Slide

  51. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Queue

    Legder

    View Slide

  52. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Queue

    Legder

    View Slide

  53. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Queue

    Legder

    View Slide

  54. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions Queue

    Legder
    Your payment was
    accepted.

    View Slide

  55. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions Queue

    Legder
    Your payment was
    accepted.

    Legder

    View Slide

  56. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions Queue

    Legder
    Your payment was
    accepted.

    Legder

    View Slide

  57. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions Queue

    Legder
    Your payment was
    accepted.

    Legder

    Queue

    View Slide

  58. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions Queue

    Legder
    Your payment was
    accepted.

    Legder

    Queue
    Queue

    View Slide

  59. Second Generation of MicroServices
    Asynchronously Integrated
    @duffleit

    View Slide

  60. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Queue
    Queue
    Queue

    View Slide

  61. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Queue
    Queue
    Queue
    As a Customer, I want my
    transaction to be booked
    by the ledger.

    View Slide

  62. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Queue
    Queue
    Queue
    As a Customer, I want the
    account service to update
    my balance.

    View Slide

  63. @duffleit
    User

    Account

    WebBanking
    transferMoney
    triggerPayment
    createTransactions
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Queue
    Queue
    Queue
    As a Customer, I want
    to transfer money to
    someone else.

    View Slide

  64. The Entity Service
    Antipattern.
    @duffleit

    View Slide

  65. Let's create Services along
    Customer Journeys.
    @duffleit

    View Slide

  66. @duffleit
    “ On the Criteria To Be Used in
    Decomposing Systems into Modules
    — Parnas, 1972

    View Slide

  67. Let's create Services along
    Customer Journeys.
    @duffleit

    View Slide

  68. @duffleit
    User

    Account

    WebBanking
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Payments

    Domain Services
    Journey Services
    As a Customer, I want
    to transfer money to
    someone else.

    View Slide

  69. @duffleit
    User

    Account

    WebBanking
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Web-BFF

    Domain Services
    Backend For Frontends
    As a Customer, I want
    to transfer money to
    someone else.
    Mobile-BFF

    Mobile Banking
    € 20, 00
    Pay
    Payment Flow
    Payment Flow

    View Slide

  70. @duffleit
    No Domain Logic in
    Backend For Frontends.
    It's about Ui-Specific Aggregation, to get rid
    of over-fetching and over-requesting.

    View Slide

  71. @duffleit
    Ok, but back to the problem
    with our Customer Journeys.

    View Slide

  72. @duffleit
    User

    Account

    WebBanking
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Payments

    Domain Services
    Journey Services

    View Slide

  73. @duffleit
    User

    Account

    WebBanking
    New Payment
    💸
    € 20, 00
    👧
    Lisa
    to
    David
    from
    Perform Payment
    Legder

    Payments

    Domain Services
    Journey Services
    Balance

    View Slide

  74. @duffleit

    Customer Journey and Entity Data
    Mismatch Problem

    View Slide

  75. @duffleit
    Users Accounts Transactions
    Entities
    Customer Journeys
    Payments
    Onboarding
    Fraud Detection

    View Slide

  76. @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

    View Slide

  77. @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

    ⚡ ⚡

    View Slide

  78. @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

    View Slide

  79. @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

    View Slide

  80. @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
    🤯

    View Slide

  81. @duffleit
    clarify who owns which Data.
    Always

    View Slide

  82. @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

    View Slide

  83. @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
    😔

    View Slide

  84. @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
    😔

    View Slide

  85. @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
    😔

    View Slide

  86. @duffleit
    “ we project data from our counter variable into our
    doubled variable.
    There must be a better solution
    🤔

    View Slide

  87. @duffleit
    “ we project the data from our onboarding service
    into our payments service.
    There must be a better solution
    🤔
    Payments
    User
    Onboarding
    User
    project

    View Slide

  88. @duffleit
    Payments
    Onboarding
    User Aggregate User Readmodel
    UserChangedEvent
    UserChange
    Command
    That's CQRS in a nutshell
    🥜
    updates

    View Slide

  89. @duffleit
    Payments
    Onboarding
    User Aggregate User Readmodel
    UserChangedEvent
    UserChange
    Command
    Stream

    View Slide

  90. @duffleit
    Payments
    Onboarding
    User Aggregate User Readmodel
    UserChange
    Command
    Stream
    UserChangedEvent
    transform
    apply

    View Slide

  91. @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

    View Slide

  92. @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

    View Slide

  93. @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

    View Slide

  94. @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

    View Slide

  95. @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

    View Slide

  96. @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

    View Slide

  97. @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

    View Slide

  98. @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

    View Slide

  99. @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

    View Slide

  100. @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

    View Slide

  101. @duffleit
    But bro, didn't we just introduce
    Eventual Consistency?

    View Slide

  102. @duffleit
    Eventual Consistency
    Eventual Divergence
    Dashboard
    User (age: 22)
    UserChanged (age: 21)
    UserChanged (age: 22)
    Profile
    User (age: 21)

    timestamp
    timestamp

    View Slide

  103. @duffleit
    Eventual Consistency
    Eventual Divergence
    Eventual Variance
    Ledger
    Stream
    Transaction (+10€)
    🔥

    View Slide

  104. @duffleit
    Eventual Consistency
    Eventual Divergence
    Eventual Variance
    Ledger
    Dashboard
    Stream
    🔥 Transaction (+10€) Transaction (+10€)
    Balance: 20€

    View Slide

  105. @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)

    View Slide

  106. 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)
    🕰

    View Slide

  107. @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

    View Slide

  108. @duffleit
    tl/dr:
    Eventual Consistency is
    often used as a
    knock-out argument
    but isn't, in most cases.

    View Slide

  109. @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

    View Slide

  110. @duffleit
    Mobile Banking Usage
    93% — Show balance & last transactions
    3% — Initiate new payment
    4% — Any other functionality

    View Slide

  111. @duffleit
    Payments
    Journey Services
    Onboarding Overview
    User
    Account
    Account
    Transactions
    User
    Account
    Transactions
    Stream

    View Slide

  112. @duffleit
    Payments
    Journey Services
    Onboarding Overview
    User
    Account
    Account
    Transactions
    User
    Account
    Transactions
    Stream

    View Slide

  113. @duffleit
    Payments
    Journey Services
    Onboarding Overview
    User
    Account
    Account
    Transactions
    User
    Account
    Transactions
    Stream

    View Slide

  114. @duffleit
    Payments
    Journey Services
    Onboarding Overview
    User
    Account
    Account
    Transactions
    User
    Account
    Transactions
    Stream

    View Slide

  115. @duffleit
    Payments
    Journey Services
    Onboarding Overview
    User
    Account
    Account
    Transactions
    User
    Account
    Transactions
    Stream

    View Slide

  116. @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€

    View Slide

  117. @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.

    View Slide

  118. @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.

    View Slide

  119. @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

    View Slide

  120. @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

    View Slide

  121. @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

    View Slide

  122. @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

    View Slide

  123. @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

    View Slide

  124. @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

    View Slide

  125. @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

    View Slide

  126. @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€

    View Slide

  127. @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€

    View Slide

  128. @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.

    View Slide

  129. @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

    View Slide

  130. Third Generation of MicroServices
    Fully Reactive
    @duffleit
    High Resilience
    🔥
    Horizontal Scaling ↔
    Real Time Integration

    Good Integration with Legacy Systems
    🏚

    View Slide

  131. Dimensions of Scaling
    @duffleit
    Vertical
    Horizontal
    Service

    View Slide

  132. Dimensions of Scaling
    @duffleit
    Vertical
    Horizontal
    Service

    View Slide

  133. Dimensions of Scaling
    Vertical
    Horizontal
    Service Service Service
    Sharding

    View Slide

  134. Dimensions of Scaling
    Vertical
    Horizontal
    Service
    Service
    Service
    Sharding
    Users A-H
    Users I-P
    Users Q-Z

    View Slide

  135. Dimensions of Scaling
    Vertical
    Horizontal
    Service
    Service
    Service
    User from
    User from
    Users from
    Service Service
    Service
    Sharding

    View Slide

  136. @duffleit
    Stream
    UserTriggeredPayment Partition 0 Partition 1 Partition 2
    UserTriggeredPayment

    View Slide

  137. @duffleit
    Stream
    UserTriggeredPayment Partition 0 Partition 1 Partition 2
    UserTriggeredPayment

    View Slide

  138. @duffleit
    Stream
    UserTriggeredPayment Partition 0 Partition 1 Partition 2
    UserTriggeredPayment
    Payments Payments Payments

    View Slide

  139. @duffleit
    Stream
    UserTriggeredPayment Partition 0 Partition 1 Partition 2
    UserTriggeredPayment
    Payments Payments Payments
    ValidPaymentReceived

    View Slide

  140. @duffleit
    Stream
    UserTriggeredPayment Partition 0 Partition 1 Partition 2
    UserTriggeredPayment
    Payments Payments Payments
    Stream
    ValidPaymentReceived
    Partition 0 Partition 1 Partition 2

    View Slide

  141. 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

    View Slide

  142. 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

    View Slide

  143. 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

    View Slide

  144. 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
    Project
    Transactions
    Streams
    Flink

    View Slide

  145. 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
    Project
    Transactions
    Shard 0 Shard 1 Shard 2
    DataSink
    WebBanking
    Current Balance: 200€
    👧
    You sent Lisa 100€
    Christoph sent you 300€
    Streams
    Flink

    View Slide

  146. 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
    Project
    Transactions
    WebBanking
    Current Balance: 200€
    👧
    You sent Lisa 100€
    Christoph sent you 300€
    Shard 0 Shard 1 Shard 2
    DataSink
    Streams
    Flink

    View Slide

  147. 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
    Project
    Transactions
    WebBanking
    Current Balance: 200€
    👧
    You sent Lisa 100€
    Christoph sent you 300€
    Shard 0 Shard 1 Shard 2
    DataSink
    🚀 We can scale
    nearly unlimited.

    View Slide

  148. Forth Generation of MicroServices
    Stream Based
    @duffleit
    Massive Throughput
    🚀
    Extremely Scalable ↔

    View Slide

  149. So many choices,
    Lets sum up.
    @duffleit

    View Slide

  150. Monolith
    @duffleit

    View Slide

  151. Monolith
    @duffleit

    View Slide

  152. Syncronously
    😩 Pain
    @duffleit

    View Slide

  153. Modulith
    @duffleit

    View Slide

  154. Asyncronously
    📦 Shared Data
    @duffleit

    View Slide

  155. Reactive
    ⚡ From Pull to Push
    @duffleit

    View Slide

  156. Streaming Massiv Throughput
    🚀
    @duffleit

    View Slide

  157. Monolith Reactive
    Push-Based
    Async
    Pull-Based
    Streamed
    Availability
    🟢
    , Resilience
    🦺
    , Scalability ↔ , Throughput
    🚀
    Complexity
    💰
    @duffleit

    View Slide

  158. Monolith Reactive
    Push-Based
    Async
    Pull-Based
    Streamed
    @duffleit
    The Rise of Reactive Microservices.
    And the future of fully Stream Based Architectures.

    View Slide

  159. David Leitner
    @duffleit
    Coding Architect
    [email protected]
    🐥 @duffleit

    View Slide

  160. squer.link /
    slicing-microservices

    View Slide