You can put all your configuration in a shared library and eliminate just about every mis-configuration in your multi-process application. It's not free, but it's cheap, and it kills a lot of minor pain. Let's take a gander.
It's Sunday geek comfort-food time. I hope you enjoy it, and I also hope you remember it's not the most important story out there. Please keep working for change, once you're rested.

Stay safe, stay strong, stay kind, stay angry.

Black Lives Matter.
A multi-process app is one where there are several programs that are built and provisioned separately, but must collaborate to create the experience of the user. All micro-service architectures are multi-process, for instance, but there are other apps like that, too.
In order to collaborate at runtime, these programs need to share things like endpoints, URLs, feature flags, and sometimes even file paths. Mis-configurations can cause lots of wasted time, in development, testing and release.
By far the most common way to achieve this sharing is by maintaining some variety of "configuration profile" files, one for each program. These contain ASCII -- YAML or environment-variable style -- depending on and customized for the particular program.
When we have two programs and two profiles and the profiles don't agree about one or more of the configuration settings, the result is usually, tho by no means always, a kind of easy "wait, what?" problem.
What I mean is, the programs tend to collaborate incorrectly in such an obvious way that we usually notice it pretty quickly. We go double-check the configurations, spot the incorrect ASCII string, hand-edit it, re-up it, bounce it, and hopefully we're off and running again.
Of course, they're not *always* that obvious. I've seen multi-service apps mis-connected for days at a time, causing confusing results, intermittents, flickery tests, 'sploding demo sessions. 95% are easy, but 4% are hard, an 1% are "Sev 1 all hands on deck".
But they are *usually* cheap, some of the easiest bugs & fixes we encounter. The problem, of course, is that they happen just often enough that they slow us, but not often enough that we take a hard look at what we're doing.
What *are* we doing? We're violating three different pieces of advice: "Don't Repeat Yourself (DRY)", "Reduce Mental Bandwidth", and "Easiest Nearest Owwie First (ENOF)". We're doing a hat-trick of bad habits here.
"Don't Repeat Yourself" is a heuristic that tells us to avoid duplication, because if there are two places to keep the same code or data, we will forever after be required to keep them in sync.
"Reduce Mental Bandwidth" is telling us that the most common answer to these problems, which is "everyone remember to always change or check both of these profiles at the same time", is putting a burden on the human brain that it can't reliably bear.
"Easiest Nearest Owwie First" is saying that, even though there are bigger problems than misconfiguration, we still want to fix misconfiguration, because it's within our reach, it's easy, and it's an owwie.
There are several possible ways to kill off misconfigurations like these. But the one I like the most is one people seem to implement the least: use a shared resource to make config simpler to do, simpler to control, simpler to version, and simpler to test. Here's how it works.
Create a repo with code contents that are one way (or more, see below) to make filled-out non-primitive Configuration objects based on simple function calls or even just keywords. Write your project to use those instead of ASCII config profiles.
Detail: The configuration-making is purpose-built to supply only legitimate configurations. In most environments, there are fewer than a dozen of these, tho configuration-by-string lets you create thousands or millions of broken ones.
Detail: We said "one way (or more)". All of our programs aren't written in the same language. No worry, your repo can have one in the backend language, one in the frontend, one for that weird old thing written in caveman days, one for those cutting-edge bozos over there.
Detail: Why non-primitive? This is a very long conversation, and we're just going to have to work on it another time. The too-long-didn't-write: so we can give it custom behavior when we want that, which we will.
There are several real benefits to this kind of approach -- honestly, to *most* of the competitor ideas, anything that isn't "same strings in many files" -- so let's list a few of them.
1) It's cheap. Adding a repo, writing a first pass at a Configuration, these are not rocket-science designs, but very basic stuff, especially in the beginning.
2) It's testable. Since I have all and only the legal Configurations for all my apps, I can roll tests around all of the decision-making process and its resulting values, long before a client app ever gets deployed.
3) It's iterable and incremental. Programs can be stepped over to using this one app or even one value at a time. This is a huge benefit, because we get value not once, at the end, but distributed, every time we take a step.
4) It makes the implicit explicit, nearly always a winning move in geekery. Config-by-profile has lots of implicit rules. We can put those rules directly into our Configuration scheme, express them in code, and prove that they aren't violated.
Two of my recurring themes are triggered by all this: 1) It's this way because we built it this way. 2) The code works for us, we don't work for the code. This is a really straightforward case, the problem from theme 1, the solution from theme 2.
We *chose* untested by-hand ASCII configuration profiles. We didn't have to, but we did. With a scheme like this one, or any of the other ideas with similar values, we are making the code work for us.
So think it over! I can't give you up-close details cuz I'm not in your codebase. But I can tell you, it's actually pretty easy. The hard part of this, as so often, isn't implementing an answer, it's looking for it in the first place.
A shared library for configuration is a way to kill off a bunch of small, annoying, persistent problems, in development, in testing, and in production. It's not free, but it's cheap, and it pays off well and rapidly. Queue up a spike and give it a try!
Thanks for reading along, a short one today. Subcribe! It's free, spam-free, and you get full-text or audio.

