The Single Source of Truth Is Not a Place, It Is a Discipline

tfc

Hatched by tfc

May 14, 2026

9 min read

84%

0

The Hidden Problem Behind Every Fast System

What do a React component tree and a cloud feature flag system have in common? At first glance, almost nothing. One helps you decide where UI state should live. The other lets you change service behavior at runtime without redeploying code. But both are answering the same deeper question: where should truth live when change is inevitable?

That question sits underneath almost every modern software system. We build abstractions to make change safe, but the moment a system starts changing in more than one place, we introduce a new kind of risk: not just bugs, but disagreement. Two parts of the system believe different things. A button thinks the feature is off while the backend thinks it is on. Two sibling components each hold their own copy of the selected tab. A service has already switched behavior, but a deployment pipeline still assumes the old world.

The real challenge is not simply storing state. It is deciding who gets to decide, when, and for how long. That is why these two ideas belong together. Lifting state up in a UI and centralizing feature flag control in runtime infrastructure are both expressions of the same design principle: if a piece of reality must be shared, give it one owner.

Why Duplication Feels Fast Until It Becomes Expensive

Engineers often duplicate state for the same reason people make private copies of important documents: it feels safer and faster. A component keeps its own local version because it is convenient. A service embeds a configuration value because it wants autonomy. A team hardcodes a temporary behavior because shipping now matters more than coordination.

In the short term, duplication creates the illusion of speed. There is no extra wiring, no shared dependency, no coordination cost. But that speed is borrowed. Eventually the copies drift, and drift is where complexity lives.

Consider a simple UI with two panels that must show the same selected item. If each panel owns its own selection state, one panel can change while the other stays stale. The user sees a contradiction inside a single screen. The fix is not to make both panels smarter. The fix is to move the state to the nearest common parent, so both panels receive the same truth.

Now translate that to infrastructure. A feature flag decides whether a new pricing algorithm is active. If the flag is duplicated across multiple services, each copy becomes a potential source of inconsistency. One service may roll forward, another may lag behind, and a third may interpret the flag differently altogether. The result is not just a configuration problem. It is a broken mental model of the system.

Distributed systems are not only about distributing compute. They are about distributing agreement.

Once you see that, a feature flag stops looking like a simple toggle. It becomes a governance mechanism for reality. It answers a question every actor in the system needs to ask the same way: what is true right now?

Lifting State Up Is Really About Aligning Authority

The phrase “lifting state up” sounds like a UI implementation detail, but it is really a theory of authority. If two components need to stay in sync, neither should be the ultimate authority. Their parent should be.

That parent is not just a container. It is the single source of truth, the place where shared meaning becomes explicit. This matters because state is never just data. State is permission to act. The component that owns a value also owns the right to change it, and that right must be clearly assigned or the system becomes ambiguous.

This is why the principle scales beyond React. The same logic appears in product workflows, data pipelines, and runtime configuration. If multiple places can alter a shared fact, you do not have redundancy. You have competing governance.

Think of a restaurant kitchen. If every station independently updates the night’s special, you get chaos. The expeditor or head chef holds the authoritative board because everyone else needs a shared, current truth. The board is not there to centralize power for its own sake. It is there to prevent contradictory execution.

Feature flags introduce a similar need for authority, but with an important twist: the truth must not only be shared, it must also be changeable without redeploying. That requirement transforms the design problem. Now the question is not just where truth lives, but how truth can be revised safely in motion.

That is where runtime flagging becomes so powerful. It turns configuration into a living system rather than a frozen artifact. But the benefit only appears if the authority is cleanly defined. If flags are scattered across codebases, config files, and environment variables with no clear owner, runtime flexibility becomes runtime confusion.

The Deeper Synthesis: Shared State Needs a Parent, Shared Behavior Needs a Governor

Here is the unifying insight: shared state and shared behavior are the same problem at different layers.

In a component tree, shared state belongs in the nearest common parent. In a service architecture, shared behavior belongs in a central, queryable control plane. In both cases, the goal is not centralization for its own sake. It is coherence. Coherence means every participant can safely infer the same reality from the same source.

This is why feature flags and lifted state are not merely adjacent ideas. They are manifestations of a deeper architectural instinct: when the system is dynamic, authority must be explicit. Otherwise, every local optimization becomes a hidden fork in the truth.

