Suvish Thoovamalayil

Making feedback loops work for you

September 05, 2020

featured-img

When you’re driving, there is a continuous feedback loop in action. Your eyes are constantly scanning for approaching vehicles and your arms react by steering the wheel accordingly. For a seasoned driver, this is almost involuntary, a state of mind that allows you to push into the background the minute details of such a complex process.

Overwhelmingly fast feedback loops

We can analyse many aspects of such a feedback loop, but allow me to draw your attention to one - speed. If you accelerate, it becomes progressively difficult to control the car. This is because we are not able to respond well to the rapidly changing scale of stimuli. And if you slow down too much, well, you won’t be getting to your destination any time soon. The trick is to stay in “the zone”, where you are able to maintain productivity while avoiding too much risk.

How do these ideas translate to software? Imagine manually scaling a production cluster for incoming traffic. While such a cluster remains small, say up to a handful of nodes, manually scaling up and down in response to minor traffic fluctuations might be doable. However, if either the number of nodes or the rate of traffic fluctuation is high, it is not possible to manually scale the cluster. Again, this is because the rate of change is beyond our human ability to respond.

Computer memory management is another example. Developers who write low-level C or C++ code know that it takes years of experience before you feel confident allocating memory manually. Even then, incorrect allocations leading to memory leaks, buffer overflows and null pointer dereferencing are some of the most prevalent source of security issues. A simple feedback loop associated with manual memory management is when the programmer needs to manually deallocate previously allocated memory. Whenever they miss deallocating the memory, it results in a memory leak and the program may crash. The speed and scale of the manual memory management feedback loop is too large for people to manage effectively.

Automation is key

A common solution for such speed and scale issues with feedback loops is to implement automation. Automation helps us to manage the scale and make it easier to comprehend high level patterns. Autoscaling is a great solution for scaling nodes in response to traffic. Similarly, garbage collection automates manual memory management. These solutions allow us to offload the difficult part of maintenance of the feedback loop and focus on more important, high level problems instead.

Big and slow feedback loops

At the other end of the spectrum are slow moving feedback loops. A real world example is when you realize that a lot of small, but frequent expenses add up to a significant chunk of your budget over time. For instance, that cup of coffee you buy every day on the way to work. The small amount spent in the moment adds up to a relatively large amount in a year’s time. In a slow moving feedback loop, it is difficult to comprehend the long term impact of your decisions.

The Waterfall methodology for SDLC is a classic case of a slow moving feedback loop. The long gap between a phase in the model and the corresponding collection of feedback leads to a lot of wastage and renders the model ineffective. The software industry has many stories of Waterfall based projects that ran for months or years, but ultimately abandoned because it could not keep up with the changing ground realities.

One other example of a slow moving feedback loop is technical debt. Technical debt refers to the slow accumulation of hacks and short-term workarounds that eventually lead to brittle, complex and difficult to maintain software systems. It’s termed as debt because the people who coined it want you to think of it as financial debt. The increasing difficulty in adding new features and maintenance is the interest paid on this debt. Identifying the repercussions of technical debt is difficult because the feedback arrives very late, and we are not very well equipped to think long term when making decisions.

Breaking it down

So how can we fix slow moving feedback loops? The answer is to do less and do often. Break the large feedback loop into many smaller feedback loops that can provide you with valuable early feedback. Use this feedback to take a decision: a smaller decision with relatively minor consequences. Agile was almost a reaction to the Waterfall methodology, and it prioritized iterative and incremental development. Technical debt is similarly taken care of by hacking through the debt regularly and often. Many teams track their technical debt and address it continuously in every sprint. Eventually the debt is manageable and its negative impact on the product is reduced.

breaking-down-feedback-loops

So the next time you are confronted with chronic issues in your system, try to understand these aspects of the feedback loop. Adapting the loop to work for you, thereby enabling you to stay in “the zone” is essential for efficiency.