geepawhill.org/subscribe

And folks, please embrace change *outside* the monitor. We can fix this, we're the only thing that can.

Black Lives Matter.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with GeePaw Hill

GeePaw Hill Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @GeePawHill

1 May
#lazyweb There's a very large piece of street art, a mural, up on a second story corner indentation of a building. It has an elephant as the subject. The elephant is framed by the walls of othe building, but not in an ordinary rectangle.

I need that image.
As I remember, the elephant is on a split-level, with one leg down half-a-level, and the rest of its body quite tall and narrow. The building surfaces themselves have coloration that creates the odd frame.
It is *not*, as far as I recall, the more common "elephant coming through a wall" motif.
Read 6 tweets
1 May
Richie Havens, "God Bless the Child".

There must be ten million GBTC's.

I love me my Billie, but her take is so personal, so Billie-to-Billie.

This one.

It slides past my so carefully erected defenses.
Embarrassingly enough, I only heard it the first time about ten years ago.
Read 7 tweets
1 May
Bruce Springsteen: "Incident on 57th Street".
The Boss is world-famous, of course, nowadays. But in the early takes, you get to hear the exuberant Dylan-esque poet.
This a songwriter *exploding* with jjuice, connecting it to poetic technique. There are wild feminine rhymes here, glorious, and then crazy post-rhyme throwaways. Then spiraling to the heart.
Read 6 tweets
1 May
Rolling Stones, "Paint It Black".

Underrated.
Generally, cuz of their fame, the Stones are underrated for their considerable skillz. These guys were *tight*. The tightest performers of the rock era were the various Clapton bands, I give you that, and it's really the only thing I give Clapton. But this is *tight*.
Read 4 tweets
30 Apr
"I think maybe I got a test for that."

Sometimes, you see a problem in prod, it's a corner case, and you have to puzzle a little about how you'd test to see if your current diagnosis-hypothesis is right.
I bring it up, cuz I just did it.

TDD isn't about not making mistakes. Obviously, I'd've preferred if I'd thought of that test already. But I didn't, and it is what it is.

Now I'll go write the test. Further bulletins as events warrant.
New test name is "backtrack from first move is not why we can't have nice things".
Read 9 tweets
25 Apr
When large teams struggle with trunk-based development (TBD) or continuous integration/deployment (CI/CD), a good strategy is to re-orient how the teams face "backsteps", moments in our workflow where a discovery forces us to re-open a stage we thought was closed.
It's been a hard stretch for those of us seeking peace and equity. I offer this geekery not to suggest it matters as much as that does, but only to give us a little respite.

Stay safe, stay strong, stay angry, stay kind.

Black Lives Matter.
Large teams & projects often pre-date the use of modern synthesis techniques like TBD or CD, and during adoption, intermixing their Before with this new After can produce quite a bit of discomfort. If it gets bad enough, it can even kill off the improvement effort. What to do?
Read 34 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!