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

The 7 Deadly Sins of Microservices

The 7 Deadly Sins of Microservices

Spring eXchange 2014
Microservices Anti-patterns

Tareq Abedrabbo

November 07, 2014
Tweet

More Decks by Tareq Abedrabbo

Other Decks in Programming

Transcript

  1. About me • CTO at OpenCredo • Spring user since

    1.0 • Previously committer on Spring-WS!
  2. Microservices Design Principles Tools Decoupling Separation of concerns Encapsulation Engineering

    Practices Spring Boot RabbitMQ Hystrix Automation Scalability Fault-tolerance Continuous Delivery Testing Dropwizard Config Management
  3. • What languages do I need to support? • What

    libraries? • How dynamic and flexible does my implementation need to be?
  4. • Raison d’être of a any service! • The simplest

    form of composition is simple client invocation • A service can be composed in increasingly sophisticated ways, potentially leading to reuse
  5. • Microservices commonly use http or lightweight messaging to communicate

    • Messages can be binary (Protobuf, serialised objects, etc..) or human-readable (json, yaml, etc…) • Interfaces can be ReSTful, RPC-like, etc…
  6. • Designing a shared domain model is common in a

    monolithic architecture - it is even a “best practice” • A domain object model is used • to drive business logic • to map business entities to the database • to manage input & output
  7. A shared domain model assumes that we are in full

    control the context and the boundaries within which the domain model is valid
  8. • This is not the case for microservices • A

    shared domain model breaks encapsulation and introduces tight coupling between services: • Conceptually • At the implementation level by making a number of services dependant on common binary artefacts that are frequently changing
  9. The domain in a microservices system should be defined by

    how services interact with each other, not how they are implemented
  10. • Internal application services often have the wrong granularity •

    They can have interdependencies • …or a dependency on a shared domain
  11. The result is an application that is monolithic but that

    needs to deal with issues related to remote objects as well
  12. • For a microservices implementation to be effective we need:

    • the ability to update, deploy and scale each service individually • while keeping services as simple as possible
  13. • Testing services individually is not that hard • What

    is hard • Functional testing • Regression testing • Performance testing • Testing for failure
  14. A continuous delivery pipeline should be an integral part of

    a microservices implementation, form the very start
  15. • Developers need to have good understanding of a number

    of essential concepts, including • Messaging • Fault-tolerance and resilience • Scalability • Integration concerns • And potentially learn a number of new technologies and tools
  16. –Melvin Conway “organisations which design systems […] are constrained to

    produce designs which are copies of the communication structures of these organisations.”
  17. An obvious corollary to Conway’s law: organisations that operate in

    silos will not be able to benefit from a microservices architecture