DevOps understanding for a software developer — Aerial View

Mamta Singh
4 min readJun 28, 2021

DevOps is the short form of development and operations. In this approach, both the development team and operations team work together during the build and deployment phases of the software development life cycle where both teams share responsibilities and provide continuous feedback. The goal of DevOps is a Continuous Deployment (CD) model which is repeatable, reliable, secure and stable. All technical team members should have experience with the processes and tools involved in the development pipeline.

Benefits

  1. Speed
  2. Rapid delivery
  3. Reliability
  4. Security
  5. Scale
  6. Improved Collaboration

Components of DevOps practice

  1. CI/CD — In Continuous Integration (CI), developers commit code frequently to a code repository which is built frequently. Each build is tested using automated unit and integration tests. Whereas in Continuous Delivery or Continuous Deployment (CD), builds are deployed to test environments and are tested using automated or manual tests. Successful builds pass tests and are deployed to staging or production environments.

2. Continuous monitoring and improvement — Activity monitoring is essential in High-Availability (HA) applications and infrastructure. There are various metrics to monitor and improve your DevOps practice. These metrics can be

2.1 Change volume

2.2 Deployment frequency

2.3 Percentage of failed deployments

2.4 Availability

3. Infrastructure as Code (IaC) — Automate the task of creating a complete environment in the form of templates which reduces the efforts and time of building up the entire environment manually. In IaC, infrastructure is spun up and managed using code and CI. In this model, interaction with infrastructure happens programmatically at scale and avoid human errors.

4. Configuration Management (CM) — CM is the process of using automation to standardize resource configurations across the infrastructure and applications. CM tools such as Chef, Puppet and Ansible can help in the management of Iac and automate system administration tasks. By automating, same configuration can be deployed to hundreds of nodes just with a button push.

CD Strategy

Some of the most popular techniques to achieve CD are:

  1. In-place deployment — In place deployment is a method of rolling out a new application version on an existing fleet of servers. This update needs some downtime since all happens in just one deployment action. It is suitable where hardly any change in infrastructure is and deployment process is also fast. In case deployment fails, then redeployment is the only option for restoration.
  2. Rolling Deployment — In rolling deployment, the entire server fleet is divided into sub-groups and the deployment process runs both old and new versions of software with different sub-groups. It helps to achieve zero downtime but the deployment time is little more than in-place deployment. If a new version deployment fails then only a sub-group is impacted and the old application is still running in different sub-group.
  3. Blue-Green Deployment — In blue-green deployment, two parallel identical environments are provisioned where blue environment is your existing production environment carrying live traffic and green has the new version of the code. When it is time to deploy, you route production traffic from blue environment to green environment. If you encounter any issues with the green environment, you can roll it back by reverting traffic to the blue environment. DNS cutover is the most common method to re-route traffic. Testing the green environment with a fraction of production traffic is called canary analysis. If the environment has functional issues, you will be able to switch back before impacting your users significantly.

4. Red-Black Deployment — In red-black deployment, before submitting a new version of a system, canary testing is performed. The canary replaces around 1% of its existing production system with the latest version of the application and monitors errors. If the canary clears the initial tests then only the system is ready for deployment. Before switchover, a new version of the system was set up side by side with the old version. Once the new system is up and running, both systems are red. The system then cut over to the new version and the old version is regarded as black which is still up and running but not receiving any live traffic. In red-black deployment, sudden DNS cutover is done whereas in blue-green deployment, the DNS gradually increases live traffic to the new version.

5. Immutable Deployment — This type of upgrade technique is more common in immutable infrastructure where your application has unknown dependencies. During the new release, a new set of server instances are rolled out by terminating the older instances.

Summary

The agility of CI/CD can be achieved only by applying automation everywhere which reduces overall time and cost of infrastructure provisioning and application deployment. Choosing CD strategy totally depends on the frequency of deployments, downtime and rollback strategies in case of failure. Testing is an important aspect of deployments to ensure new application state is good and healthy.

--

--