Breaking down problems

Breaking down problems

When starting with microservice architectures a common question people ask is "how big should a service be?” While this is sometimes useful when considering the complexity of a system, it doesn’t capture the variety of use cases or problems systems may be solving — a service that selects emoji for push notifications will probably be simpler than one of the core services in a payment processor?

In this talk we’ll look at how Monzo approach problem solving, taking business ideas and breaking them down into small, simple, services which together build a system that is more than the sum of its parts.

67f4a8f2a209a38d7242829947b26ba3?s=128

mattheath

May 29, 2019
Tweet

Transcript

  1. Breaking down problems Building systems of systems with microservices at

    Monzo 
 @mattheath
  2. Hi, I’m Matt

  3. @mattheath

  4. None
  5. None
  6. 16:02 Wednesday 29 May

  7. Nov 2015 May 2019 Fastest growing UK Bank
 2m customers

    40k a week
  8. None
  9. None
  10. None
  11. None
  12. LICENCE WITH RESTRICTIONS WE ARE HERE A UK banking licence

    is authorised by the PRA and regulated by the PRA and FCA1, allowing deposit- taking and balance sheet lending. Once granted, it allows firms to passport across Europe, accessing This is followed by a “mobilisation” phase during which final capital is raised and IT systems are completed, before launching to the public. We received a UK banking licence in August 2016! FEB 2015 JAN 2016 JAN 2017 MAR FEB FEB APR MAR MAR APR MAY JUN JUL MAY APR JUN MAY JUL JUN AUG JUL SEP AUG NOV SEP DEC NOV DEC PRE APPLICATION APPLICATION MOBILISATION LAUNCH LICENCE WITH RESTRICTIONS 50K MAX DEPOSIT WE ARE HERE A UK banking licence is authorised by the PRA and regulated by the PRA and FCA1, allowing deposit- taking and balance sheet lending. Once granted, it allows firms to passport across Europe, accessing This is followed by a “mobilisation” phase during which final capital is raised and IT systems are completed, before launching to the public. We received a UK banking licence in August 2016! JAN 2016 JAN 2017 MAR FEB FEB APR MAR MAR APR MAY JUN JUL MAY APR JUN MAY JUL JUN AUG JUL SEP AUG NOV SEP DEC NOV DEC E APPLICATION APPLICATION MOBILISATION LAUNCH LICENCE WITH RESTRICTIONS WE ARE HERE AUG
 2016 JAN
 2016 Feb
 2015 APR
 2017 A UK banking licence is authorised by the PRA and regulated by the PRA and FCA1, allowing deposit- taking and balance sheet lending. Once granted, it allows firms to passport across Europe, accessing This is followed by a “mobilisation” phase during which final capital is raised and IT systems are completed, before launching to the public. We received a UK banking licence in August 2016! FEB 2015 JAN 2016 JAN 2017 MAR FEB FEB APR MAR MAR APR MAY APR JUN MAY JUL JUN AUG JUL SEP AUG NOV SEP DEC NOV DEC PRE APPLICATION APPLICATION MOBILISATION LICENCE WITH RESTRICTIONS WE ARE HERE
  13. Henrik Kniberg

  14. Henrik Kniberg

  15. James Leah Matt

  16. James Leah Matt

  17. James Leah Matt

  18. None
  19. None
  20. None
  21. None
  22. X X X

  23. None
  24. None
  25. None
  26. ☕☕

  27. ☕☕

  28. Payment API Ledger

  29. Payment API Ledger Database

  30. Transactions Payment API Ledger

  31. Transactions Payment API Ledger Accounts

  32. Payment API Transactions Ledger Accounts Cassandra Database

  33. Payment API Transactions Ledger Accounts Cassandra Database ? ? ?

    ? ? ? ? ? ?
  34. Henrik Kniberg

  35. None
  36. None
  37. None
  38. None
  39. None
  40. Payment API Transactions Ledger Accounts Cassandra Database

  41. Card API Payment API Transactions Ledger Accounts Cassandra Database

  42. IT’S REAL!

  43. None
  44. None
  45. None
  46. None
  47. None
  48. None
  49. None
  50. Feb 2015 May 2019 monzo services

  51. 1136 Feb 2015 May 2019 monzo services

  52. Why do we break down problems?

  53. None
  54. None
  55. None
  56. Why do we break down problems? Manage risk , Scale

    organisations Use the best tools for the job
  57. Why do we break down problems? Manage risk , Scale

    organisations Use the best tools for the job
  58. Managing risk ⚠ Are we building the right thing? ⚠

    Will we hit deadlines?
  59. Henrik Kniberg

  60. Guiding Principle: 
 Ship it, and iterate.

  61. Guiding Principle: 
 Make changes small, make them often

  62. Why do we break down problems? Manage risk Use the

    best tools for the job , Scale organisations
  63. Why do we break down problems? Manage risk Use the

    best tools for the job , Scale organisations
  64. How do we break down problems?

  65. Dividing features up

  66. Henrik Kniberg

  67. Split by domain

  68. Split by domain users transactions faster payments card payments cards

    accounts addresses profiles feature flags points pots direct debits
  69. Split by responsibility

  70. Split by responsibility card management customer
 signup clearing
 processing reconciliation

    pots accounts authentication authorisation bank
 statements message signing
  71. Guiding Principle: 
 Do one thing, do it well.

  72. Examples:
 Building APIs

  73. None
  74. None
  75. API

  76. API

  77. API Service API Service API Service API Service API Service

    API Service API Service API Service Edge Gateway
  78. None
  79. Accounts Cards Pots Feed Payments … Edge Gateway

  80. Edge Gateway Accounts Cards Pots Payments … New
 Exciting
 API!!

    Feed
  81. Cards Pots Payments … Accounts New
 Exciting
 API!! Feed Edge

    Gateway
  82. Cards Pots Payments … Accounts New
 Exciting
 API!! Feed Edge

    Gateway
  83. Edge Gateway Accounts Cards Pots Payments … New
 Exciting
 API!!

    Feed
  84. Isolate failure Make changes small, make them often Ship it,

    and iterate , Scale teams and organisations
  85. Single responsibility

  86. Load Balancer Edge Gateway

  87. Load Balancer Edge Gateway API Service

  88. Service A Load Balancer Edge Gateway API Service

  89. Service A Service B Load Balancer Edge Gateway API Service

  90. Service A Service B Load Balancer Edge Gateway API Service

    Responsible for external interface Responsible for domain logic Responsible for routing
  91. Manage complexity

  92. Account
 Service Load Balancer Edge Gateway Account
 API

  93. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service
  94. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service IBAN
 Service
  95. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service IBAN
 Service Account service responsibility remains unchanged, even as overall system complexity increases
  96. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service IBAN
 Service Additional, simple, services solve related but separate problems
  97. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service IBAN
 Service
  98. Account
 Service Load Balancer Edge Gateway Account
 API Account
 Number


    Service IBAN
 Service Euro
 Payment
 Services 5
  99. Account
 Service Account
 Number
 Service IBAN
 Service Euro
 Payment
 Services

    5 Decoupling more specialised behaviour keeps services simple 6
  100. Account
 Service Account
 Number
 Service IBAN
 Service Euro
 Payment
 Services

    5 Faster
 Payment
 Services 6
  101. Account
 Service Account
 Number
 Service IBAN
 Service Euro
 Payment
 Services

    5 Faster
 Payment
 Services 6
  102. Account
 Service Account
 Number
 Service IBAN
 Service Euro
 Payment
 Services

    5 Faster
 Payment
 Services 6 Isolating failure along domain boundaries improves availability
  103. Managing Complexity

  104. Guiding Principle: 
 Simplicity

  105. https://xkcd.com/927/

  106. Feb 2015 May 2019 monzo services

  107. Feb 2015 May 2019 monzo services The Refactathon https://monzo.com/blog/2018/12/04/refactoring-old-code/

  108. 8 Identify areas of complexity and debt ⏱ Make time

    to improve these Teams move faster as a result
  109. Guiding Principle: 
 Standardisation

  110. Build on abstractions

  111. instance instance instance instance instance instance

  112. instance instance instance instance instance instance Kubernetes

  113. kubernetes

  114. kubernetes service service service service service service service service service

    service service service service
  115. kubernetes service Prometheus service service Kafka envoy Kafka service service

    Elasticsearch calico API service
  116. Service Service Reliable inter-service
 communication offloaded to Envoy, simplifying services

  117. API Service Service A Service B Load Balancer Edge Gateway

    Service D Service D Service C Event based communication decouples services, lets us build reliable pipelines, and helps isolate failure
  118. Simple systems are more reliable Small systems are faster to

    iterate Failure can be isolated and constrained
  119. Standardisation makes everything easier Onboard new people quickly People feel

    empowered and productive Build reliable systems, faster.
  120. None
  121. monzo.com/careers