Microservices for new projects

microservices, opinion, architecture

Microservices are the hype right now and what everyone talks about. Microservices are an architectural and organizational approach to software development where software is composed of small independent services that communicate over well-defined APIs. These services are owned by small, self-contained teams. Microservices architectures make applications easier to scale and faster to develop, enabling innovation and accelerating time-to-market for new features. This is a commonly used solution for medium to large projects. While there are many benefits with microservices, there are also drawbacks because you enter the domain of distributed systems.

Throughout the series I will cover few common topics and I hope to help you make some informed decisions going forward:

  1. When microservices are not for you
  2. When microservices are a good fit
  3. Microservices for new projects (this post)
  4. Monolith to microservices
  5. Common pitfalls when doing microservices

In this post I'll cover some cases when I think microservices are a good fit for a project...

Overview #

Developing microservices takes time and a lot of thought. There are multiple ways you can start your adventure and every one of them will get you to microservices. You can even change your approach multiple times. The common thing is that every way requires time and dedication, a lot of planning and a lot of thinking.

While we explored when you shouldn’t do microservices in the previous post in the series, there are cases when they are a good fit. My opinion is that the complexity and difficulties are warranted and that you will benefit from the architecture in these few cases. Keep in mind that it all comes down to an individual team and specific project. There is no silver bullet our there that will solve all your problems.

The path to microservices #

Developing microservices takes time and a lot of thought. There are multiple ways you can start your adventure and every one of them will get you to microservices. You can even change your approach multiple times. The common thing is that every way requires time and dedication, a lot of planning and a lot of thinking. You will notice that all paths I wrote are for migrating from monolith to microservices. My opinion is that for new projects, it’s better to start with a monolith or commonly known as monolith-first.

Splitting up a monolith #

The most common way to migrate from monolith to microservices is to split up the monolith. This way you will reuse your existing code and will require minimal changes to the codebase. The bad thing here is that all the bugs and workarounds from the old monolith will become part of the microservices. The split should be done in a way that you end up with multiple standalone microservices, not a distributed monolith which is a common mistake.

Starting from scratch #

This is what we call a Big Bang approach. Everything is done at once. You decommission your monolith and deploy your microservices all at once. You substitute your whole application with one brush stroke. This has the benefit of getting rid of old bugs and workarounds, but main point is that you now know your domain, you have the experience to do best effort decision and previous knowledge can help a lot in development.

Hybrid path #

This migration from monolith to microservices sits someone in the middle of the previous two. The main drawback is that development is required on the monolith additional to the development on the microservices. This will take much more time, but it’s the safest route. You will get early insight in the new architecture and that insight can help you make difficult decisions on the long run. Having more information makes the decision more informed.

Conclusion #

In my next post I will cover few ways and principles you can use to split up your monolith to microservices.