DevOps in a Serverless Environment: The 6 Major Benefits
In the book, The Phoenix Project by Gene Kim, a fictional auto parts company modernizes its IT operations and development practice by adopting DevOps techniques. In true fictional novel fashion, the company is saved in a small amount of time thanks to the switch, with celebrations and even a promotion for the main character to wrap things up with a bow.
DevOps may not be the silver bullet that The Phoenix Project depicts, but it does bring huge benefits for companies that adopt it. Even better, when used alongside serverless, the benefits of DevOps are amplified.
The 6 Major Benefits of DevOps
Modernization has sped up the business world. Companies need to release new features and enhanced offerings faster than ever before. DevOps facilitates that speed. Not only can new and better features be released quickly, but those releases can be executed flawlessly. Even better, rapid feature development spurs innovation.
Let’s look at an example of rapid innovation to illustrate exactly what we mean.
A developer is assigned a feature, a set of features, or a bug to implement. Indeed, this is the typical kick-off point for development. The developer does what they do — they develop the code to the requirements, and then they check in the code to source control like GitHub.This is where the magic starts — from here, the DevOps process takes over, and the developer does not need to worry about what happens next, and the beauty of this process is the developer can move on to the next piece of code to develop.
Once checked in, there is a code review, and upon completion of the code review, the code would be committed to a stable branchlike develop or master. Then the Continuous Integration/Continuous Delivery, or CI/CD, pipeline kicks in by triggering on the commit to the develop, master, or another branch. The CI/CD pipeline recognizes that someone made a code commit, and the new features are automatically built, tested, and deployed to the correct microservice.
If you are interested in seeing this in action, watch this short Tech Demo video.
A lot of what was represented above was automated. But what does your deployment cycle look like without an automated DevOps process?
Without automation, we’re talking about manually running deploy scripts or, worse, manually executing deployments. This can take a LONG time. Planning for a massive deployment can take days or weeks, and we’ve seen clients manually perform complex deployments that took entire weekends. This extended timeline can require a significant maintenance window, forcing deployments to occur in the middle of the night or on the weekend causing fatigue amongst the people actually performing deployments.
With automated CI/CD pipelines, you can check in code and the process takes over. You may even completely avoid a planned maintenance window because your process allows for 100% uptime now during deployment. There is no need for war rooms filled with developers and admins for hours. Setting up the automation already handles the planning, and deployments happen within minutes.
I’d be surprised if the last section didn’t have you thinking about everything that could go wrong — from a mistimed deploy script running to files being deployed to the wrong server. DevOps creates consistent processes and sets defined roles and responsibilities while removing the danger of human error.
Don’t make the mistake of thinking that DevOps blurs the lines between development and operations. Instead, developers can concentrate on development without being embroiled in the deployment process. DevOps teams can focus on the processes and automation. It’s the process that will manage the deployments, providing greater separation of responsibilities and putting space between developers and environments they aren’t familiar with.
The more manual intervention needed, the more opportunity for fat fingering a filename or entirely missing a step. Humans are humans, and they make mistakes. I’ve worked with clients where a SQL or Bash script was used for deployments — a half step toward automation that required manually changing environment names before running. If those environment variables aren’t changed, it requires a human to catch the mistake.
In the pressure cooker that some manual deployments can become, it can be easy to miss something. Automation ensures that the microservice or application is deployed the same way, every time.
Regression testing is an integral part of a mature development process. But many businesses don’t feel confident in their end-to-end testing. Often, what’s required to do a full regression test is tribal knowledge — only 1 or 2 people in the entire company know what’s involved.
While automating QA requires custom implementation, it allows for a repeatable, documented process to be run by anyone, or by the CI/CD automation. Regression tests are run again and again because they are built into the process. There is no chance for shortcuts to miss testing elements just to get a deployment out the door quicker.
Unit testing is also improved within DevOps.Test-Driven Development (TDD) is crucial, with unit tests being run as part of a CI/CD pipeline. Developers code these tests, typically in a framework like JUnit or Jest. Frameworks simplify the creation of reports on test coverage and which have failed or succeeded. Using automated unit tests, you can ensure that you’ve got 80% or higher test coverage and that all tests pass before moving to deployment.
Great Developer Experience
Developers want to focus on what they do best- developing code. DevOps allows for that, which in turn makes your developers happier.
Developers can code, perform reviews, check everything in, and move on. Once the code is checked in, the process takes over. TDD ensures clean code is checked in, stepping them back from QA. And with automated deployment in place, there is less need for their involvement in planning and deployments.
A determining factor in security is consistency. DevOps can enforce security practices so that everything that goes out meets the company’s standards.
As part of the DevOps process, code dependencies can be validated, and code libraries verified to make sure that they are safe to use. If the code uses sensitive data or variables, those elements can remain encrypted until deployment, when automation can inject them into the code.
Making Serverless Better with DevOps
Everything described above are the benefits anyone will get from leveraging DevOps, and all of those benefits apply to serverless as well. Here’s where the difference comes in, though — when DevOps is used in conjunction with serverless, those benefits are amplified.
Governance is critical when using serverless or things can rapidly get out of hand. Services can cross lanes throughout the company and even with outside customers, so documentation is vital. Maintaining API catalogs and tracking duplicate microservices can be time-consuming but necessary.
CI/CD pipelines create a self-documenting process. With all of your applications and services automated, documentation becomes better by necessity so that the automation can be fully built.
Similarly, creating the DevOps automation and a framework for microservices inherently leads to more complete inventories of those services. Documentation and inventories go hand in glove with DevOps — creating the deployment pipeline requires planning, planning requires documentation, and implementation of the automation leads to an inventory of all microservices.
Inventories aren’t the only thing that can quickly get out of hand with serverless. Manual deployments and maintenance can be cumbersome and nearly impossible, with services spread across a serverless ecosystem. Automated CI/CD pipelines handle those deployments. Developers check-in code, and everything is managed with the process from there.
Bringing all these benefits together is the speed at which new connectors and microservices can be developed and deployed.Creating an automated DevOps process across your codebase lays the groundwork for new serverless microservices. This leads to well-documented, well-tested, and simple deployments, resulting in the rapid creation and innovation.
As great as serverless is, there is no denying that it can quickly devolve without attention and the right processes in place.DevOps is the key to bringing order to what could potentially be chaos. If you’re interested in discussing how DevOps can streamline your serverless implementations, reach out to us. We’d love to discuss how your company can benefit from adding DevOps and serverless into your environment.