Microservices, Finally!
A friend of mine has The Coolest Name, in my mind: Adda. First time I heard it I was like: you're named after the first female coder! Anyway, she commented to me about her company's microservices architecture and Kubernetes, and that got me thinking about a post I've had in mind for some time now...
The Microservices Architecture has been hot in recent years. And I say: Finally! Way before Juval Lowy and crew were coining the term and promoting the pattern, it seemed a no-brainer to me that this was the most logical way to go. (My obsession with SRP probably played a teensy weensy role.) So I have been thrilled to watch this pattern gain traction over the last few years.
But there were many, many years when it seemed like nobody saw it the way I saw it. My projects had many hundreds of deployment units (e.g., jars, dlls, etc.) and many, many Microservices (although we didn't use that term back then). I would compare my designs with other software engineers and people didn't really know what to make of what I was doing. "Why so many services?" "Why not one, or a small handful of them?" "I don't get where the value is."
My reasons are the same today as they were back then.
- Promotes SRP at API level. Services focus on one thing.
- Supports extremely agile release planning. Deployment units are very small in scope.
- Encourages the Right System. Services survive redesigns due to their focused nature.
- Aligns data with function. Data is partitioned according to function of the service.
Now, here is the thought that I alluded to at the beginning of this post. While the benefits of Microservices Architecture has finally caught on - the separation of (micro)service and transport hasn't...at least not to the level we will need it to. If we are to truly see Service Function separate from Application Design, we must tweak our designs. Our services must have no implicit or explicit awareness or connection to the mechanism by which they are called. We want to get to a point where ServiceOne is called by a mobile device, or by a browser, or by an integration partner...completely agnostic to the source. And the tweak to do this is committing to SRP in our Controllers. We have to design our Controllers as pure payload packagers.
When I see this tweak become commonplace, at that point we will have pure microservices - and we will be able to leverage the full potential of application fabric managers like Kubernetes.