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

Microservices snakes and ladders

Microservices snakes and ladders

Microservices aren’t new but the last few years have certainly seen a lot of successful implementations of the pattern. The promise of high scalability has attracted engineering teams to it like moths to a flame. There are plethora of benefits but they are accompanied by an ever growing set of technical and nontechnical pitfalls. As the shininess of microservices gradually decline, there are important lessons to learn from our scars. We will look at why microservices implementation fail, How to avoid the pitfalls and most importantly whether you need to ditch your trusty monolith after all.

Dasith Wijesiriwardena

September 06, 2019
Tweet

More Decks by Dasith Wijesiriwardena

Other Decks in Programming

Transcript

  1. 01 Agenda Beyond The Marketing Pitch Microservices aren’t new Data

    & Bounded Contexts Ownership is just the beginning Eventually Consistent Immediately painful Hidden Complexity A modern Trojan horse 05 06 03 02 Organisational Challenges Clapping with one hand Talk Over The Wire to Me REST, GraphQL, gRPC or event driven? 04
  2. Do You Need Microservices? •Do you have a modular monolith?

    •Is the domain well understood? •Are you doing it for scalability advantages?
  3. Do You Need Microservices? •Do you have a modular monolith?

    •Is the domain well understood? •Are you doing it for scalability advantages?
  4. Do You Need Microservices? •Do you have a modular monolith?

    •Is the domain well understood? •Are you doing it for scalability advantages?
  5. Do You Need Microservices? •Do you have a modular monolith?

    •Is the domain well understood? •Are you doing it for scalability advantages?
  6. Messaging mechanism by which OBJECTS DISTRIBUTED over a network, can

    COMMUNICATE with each other Common Object Request Broker Architecture (CORBA)
  7. Same Old New Thing • 1958 – LISP Atoms •

    1960 – Object Oriented Programming • 1970 – Small Talk • 1973 – Actor Model • 1991 – CORBA • SOA ?
  8. Conway's Law Organizations which design systems ... are constrained to

    produce designs which are copies of the communication structures of these organizations
  9. • Think vertical, not horizontal • Security? DevOps? Performance? •

    Own your outcomes • Direct communication with stake holders Cross Functional Teams
  10. • Think vertical, not horizontal • Security? DevOps? Performance? •

    Own your outcomes • Direct communication with stake holders Functional DevOps Development QA Cross Functional Teams
  11. • Think vertical, not horizontal • Security? DevOps? Performance? •

    Own your outcomes • Direct communication with stake holders Functional DevOps Development QA Cross Functional Teams
  12. • Think vertical, not horizontal • Security? DevOps? Performance? •

    Own your outcomes • Direct communication with stake holders Cross Functional Teams
  13. Cross Functional Teams • Think vertical, not horizontal • Security?

    DevOps? Performance? • Own your outcomes • Direct communication with stake holders
  14. Ownership Better: • Owned data store • External access via

    interface Machines Customers Suppliers Scalability
  15. Ownership Best: Clear ownership of its own world view (bounded

    context) Scalability, Agility, Team Autonomy
  16. REST • Simple • Suitable for CRUD • Domain comes

    first • OpenAPI (Swagger) ⟹ Great fit for public facing interface
  17. gRPC : Universal RPC framework • HTTP/2 and Protobuf •

    Suitable for actions heavy APIs • Contract unlikely to change? Good! • Few well known clients? Great! • Polyglot environment? Great!
  18. But, Also Think About… •Tightly coupled external dependencies •Owning your

    SLA •If (when) dependencies fail? • Retrying, Circuit Breaker etc.
  19. But, Also Think About… •Tightly coupled external dependencies •Owning your

    SLA •If (when) dependencies fail? • Retrying, Circuit Breaker etc.
  20. Race Conditions • Don’t try to prevent • Compensate instead

    https://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.html Gregor Hohpe
  21. Race Conditions • Look to the real world • Dig

    deeper into the domain http://udidahan.com/2010/08/31/race-conditions-dont-exist/
  22. Distributed Monolith • You’ve distributed the logic of your monolith?

    That was the plan. • But they can’t function without each other? Bad!
  23. Cross Cutting Concerns • Service Discovery • Load Balancing •Circuit

    Breaker, Retry etc • Dynamic Routing •Security & Access Control • Monitoring & Tracing
  24. Let’s Revisit •Do you have a modular monolith? •Is the

    domain well understood? •Are you doing it for scalability advantages?
  25. Let’s Revisit •Do you have a modular monolith? •Is the

    domain well understood? •Are you doing it for scalability advantages?
  26. Let’s Revisit •Do you have a modular monolith? •Is the

    domain well understood? •Are you doing it for scalability advantages?
  27. Let’s Revisit •Do you have a modular monolith? •Is the

    domain well understood? •Are you doing it for scalability advantages?
  28. Thank You! Do you have any questions? J O H

    N S H O W E E T P R E S E N T A T I O N E X P E R T @dasiths dasith.me