1

I was reading the 12-factor app while thinking about the design of a personal project. I like a lot of what I read, but the following paragraph confused me:

In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.

I do not understand what it means for each env var to be "fully orthogonal" to the others. In colloquial usage, I generally think of orthogonality as "being able to change without regard to other items in the collection." However, some things that naturally break into multiple env variables (e.g. database host, port, username, and password) are also quite interdependent.

What does this statement mean?

3

The key to understanding what the author is saying is found in the previous paragraph:

Another aspect of config management is grouping. Sometimes apps batch config into named groups (often called “environments”) named after specific deploys, such as the development, test, and production environments in Rails...

So, for the part you are asking about,

In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy.

all the author is saying is that each environment variable can be changed independently of the others. So rather than just being limited to development, test, and production environments, you can have factorial(number of environment variables) environments.

It's an odd use of the word "orthogonal", as - outside of the maths of x,y charts and statistical independence - it's normally used to mean "unrelated", rather than "independent" as the author uses it here, but that's just semantics.

Of course, testers will tell you there's a flaw to using environment variables like this. That independence means there's also factorial(number of environment variables) environments to test for full test coverage. But often the flexibility and scalability will outweigh that disadvantage.

| improve this answer | |
1

‘Orthogonal’ means independent of each other. That implies that no information is duplicated or repeated in two variables, like a server name, and then a connection string that contains the server name.

In your example, database host, port, username, and password, would all be orthogonal, as they are not repeating anything, and are independently changeable (unless you repeat the port within the database host variable, which makes little sense)

| improve this answer | |
0

Orthogonal means that environment variables are on different axes of the multidimensional configuration space. Changing the value of one has no effect on the values of others.

Imagine the concrete configuration of your system to be a point in a multidimensional space where each dimension is defined by the possible values of one variable. The variables are orthogonal if you can change its value and the point (= the system) is only moved on the axis of this variable. The point does not move on the axis of all other variables.

The steering of a helicopter is not orthogonal. The pilot always has to counter side effects of a change he makes to one steering element by also changing the other steering elements.

To make configuration orthogonal, for example changing the hostname of the database server must not force you to change the username and password, too. It must be possible to leave them unchanged without making the system unusable.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.