In 2012, Adam Wiggins, co-founder of the Heroku platform, presented 12 basic principles. These principles talk about defining new modern web applications from an idea to deployment. This set of principles is now known as the 12-factor app. These principles paved the way for new architectural styles, which evolved into microservice architectures. One of the principles of the 12-factor app was as follows:
So, services will be essentially stateless (except the database, which acts as the state store). The shared nothing principle is also applied across the entire spectrum of patterns and practices. This is nothing more than the isolation of components in order to achieve scale and agility.
In the microservice world, this principle of isolation is applied in the following ways:
- Service teams: There will be self-sufficient teams built around services. In effect, the teams will be able to take all the decisions necessary to develop and support the microservices they are responsible for.
- Source control isolation: The source repository of every microservice will be separate. It will not share any source code, files, and so on. It is okay to duplicate a few bits of code in the microservice world across services.
- Build stage isolation: Build and deploy pipelines for every microservice should be kept isolated. Build and deploy pipelines can even run in parallel, isolated, and deployed services. Due to this, CI-CD tools should be scaled to support different services and pipelines at a much faster speed.
- Release stage isolation: Every microservice should be released in isolation with other services. It is also possible that the same service with different versions is in the production environment.
- Deploy stage isolation: This is the most important part of isolation. Traditional monolith deployment is done with bare metal servers. With the advancement in virtualization, virtual servers have replaced bare metal servers.
In general, a monoliths' standard release process looks like this:
Considering these isolation levels, the microservice build and deployment pipeline may look like this: