The Heptagon of Configuration

A pattern I've observed in software configuration of complex systems and that explains why bash scripts are everywhere, even at Google.

The Heptagon of Configuration is a term I'm coining to describe a pattern I've observed in software configuration, where configuration evolves through specific, increasing levels of flexibility and complexity, before returning the restrictive and simple implementation.

How does the Cycle Work?

Hardcoded values are the simplest configuration - but provide very little flexibility. The program surface increases, and with it the configuration, incorporating environment variables*, flags, and when that becomes cumbersome, a configuration file to encode the previous.

When multiple environments require similar configuration files, a templating language is used to eliminate repetition and promote reuse of templates.

The templates grow in complexity, until nearly every option in the configuration file is templated - rendering the reusability useless.

A Domain Specific Language (DSL) is invented to promote reuse of logical blocks, instead of using an inflexible, static template.

Since the DSL incorporates domain-specific knowledge by definition, every new function added increases the complexity to the end user. The code eventually becomes unreadable and unmaintainable, and the remaining programs are rewritten in Bash. Bash provides ultimate flexibility with a guise of reusability.

However, the Bash scripts are difficult to prove correctness, and rely on fragile text manipulation to generate a configuration file or template.

The most used Bash scripts evolve into new CLIs with hard-coded behavior. The cycle continues.


*Fun fact: Environment variables celebrated their 40th birthday this year.

Hi 👋, I'm Matt Rickard. I spent the last few years at Google working on open source distributed systems. Now, I'm at Stanford getting my MBA. I write about technology and startups.

Follow me on twitter at @mattrickard