AW Dev Rethought

✂️ Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away - Antoine de Saint-Exupéry

Systems Realities: The Illusion of Control in Distributed Systems


Single-process programming trains you in control. You call a function, it runs, it returns, the state changed. The sequence is reliable enough that you stop noticing it’s a sequence at all.

Then you put a network in the middle and keep writing the same code, because the syntax didn’t change. await userService.deleteAccount(id) looks exactly like a function call. It is not one. It’s a message sent into a system you do not control, followed by a period of waiting, followed by either an answer or the absence of one.

Most production incidents in distributed systems come from code written by someone who still believed they were in charge.


A Timeout Is Not a Cancellation

You set a 5-second timeout. The call exceeds it. Your client gives up and moves on.

Nothing happened on the other side. The server didn’t receive a cancellation, doesn’t know you left, and is very likely still working on your request — and will finish it, successfully, some time after you concluded it failed.

A timeout is a decision about how long you wait. It is not an instruction to stop.

This is where duplicate charges come from. Client times out, retries, server completes both. Two orders, one customer, and a support ticket that takes a week to explain because the logs show two legitimate successful requests.

The uncomfortable part is that there’s often no mechanism to do better. Cancellation across a network requires the other side to cooperate, check for the cancellation, and be at a point where stopping is safe. Most services implement none of that. Your timeout protects your thread pool. It protects nothing else.


You Cannot Know If the Write Landed

The connection drops after you send a write. Did it commit?

You cannot tell. A failure before the server processed it and a failure after it committed but before the acknowledgement reached you are, from your position, identical. No amount of care in your client makes those two distinguishable, because the information you’d need never arrived.

You have three possible outcomes and code written for two.

Almost all application code is written for success and failure. The third state — unknown — is where the bugs live, and it isn’t rare. It happens every deploy, every network blip, every time a pod gets evicted mid-request.

The only real defence is making the question unnecessary. If the operation is idempotent and carries a client-generated key, you can retry without knowing, because a duplicate is harmless. That isn’t a nice-to-have on payment and provisioning paths. It’s the difference between a system that degrades and one that corrupts.


“Delete” Is a Process, Not an Event

You delete the row. For a moment, it’s gone.

Except the read replica still serves it for another 200 milliseconds. The application cache holds it until its TTL expires. The CDN has it for an hour. A user’s open browser tab has it until they refresh. The search index gets around to it on the next sync. The nightly backup will hold it for ninety days. The analytics warehouse copied it last week and has no idea anything changed.

You didn’t delete a thing. You initiated a convergence, and the system will approach a state where that record is absent, over a period you didn’t choose and can’t fully enumerate.

This is the gap that makes data deletion requests legally interesting and operationally miserable. “Deleted” in the primary database is a fact about one system, stated with a confidence that spans none of the others.


Every Leader Is Only a Belief

You run leader election so exactly one node performs the critical work. During a network partition, two nodes can simultaneously believe they hold the lease — one because it still does, one because it can’t reach the thing that would tell it otherwise.

Both are acting in good faith. Both are wrong about the same fact.

This is why fencing tokens exist. The leader doesn’t assert leadership; it presents a monotonically increasing number with every write, and the storage layer rejects anything carrying a stale one. The system stops trusting the claim and starts checking it, because “I am the leader” was never knowledge — it was a belief held locally with no way to validate it at the moment of action.

Clocks fail the same way. now() on two machines disagrees, sometimes by seconds. Ordering events by timestamp orders them by what each machine believed the time was, which is why distributed systems that care about ordering use logical clocks instead of wall time.


The RPC Is the Lie

Step back and the pattern is one thing: a programming model that hides a message exchange behind the syntax of a function call.

A function call gives you control. It runs, it returns, and if it didn’t return you’d know because you’d have crashed. An RPC gives you none of that and looks identical in the editor. Every remote call is really send-message, hope, wait, then either interpret a response or interpret silence. We invented the syntax to make remote work feel local, and it succeeded so completely that engineers write remote code with local assumptions for years before an incident teaches them otherwise.

The abstraction isn’t wrong to exist. It’s that it hides precisely the thing you need to reason about — the gap between what you asked for and what you know.


Build for Three Outcomes

What changes if you take this seriously.

Treat unknown as a first-class state in your data model, not an error branch. An order that might be paid needs a status that says so — pending_confirmation — and a process that resolves it, rather than code that guesses.

Make every operation that crosses a boundary idempotent, with a key the caller generates. Then retrying is free, and “did it land” stops being a question you need answered.

Prefer reconciliation to commands. A command assumes control: do this thing, now. A reconciliation loop assumes the opposite — here is the desired state, check continuously, converge. That’s the whole insight behind Kubernetes controllers, and it works because it never requires any single instruction to have succeeded.

And when you write something that calls across a network, read it back and ask one question: what does this code do if the response never arrives? If the answer is “I don’t know,” you’ve found the next incident early.


50 Machine Learning Algorithms Cheatsheet Most downloaded free PDF 50 Machine Learning Algorithms Cheatsheet Blueprints of Intelligence — 50 ML Algorithms decoded Download free Downloaded 469 times

If this article helped you, you can support my work on AW Dev Rethought.


Rethought Relay:
Link copied!

Enjoyed this post?

Stay in the loop

New posts + weekly digest, straight to your inbox.

or

Create a free account

  • Save posts to your vault
  • Like posts & build history
  • New-post alerts

Comments

Add Your Comment

Comment Added!


Evalora: Collect feedback from your teams & staff
AD

Evalora: Collect feedback from your teams & staff

Evalora lets you build a form, share the link or QR code, and see verified results. For companies, training teams and institutions. Free plan available.

Start free