I’ve been interested in Domain Driven Design and Service Oriented Architecture for a long time now, so the micro-services movement is something I am keenly following. That being said I recently came across an interesting talk by Daniel Bryant of OpenCredo entitled The Seven Deadly Sins of Microservices.

The talk is a series of anti-patterns often used in Microservices and consist of the following:

  1. Lust – the small size of micro-services allows different teams to different technologies. The right tool for the job, however as developers we are like magpies and are generally attracted to the newest, shiniest tech and want to implement it immediately.
  2. Gluttony – excessive use of communication protocols. Ideally you should standardise to one synchronous and one asynchronous protocol
  3. Greed – (Conways Law), we are often categorized into dev, test and ops. And there is often a mentality to do the dev work and then pass it on to test and forget about it. Daniel here is realy trying to push DevOps.
  4. Sloth –  you are just effectively creating a distributed monolith.  If you can’t deploy your services individually without impacting other services, then you don’t have a micro-services architecture
  5. Wrath – you panic when something goes wrong. Due to the nature of micro-services, you should make your services fault tolerant using patterns such as CircuitBreaker. Because your services are distributed things will fail, packets will be lost, connection pool limits will be reached. Don’t fall over, handle it.
  6. Envy – Shared single domain fallacy. Break your model up properly, apply the Domain Driven Design practice of Bounded Contexts.
  7. Pride – Testing in the world of Transience. Testing micro-services is hard and occasionally the only way to test is to ‘live test’ (i.e. put it in production and see what happens).

It’s an interesting talk and I highly recommend having a watch.

Watch Seven Deadly Sins of Microservices