Back to thoughts

Size is not important for Microservices

Cogs scattered over a surface

There are many very important concepts embedded in Microservices, but size is the least important. As in the case of many buzzworthy things in tech, (yes Agile, I'm looking at you), many people fixate on whether services *are* microservices and not that they're following the most important principles.

Independently Deployable

Services that can be deployed alone, in any order, make maintaining your software infinitely easier. Having the ability to update one service and push it out alone is hugely valuable. But, you need quite a few things to be able to do that:

  • A Solid CI/CD Platform

  • Great tests, not just unit tests written for coverage, but really good, well thought our unit tests and tests that workout your whole service against mocks

  • Robust API Versioning

Communication in Distributed Systems

Any distributed system should assume that communication is fragile and therefore messages should be sent, and processed, at most once or at least once. For example, if you send one request and your connection drops before you get the answer, what should happen if the same request is made again? Sensible error handling is key here, and sometimes the right answer might be not to return an error at all, if you have a request inbound to put something into a particular state and it's already in that state, is it an error?

Imagine you're calling someone to cancel an appointment with them, is the better response “I’m sorry you can’t cancel it because it’s already cancelled” or “no problem, it’s actually already cancelled”. All code, every API, everything you put build _is_ a user interface, and..

Well-designed interfaces

... good user interfaces don't just work, they feel good to use. This is really, really, hard. It's also one of the places where you probably should turn away from the computer close your eyes for a moment... or do whatever helps you think, and consider what your interface should feel like to use.

A lot of the buzz around microservices isn't really about "Micro" it's about building good distributed systems. This is also my first "real" blog for a while, I'm going to be getting into the habit more and more, but for now I know it's pretty sparse, so watch this space as it'll hopefully get better as I build the habit.