One of the liveliest sessions at Scale Summit was the one on microservices where opinions flowed free and fast in a rapidly rotating fishbowl.
There were several points of interest that I took away and I thought I would write them up here as some of the key questions. In another post I’ll talk about the problems with microservices that haven’t been solved yet.
Are we doing microservices yet?
Some people in the room had already adopted microservices, the reasons given included: breaking down or trying to change functionality monolith codebases, trying to scale up an existing applications or architectures or actually as an existing best practice that should be applied more generally.
What is a microservice?
A few people wanted to get back to this. Showing that while it is a handy term it isn’t universally understood or agreed.
I personally think a microservice is a body of code whose purpose and implementation is easy to understand when studied, adheres to the Unix philosophy of doing one thing well and which can be re-implemented quickly if needed.
Are microservices just good practice or righteous SOA?
Well naturally you can regard every new concept as being a distillation of previous good practice. However the point of naming something is to try and make it easy to triangulate on a meaning in conversation.
Won’t microservices just be corrupted by consultants and architects?
Yes, everything popular gets corrupted in time. I’m okay with that because in the interval we have a handy term to describe some useful patterns of solution design.
Don’t microservices complicate operations?
One attendee put it well: microservices are recursive so if the operations team are going to support them then they should be in the business of creating a service that deploys services.
Some people felt that for microservices to work developers and teams had to have full stack ownership and responsibility but I felt that was trying to smuggle devops in under the microservices banner.
I think microservices are best deployed on a platform and that platform defines what a deployable service is and can be responsible for shutting down misbehaving services.
Such a scheme allows for other aspects of the Unix way to be applied such as man pages, responding to –help and other useful conventions.
The platform can check whether these conventions have been met before deploying the service.
Isn’t microservices just a way to discuss the granularity of a service?
Yes in a way, although there are a few other practices that make up a successful application of microservices you can just think about it as being a way of checking the responsibility boundaries of your service and how easy it would be to replace.
If your service has multiple responsibilities and is difficult to replace easily then it might have problems.
A lot of people wanted to use AWS an an example of good services without microservices. I think AWS is a good example of service implementation: each part has good boundaries and there are a few implementations of the key APIs. Things like the AWS security functionality is a good example of how you have to work hard to avoid having services rely on other services, and the result isn’t elegant as a result.
I would argue that public-facing APIs are probably where you want to composite microservices to provide a consistent facade onto the functionality though.
As other delegates pointed out, isolating services makes them easier to scale. If starting a server in the EC2 API requires more resources than shutting it down you might prefer to scale up just the creation service rather than many instances of the whole API which are unlikely to be used or consume resources.
As ever, horses for courses, you’re going to know your domain better than I do.
Don’t microservices cause problems as well as solve them?
Absolutely, choosing the wrong solution at the wrong time is going to cause problems. Zealously over-applying microservices or applying the idea to absurd levels is not going to have a happy outcome.
A guess a good point is that we know our problems with existing service implementations. We don’t know what problems there are with microservices or whether they have logical and simple solutions. However they are helping us solve some of our known problems.
Aren’t microservices simply REST-ful services done right?
The most common form of microservice today is probably one implemented via HTTP and JSON. However this form isn’t prescriptive. ProtocolBuffers might be a better choice for an internal exchange format and ZeroMQ might be a better choice for a transport.
I also think that message queues are a good basis for microservices with micro consumers and producers focussing on tight message types.
See also my mini-list of microservice myths which has more on this subject.
Should we be doing microservices?
I suspect that doing microservices for the sake of ticking a solution buzzword is bad. However I think microservices seem a pretty good solution to a problem I know I’ve seen in a fast-moving domain where you are trying to innovate without creating a maintenance burden or large legacy.