Strategic Approach to Automation in DevOps: Knowing When and What to Automate

18 / Nov / 2024 by Sanyam Munjal 0 comments

Automation is the backbone of DevOps as it streamlines our work, reduces repetitive tasks, and helps us scale. However, automating every task indiscriminately can be more costly than beneficial.

The key lies in understanding what to automate and when not to, plus also understanding that sometimes, the manual way is actually the best way. Not every task requires automation, and not every automation yields a worthwhile return on investment.

Balancing factors like task frequency, complexity, criticality, and reusability decide if automation is worth the effort.

In this post, I am sharing a few guiding principles for deciding when automation will give you the most output of your effort, along with real-world examples to illustrate the point where automation truly adds value and where manual intervention is more practical.

The Value Equation of Automation

Picture a daily, 10-minute task. Spending half a day or even two days to automate it might seem like a big upfront investment, but in the long run, it saves time. Let’s do the math: that 10 minutes saved each day adds up to 300 minutes per month or about 36,000 minutes a year. Not bad, right?

On the other hand, imagine a complex, one-time task. Investing days to automate something you’ll only do once is a quick way to waste time & effort. It all comes down to understanding the value of automation relative to the specific task.

Quick-Check: When Should You Automate?

Here are some questions I like to ask myself before deciding to automate:

  • Is this task repetitive? If it’s something I am doing frequently, automation’s likely to pay off.
  • Can it be reused? Will this automation work across similar tasks or environments? If yes, reusability adds to its value.
  • Is it critical and error-prone? If mistakes could cause serious issues, automation might help keep things consistent.
  • Does it save more time than it costs? Automation has setup costs. Is the time you’ll save down the line worth that initial investment?
  • Is it straightforward or complex? If a task has a lot of variability or exceptions, automation might be more trouble than it’s worth.

Using these questions as a mental checklist helps clarify where to focus our automation efforts.

Real-Life Use Cases

Use Case 1: When Not to Automate

Scenario

A client needed to upgrade the engine on around 1,000 Amazon RDS instances, each supporting different microservices. These instances were built over time and had diverse configurations with unique plugins and parameters. While they could be categorized, setting up and testing automation for each unique setup would take considerable time. Plus, this was a one-off upgrade — a task we wouldn’t repeat anytime soon.

Decision

We chose to do this upgrade manually. It was tedious, sure, but spending days (or even weeks) creating and testing a one-time automation would have been overkill. The task was specific and unlikely to repeat, and we knew we could get it done faster without automation.

Key Takeaway

For unique, high-effort tasks that aren’t likely to come up again, going manual can be the smarter option, especially if the task is straightforward and not too risky.

Use Case 2: When Automation Makes Sense

Scenario

For another client, post every deployment triggered, the QA Team had a manual process involving release notes and a series of tests (all previous + new added for each deployment). Over time, these tests piled up as new cases were added, creating a bottleneck that consumed hours of the QA Team’s time after each deployment. On top of that, code quality checks were only done after deployment, which meant if something didn’t seem right, we’d need a rollback — a frustrating delay with the whole process to be repeated again for everyone involved.

Solution

Automating the whole thing made sense here. We integrated code quality checks and test cases directly into the deployment pipeline. This way, if the code didn’t pass, a ticket would automatically open and assign itself to the developer before deployment even happened. The automated tests covered all the necessary cases, reducing the chance of rollbacks and giving the QA team more time to focus on new challenges.

Impact

Automating this saved around 40 hours per month or 480 hours a year. By reducing redundant manual testing, we freed up the QA team for work that’s more creative and impactful — not to mention minimizing the risk of errors.

Key Takeaway

When tasks are frequent, repetitive, and time-intensive, automation can be a huge win. It not only saves time but also reduces errors, especially in high-stakes environments.

Final Thoughts

Think of automation as a tool, not a solution to every problem. Before diving into a task, take a moment to ask yourself some of those questions above

If the task checks a few of those boxes — it’s repetitive, error-prone, and worth the investment — automation will likely pay off. In DevOps, a balanced approach to automation lets us work more efficiently while keeping things fresh and challenging. The goal is to reduce repetitive work so we can focus on solving new problems and finding new solutions. That’s where the real impact happens.

TO THE NEW helps mitigate deployment risks & enhance productivity by utilizing our robust ecosystem of open-source & licensed tools as we set up & automate your continuous delivery pipeline following the assessment. Contact us to automate your project’s delivery pipeline today!

FOUND THIS USEFUL? SHARE IT

Leave a Reply

Your email address will not be published. Required fields are marked *