The name DevOps is a combination of two terms: dev, which represents developers, and ops, which represents Operations. These are the two main teams involved in software deployment. The development team writes the code, and the operations team deploys and maintains the code.
If we talk about DevOps from a wider perspective, we can define DevOps as a methodology that helps to combine the developer's team and Operations team into a single entity, thereby improving communication and collaboration between them. The output of this processing not only improves the deployment frequency but also reduces the misunderstandings that usually happen between these teams. DevOps focuses more on automation to reduce human errors and repetitive tasks.
To understand better, we will talk a little bit about some other methodologies or approaches in software development. Two famous and widely used models are the waterfall model and the Agile methodology.
This deployment model is pretty straightforward. It follows a linear approach. It completes one stage and goes to the next stage.
Image source: laptrinhx.com
Requirement gathering: Requirements are gathered from clients for developing the application.
Design: a blueprint of the application is created. This shows how the software will look after it is deployed.
Implementation: This is the phase where actual coding takes place. Developers create codes for implementing the application.
Verification: once the coding is completed, its the time for verification. various testing is conducted on the application for any errors or bugs. unit testing, integration testing, etc are performed here.
Maintenance: Once the software is deployed to production it's time for maintenance. During this phase, the application is monitored and fixed issues related to performance, tuning, etc.
As we discuss what the waterfall model is, let's see some of the advantages and disadvantages of this approach.
Advantages
Simple to implement
Easy to test the code.
Can see a clear picture of the product before deployment.
Good for small projects.
Disadvantages
Not suitable for projects that require frequent changes.
It is difficult to make fixed to code during the testing phase as it follows a linear approach
Customers can only see the working product at the end of deployment.
This is an iterative-based deployment method in which a project is divided into smaller units Each of the units goes through requirement gathering, design, implementation, testing, and maintenance units. The duration of each iteration is 2–8 weeks
Image source : producttribe.com
In Agile, the company releases applications with a particular feature that has high priority. Once released, they collect feedback from end users for necessary modifications. If modifications are required, that is done in the next iteration.
This process is continued until the final, perfect product is achieved.
Advantages
It is easier to make modifications to the application as we are getting feedback quickly instead of waiting till the product is completely built and deployed.
It reduces errors in code.
Communication and interaction between users and clients improve this, which helps in understanding requirements better.
Disadvantages
Customer feedback is really critical, and improper feedback can affect the product's functionality.
not suitable for complex project.
predicting the product's final deploy date would be difficult
Increase maintenance cost.
So far we discussed both the Waterfall model and Agile methodology. They both are great for software deployment. Then you might think what is the need for DevOps?. Let's see how DevOps is different from others and why it is the preferred model that is used by almost all Companies.
DevOps gives more importance to automation. If you watch closely, you might have noticed that both the models that we discussed previously follow a manual approach, which means once the software is created, the product is deployed manually by the operations team. The ops team has to create servers, Install all dependencies and software packages, etc., to deploy the developed code. This process takes a good amount of time. The chances of breaking the application are also high due to environmental changes.
It is common talk in the IT industry that "Code was working well when checked on my machine. Don't know why it's not working after it is deployed in server". This is exactly what we referred to as issues caused by changes in the environment. Maybe on the developer's machines, all dependencies were already installed, but on the production server, these dependencies are not present. The operations team also doesn't have a good understanding of these dependencies and requirements as they are not involved in development. These issues haunted Agile and waterfall approaches.
As DevOps focuses more on automation. It uses tools to perform many manual tasks.
In DevOps entire software deployment process is called a pipeline or CI/CD pipeline.
Image source : dynatrace.com
CI/CD is an essential part of DevOps or any modern software development practice. CI/CD can improve deployment frequency and reduce errors that happen during deployment. It increases efficiency and streamlines workflows through built-in automation, testing, and collaboration.
A CI/CD pipeline has several parts that are described below
Image source: plutora.com
Source: In an organization, developers write the code and check it into centralized repositories; these repositories are called version control systems. An example is GitHub, Bitbucket, etc. This is where the initial code for the deployment stays. There will be multiple check-ins to these repositories daily, and each of them will have a version number to differentiate them.
Build: This is the important step, and in this step, the source code that is present in the repository is pulled using a continuous integration software like Jenkins, and with the help of build software like Apache Maven, an artifact is created. An artifact is the output of the build. Their artifacts can be stored in artifact repositories like the JFrog repository for versioning. The reason we use an artifact repository, is that we will be able to store all previous artifacts, and we can go back to the previous one in case we want the previous version.
Testing: Automated tests are performed on the software to make sure it is error-free. There are three types of testing.
Unit testing, Integration testing, and Functional testing.
Deployment: This is the step where we deploy our application to a server or a container. If the test passes, then the pipeline will initiate the automated deployment step, and the application will be deployed to a server or Docker container. There are different strategies available for deployment. Blue-green deployment, in-place deployment, etc. are some of them.
Even though both of them are referred to as CD, there is a difference between both. Continuous deployment involves a manual step at the end before the application is released. There is an approval process that requires human intervention. This is helpful when there are changes required at the end of the pipeline and they can send it back to the developer to work more on that particular feature.
For example, the application will be deployed to production only after all tests are passed and the person who is responsible should approve it. In the case of continuous delivery the pipeline is fully automated and it does not require any manual intervention.
Image source: techtrainees.com
These are several software packages involved in the CI/CD pipeline. The good news is that most of them are open-source tools that are well implemented.
Source code management
GIT, Bit Bucket, and AWS code commit
Continuous Integration
Jenkins, TeamCity, and Bamboo
Build
Apache maven, Ant, and Gradle
Test
JMeter, Selenium, and SoapUI
Artifact repositories
JFrog Artifactory, Nexus
Deploy
Servers (Linux, Windows), Docker containers, and cloud services like AWS EC2
DevOps helps to build a bond between the Developers and the Operations team. Deployments that took months to complete are now deployed within days, also in an automated and tested manner. The use of pipelines made the process much easier and quicker. Because of automation, there are fewer human errors, and it is fully compatible with cloud services. Many cloud providers now have dedicated DevOps resources like AWS DevOps or Azure DevOps. This truly demonstrates how DevOps is accepted by the IT industry, and learning DevOps is a must-have for anyone who likes to work in the Information technology field.