Microservices architecture is becoming an over-hyped term which is trending all over the software industry. Do you want to innovate? Change quickly? Move faster? Just use microservices and you are there!
Tech giants such as Netflix and Spotify adopted microservices to help them to scale easily, innovate and response quickly to change. But, you may be surprised about the many things you need to put in place to avoid turning microservices into a mega-headache. Make sure you take care of the following three aspects to keep your microservices journey on track.
Modeling microservices is not trivial. Each service should be modeled with one functionality in mind and encapsulates all it needs to perform its task. Choosing the correct granularity is of utmost importance. Although it is called “micro”, smaller is not necessarily better. Having too many fine grained services will lead to a lot of communication between services and in turn increase latency, risk of failures and the overall complexity of the system.
Furthermore, it is challenging to maintain architectural diagrams and keep track of all the services, since it is very likely to add, remove or modify multiple services at a time. Therefore, considering using system generated architecture repositories is very helpful for documentation and obtaining a holistic view of the architecture.
Finally, when orchestrating microservices using point to point communication, it will be easy to fall into the spaghetti integration trap and essentially build a monolith. So, make sure you define an integration architecture using proven integration patterns such as a gateway to orchestrate the microservices landscape.
Independence of each microservice includes the freedom to choose any technology for development. However, managing a diverse technology landscape requires a highly skilled team, who is fully aware of all peculiarities of the different technologies. A common pattern is to allow multiple technologies in dev and test, but standardize in production. It will make your life a lot more predictable and manageable.
Dealing with a large number of microservices (each with their own storage) instead of a single system, takes blood, sweat and tears from your ops engineers. To achieve full effectiveness and flexibility, it is common practice to automate provisioning of the underlying machines. Cloud technology is often a fitting and proven solution for this. This allows the development teams to be as self-sufficient as possible.
Furthermore the Continuous Delivery and Continuous Integration pipelines should be in place for rapid and smooth development. When it comes to deployment: automation and portability are key aspects to ensure that having many deployments does not slow you down. Containers technology such as Docker is the current go-to solution.
Last, but not least, failures are likely to happen in such a highly distributed
environment, therefore, having monitoring and failure handling tools is
essential to stay on top of things and keep the landscape up and running.
But it is not all technology with micro services, no, no, no. By Conway’s law the system should closely follow the organizations communication structure. For a clean microservices landscape, the requirement is therefor that the organization is also clean and well organized. Since this is often not the case, the introduction of microservices is a great opportunity to spruce up the organization.
Furthermore, the teams become small (two pizza team) and own the end to end responsibility of a business service. This actually creates other challenges such as avoiding duplication of services and sharing knowledge and expertise between teams. A good communication structure between the autonomous teams is key. In this regards, Spotify’s model with tribes and chapters is worth
Lastly, ye olde DevOPS really shines with microservices and vice-versa. Developers and operation engineers work hand in hand and collaborate to deliver and run the service they are responsible for.
Implementing microservices architecture is not a trivial task. Although, a single microservice is simple to build, scaling to a full system or landscape is more challenging. Don’t fall into the hype and take microservices as a quick fix, but take care of the aspects outlined here. Go the whole nine yards and be truly agile!
For more information please contact Roger Salhani, consultant at KPMG Technology Advisory