A useful mental model is to distinguish between three kinds of truth:

  1. Local truth: what a component or service knows for itself.
  2. Shared truth: what multiple actors must agree on.
  3. Policy truth: how and when shared truth is allowed to change.

React state lifting is about converting local truth into shared truth when synchronization matters. Feature flag platforms are about making policy truth externally controllable so shared truth can evolve without code changes. Together, they suggest a design discipline: make the source of truth as close as possible to the scope of agreement, and make the policy for change as close as possible to the people responsible for the change.

That is a subtle but powerful distinction. Not every truth should be global. Not every flag should be shared everywhere. The right owner depends on the domain of agreement. A toggle for a button label can live high in the component tree but need not leak into the entire app. A kill switch for a production service may need to be centralized, but only within a bounded operational domain. The question is always: who needs to agree, and what happens if they do not?

Runtime Change Without Runtime Drift

The promise of feature flags is seductive: change behavior in production without redeploying. This can improve CI/CD, decouple releases from launches, and create safer rollouts. But runtime change has a hidden cost: the more dynamic the system becomes, the easier it is for the system’s parts to inhabit different versions of reality.

That is why the best flag systems are not just switches. They are controlled narratives of state. They tell services what is on, what is off, for whom, and until when. When those conditions are explicit, runtime flexibility becomes a strength rather than a source of entropy.

Imagine a mobile app where the checkout flow is controlled by a flag. If the UI changes but the backend eligibility logic does not, users may see a button that leads nowhere. Or imagine a customer support tool where one component reflects a new pricing rule while another still displays the old rate. The system has not merely become inconsistent. It has become untrustworthy.

This is why runtime configuration needs the same discipline as component state. The more places a fact can be read or changed, the more important it is to establish a canonical owner and a clear propagation path. In React, that path is props flowing downward from the parent. In infrastructure, it is a centralized flag service or configuration layer propagating state to consumers.

The deeper lesson is that change management is an architectural primitive, not a release tactic. A system that can change safely is not just one with good deployment tooling. It is one with carefully designed truth boundaries.

A Practical Framework: Ask Three Questions About Every Piece of State

To apply this idea, stop treating all state as interchangeable. Before deciding where a piece of state lives, ask three questions.

1. Who must agree on this value?

If only one component needs it, keep it local. If multiple components must stay aligned, lift it up. If multiple services must coordinate, move it into a shared control plane or configuration authority.

2. How costly is inconsistency?

If disagreement creates a minor visual glitch, local state may be acceptable. If disagreement can break billing, authorization, or rollout safety, duplication is dangerous. The higher the cost of drift, the stronger the case for a single source of truth.

3. How often should this value change, and by whom?

A value that changes frequently and operationally, such as a feature flag, should be easy to update without redeploying. A value that changes rarely may be better encoded in code or schema. Authority should match the velocity of change.

These questions reveal a useful principle: state ownership should follow the shape of coordination. The more coordination a value requires, the less local it should be.

That also means the idea of “one source of truth” should not be misunderstood as a call for monoliths. It is not about putting everything in one database, one component, or one admin console. It is about ensuring that each meaningful fact has one authoritative owner, even if the system as a whole is highly distributed.

Key Takeaways

  • Do not duplicate shared state just because it is convenient. Convenience today can become drift tomorrow.
  • Assign one owner per piece of truth. In UI, that may be a common parent component. In infrastructure, that may be a centralized configuration or flag service.
  • Separate local state from shared truth. Not every value needs to be lifted. Only values that must stay in sync do.
  • Treat feature flags as governance, not just toggles. They define how behavior changes in production, so their ownership and propagation matter.
  • Use inconsistency as a diagnostic signal. If two parts of a system disagree, that is often a sign the truth boundary is in the wrong place.

Conclusion: Truth Is a Design Choice

The most interesting connection between lifting state in React and runtime feature flags in infrastructure is not technical, it is philosophical. Both are answers to the same uncomfortable fact: systems break when truth is ambiguous.

When engineers say a component should not own shared state, they are really saying that authority should match the scope of coordination. When operations teams centralize feature control, they are saying that behavioral change should have a visible, governable source. In both cases, the goal is not fewer moving parts. It is fewer competing realities.

So perhaps the real question is not, “Where should this state go?” The deeper question is, “Who should be allowed to define what is true, and how will everyone else know?” Once you start asking that, architecture looks less like plumbing and more like a theory of agreement.

And that is the part worth remembering: the best systems do not merely store state. They preserve shared reality as they change.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