DEV Community

Ayush Gupta
Ayush Gupta

Posted on

DevOps - Basics

Hi Everyone,

Let's try to understand DevOps

Let's consider a scenario, suppose you are giving an interview for a DevOps role.

The first question which comes to you is, what is your understanding of DevOps?

Before DevOps-

consider we have 2 teams, a development team and operations team, now suppose development team has created an application, now in order to run this application we need some infrastructure like servers, database, but this infrastructure is not setup yet, now who will create and setup this infrastructure ? it will be operations team

Now there is a roadblock, operation team is waiting for development team to create the application first.

But you must be thinking where are the Developers creating this application I mean since their is no infrastructure has been setup yet right ?

so they will be creating the application in there local system only

once we are good with application and it is ready, they will ask operations team like we require an infrastructure for testing environment, we need 2 servers and 1 Database in Testing environment, now once application is ready, now the developers can deploy their app to this testing environment, where all the developers can run and test the application together.

only problem is operation team has to wait for the development team to create the application first.

Now consider we require a Production Environment also, now again operation team has to wait for the development team and we can consider QA team also for there Testing to be successful in the Testing environment.

Now this is one approach, here setting up of the infrastructure is done manually only.

Now Let's see an another way of working which helps us in solving the above problem of doing thing manually, which is DevOps.

DevOps-

In DevOps, we use Infrastructure as Code and CI/CD pipelines.

Infrastructure as Code -

It means we are writing code and creating scripts or config files to set up and manage servers, networks, databases, and environments instead of doing it manually.

Let's try to understand this using below examples -

Suppose we don't use Infrastructure as Code ?

In this case an operations engineer has to create servers, set up networking, install software in a cloud provider like AWS/Azure/Google Cloud/VM ware and all this will be done manually only.

Now suppose we use Infrastructure as Code ?

Here we will write code as scripts (in YAML, JSON, or a tool’s language like Terraform or Ansible) that describes the infrastructure. now we run a command or execute our script, then our infrastructure is created automatically.

CI/CD pipelines -

As of now we have the infrastructure only, but our application is not deployed yet, so to deploy the application in a particular environment like a Testing or a Production we will use CI/CD Pipelines.

Now lets try to understand the CI/CD Pipelines ?

so as of now in the case of infrastructure as code, we are creating and setting up infrastructure using scripts only and not doing anything manually and similarly in order to deploy an application in that infrastructure, we will use scripts only or we can say we will build CI/CD Pipelines which will deploy our application automatically in the infrastructure.

CI - Continuous Integration

suppose we have created an application, for now lets consider the code of this application exist in our local system only. now lets suppose we push the code to our remote repository or we can say to Github.

now comes CI, It will be build the code and runs test cases, these test cases are part of the code itself.

CD -

In CD, we are trying to deploy the code in a particular environment like Testing or Production etc.

now in order to deploy the code or we can say build, we will use two strategies -

1. Continuous Delivery
2. Continuous Deployment

now let's try to understand both of them

1. Continuous Delivery -

In Continuous Delivery, it will deploy the code in a Testing environment only, then Testing team will check how app is working , before we deploy the app in the production environment.

Now in case of Continuous Delivery, the deployment to a production environment will be done manually only.

2. Continuous Deployment -

In Continuous Delivery, Everything is done automatically only, first to Testing environment and then to production as well.

Top comments (0)