Structural CI/CD Patterns – deployment strategies
Structural design patterns in general provide the structure for how the components in a CI/CD pipeline interact. Applying them in an organization requires thoughtful design and architecture consideration in order for them to scale. It often requires choosing the right deployment strategies so that we can accommodate new components in the pipeline with minimal risks to improve reliability and quality, along with other aspects. Selecting the deployment strategies in a CI/CD pipeline also has implicit goals such as experimentation, scalability, reliability, and segregation of duties, which are associated with non-functional requirements in a CI/CD pipeline component.
Be it a monolithic approach or a polylithic approach for structural components, both involve deploying changes so that risk is minimal and consider the ability to scale processes and technology along with ease of adding or removing components.
Modern CI/CD pipelines are often evolving, and the choice of technology keeps changing over time, thus it is crucial to adopt deployment strategies that provide flexibility, ease of adoption, and correct telemetry or signals to make the right decision based on user behavior.
The design and importance of determining deployment strategies are crucial so that deployments are efficient and can scale. More importantly, deciding a deployment strategy or combination of deployment strategies is also crucial for overall pipeline design on how the application or code will be deployed to be presented in front of the users.
We will start with the following diagram depicting different deployment strategies in the CI/CD pipeline and how they are applied in the deployment stage:
Figure 6.1 – The basics of deployment strategies in structural CI/CD
The preceding diagram shows an overview of different deployment strategies that are applied in the deployment stage along with their major attributes. For example, the blue-green deployment strategy requires two parallel production environments to be running, with one serving the active traffic while a new version of the app gets deployed to the inactive stack. Once the new version is tested in isolation and is ready, the traffic is flipped to the new version. However, this also comes with additional costs. Similarly, there are other deployment strategies that we will explore in subsequent sections of the chapter.