Managing the Complexity Spiral

Simple decisions can increase the complexity of an application exponentially.

Managing the Complexity Spiral

It's interesting looking at a codebase and observing how it has evolved over time.

Ideas grow and shift from the inception of the application to its current state: whether it's a relatively new greenfield application or a battle-tested enterprise mainstay.

Pulling back from the codebase and observing the features of the working software, the simple beginnings give way to obvious – and not-so-obvious – complexities:

  • API gateways added to support new integration requirements.
  • Database scaling and contention handling support.
  • Service discovery, health checks, and graceful degradation.
  • Complex UI orchestration and session management in a highly concurrent, distributed web environment.

Simple decisions can increase the complexity of an application exponentially. Likewise, the organization supporting the application also increases in complexity as the team begins to scale. Specialties emerge, processes grow & change, and knowledge drifts.

Not all complexity is necessary, however.

Whether it's a startup that's building an application from scratch or an enterprise going through a modernization effort, there are some key questions and techniques that can help determine whether the complexity is necessary and what can be done to manage it going forward.

Solve the Right Problem

There are a lot of tools, techniques, and processes available to technology professionals to solve a wide array of problems. To that end, it's easy to forego analyzing the problem itself and jump straight to solution.

While there may be constraints that may tip the playing field in the direction of a particular tool or technique, it is still important to understand what's truly needed, so that alternatives or mitigating factors can be properly employed.

Getting to the root of the problem involves asking the right questions, collaborating with colleagues, and keeping an open mind. The five why's is a good starting point to get the conversation going.

Once the problem is understood, solutioning – whether with technology, process, or a mix – can proceed on a better footing. Now it's time to reach into the bag of tricks and employ the tool, technique, or process that will do the job, which in turn requires an understanding of what problems they solve and what impact they'll have on your organization.

Be careful not to get paralyzed here by overanalysis. More often than not, a lot of the information about the problem won't reveal itself until after a solution is applied.

Establish the Feedback Loop (Measure, Learn, Pivot)

When a problem is well understood and a solution is employed, it's important to know if it was successful. That means defining what success really means, establishing a way to measure it, and then reviewing to determine if a pivot needs to be made.

Assume you're at a sandwich shop and place an order. As the sandwich is being made, you're able to see each step as it's assembled. If an ingredient you didn't request is going to be used, you can see it, ask for the correction to be made, and see the course correction happen. It's much easier to fix a sandwich after the first ingredient instead of finding out after the tenth.

As a solution begins to take hold, it's important to have a means to monitor the technology and the processes in place so that the information can be used to determine if a course correction is needed sooner rather than later. Pivoting itself is an art, but well defined measures can help make that decision sooner and with more confidence, saving time and money.

And while monitoring all the things is ideal, it's easy to drown yourself in so much information that it'll become hard to tell which way is up. Take the information and organize into the things you care about most and/or have determined to be critical to monitoring the success of the solution.

And when the thing-that-we-thought-would-never-happen happens, you can drill down into the rest of the information to troubleshoot.

Manage the Vertical

You're only as strong as your weakest link.

An old saying, but it holds true for managing complexity. While we know systems can get very complex, this bit is more about the impact to the organizational side of things.

Imagine a cohesive team with great automony. They have a well defined process, deliver great software, and generally love working together. They move at a fast pace, iterating quickly, incorporating feedback, and just get stuff done.

You know, like one of those groups that are straight out of a training guide.

Anyway, say this team is ready to push their release to an environment to prepare for a production rollout. Doing so requires interaction with a team that is just as strong, gets stuff done, and loves working together, but they move at a slower cadence. They read the same training guide and what they do works for them.

Managing the vertical simply means looking at the scope of a delivery, from inception to ending up in a user's hands, and identifying where collisions may occur. The more a team – think a logical team, not necessarily a physical team – is able to manage before crossing a boundary into a separate vertical, the more they're able to control.

Well, let them do all the things. Down with silos!

As a small team, people will naturally wear a lot of hats. As your organization scales, however, that approach becomes difficult to manage. Understand the product's goals in conjunction with the organizational structure to determine where the verticals end and manage the friction when crossing over a necessary boundary.

Communicate

This one is short, but it binds all of the other items together: communication.

Problem solving, measuring, pivoting, and managing the organizational structure all require effective communication. Too much – or no effective means to filter – information and things may get lost in the noise. Too little and the left hand isn't aware of what the right hand is doing.

There are tools available to help with communication and collaboration, especially when working asynchronously. Effective communication is concise, actionable, and informative, while remembering that we're all humans: languages, time zones, and life all affect how we communicate.

Lastly, effective communication requires effective listening.

Control the Technology Sprawl

Just because it's new doesn't mean your problem – or solution – needs it.

As an example, I had put off a home improvement project for a while (I'm not an avid home DIYer, but when the need arises, I'll cut, hammer, and fix anything that won't seriously hurt me – or my house – too much), simply because I didn't clearly see a way around hammering A LOT of nails and a nailgun would be unwieldy to get into tight spaces.

Hey, rent an auto-hammer and you'll be done in no time, my brother says.

A what?

Sure enough, the internet prevailed. A specific tool that fit perfectly for the problem I had. New inspiration and about an hour later, the job's done.

What else could I use this for?

My SO prudently brought me back down to earth to keep me from auto hammering everything in sight.

New technology is similar. As a technologist, it's exciting to use new things. Theorize, implement, and rejoice at all of the possibilities the New Thing can tackle. Solutioning comes fast and furious in those instances.

Understanding the impact the New Thing may have on your existing technology landscape and the people that build & support it is paramount to preventing fragmentation and increasing the costs and/or risks involved. Balancing the diversity of your technology stack means balancing the skillsets required to maintain it (and potential vendor lock-in).

Some New Things are fairly benign – an even faster, more efficienct way to parse JSON that fits into the existing stack – while others are more disruptive (Is Kubernetes still new? No? Well, Kubernetes).

If you don't have a need to orchestrate groups of containerized units in a solution that may need to take advantage of balancing, self-healing, scaling, and more, maybe it's time to put down the auto hammer and choose a different tool for the job.

A brief side note: it's good to stay apprised of technology trends to understand what problems they solve and what baggage is included when doing so. This information can be used during the solutioning process.

Keep It Simple

Finally, simplicity is the principle that can tie all of the previous points together.

Simplifying the solution, measures, and collaboration can have an exponential effect on a product's – and organization's – success.

A product may grow into a complex distributed system, but if it is composed of simple pieces that are designed to work together in a clean, consistent manner that can be observed from outside its inner workings, the complexity to maintain and evolve can be controlled.