prosimpuprov
prosimpuprov.com
Contact me
// PROSIMPUROV · [05.0] NOTES FIELD NOTES

Things prosimpuprov.com learned the expensive way

Short notes from real engagements, written for the engineer who is about to have the same week I had. prosimpuprov.com publishes them because somebody always asks me the same question in the first call, and writing it down once is cheaper than explaining it every time.

Index/Field notes
Laptop showing infrastructure code in an editor on a light desk
[N 01] INFRASTRUCTURE AS CODE

Your environment is not infrastructure until you can destroy it

The cheapest test of an infrastructure setup is to tear it down and rebuild it, which is the first thing prosimpuprov.com asks permission to do. If nobody on the team can do that in an afternoon, what you have is a photograph of an environment — and photographs go stale quietly, usually at the moment you need them.

When I take over a project, the first thing I ask for is permission to rebuild a non-critical environment from scratch. It is astonishing how many problems that single afternoon exposes: a database provisioned by hand, a security group opened during one incident in 2022 and never closed, a bucket policy that nobody remembers writing.

Three questions make the difference. Can a new engineer get a working environment today without asking anyone? Is every resource that costs money declared in version control? Is there a known way to find the things that are not declared?

If the answer to the third question is "log into the console and look", that is the first thing to fix. I usually start with a read-only inventory script that lists every resource in every account, tagged with who created it and when. It is unglamorous work and it saves weeks.

The practical habit I recommend: rebuild an environment every quarter, on purpose, without warning. If it takes longer than a couple of hours, the definitions have drifted from reality and something is being managed outside of version control. That is the moment to fix it — while nothing is on fire.

Printed incident timeline on graph paper with a pen and cables
[N 02] INCIDENTS

The timeline matters more than the root cause

Most incident reviews spend ninety per cent of their time arguing about the cause and almost none on the timeline. That is backwards. The cause is frequently a known risk that someone accepted; the timeline is what tells you whether you would have caught it sooner.

When I run a review, the first thing I draw is three horizontal lines: when the system actually broke, when the metrics showed it, and when a human noticed. The distance between the second and third lines is the interesting part, because that gap is where your monitoring either earned its keep or did not.

If the gap is large, the problem is not alerting policy — it is that the signal does not exist yet. I write one new metric before changing any threshold, because a threshold on a metric that does not exist is a rule that never fires.

Second habit: write the timeline while it is fresh, not the week after. Memory is generous in the direction that flatters the response and unkind to the person who did not notice immediately. The timeline written during the incident is the most honest one you will ever get.

Third habit: keep a running list of things that were done during the incident but should not have been necessary. That list, reviewed quarterly, is usually the cheapest source of engineering work I know of. It contains manual steps, temporary patches and scripts somebody ran once and then forgot about.

Database console showing a list of slow queries
[N 03] DATABASES

The slow query is usually an index, sometimes a habit

Before you add a cache, find out what the database is actually doing. A surprising share of "the API is slow" tickets end with the same finding: one query scans a table that grew by two million rows since the feature launched.

My routine is boring and it works. Pull the top ten slowest queries from the logs, look at their plans, and check whether the ones that scan are scanning because of a missing index, a missing predicate, or code that fetches rows it then throws away.

The third case is the interesting one, because it is a design problem disguised as a performance problem. Fetching a row and discarding nine of its columns usually means two queries want to be one — and merging them often removes the latency entirely.

Add indexes carefully. An index is a promise that you will keep that column useful, and it costs you write throughput and storage. When I add one, I add it with the query that needs it, in the same commit, and I write down the reasoning in a comment. A year later, somebody will want to drop that column, and the comment is what stops them.

Finally: measure before and after, with the same query and the same data volume. "It feels faster" is not a result, and it will not survive the next review when the ticket reopens.

"If nobody on the team can rebuild the environment from a file, you do not have infrastructure — you have a photograph of one."