Why Shared State and Shared Knowledge Fail for the Same Reason
Hatched by tfc
Jul 26, 2026
10 min read
1 views
87%
When Two Things Must Stay in Sync, Duplication Becomes a Liability
What do a user interface and a large knowledge system have in common? More than it first appears. In both cases, the hardest bugs do not come from missing information, but from duplicated information that drifts out of sync. The moment two components, or two systems, both believe they own the truth, reality starts to split.
This is why a simple design principle in software carries a much broader lesson: if two things must always change together, they should not each maintain their own version of the state. One place should own it. Everything else should read from that source and reflect it faithfully.
That idea sounds technical, but it is really about governance. It asks a deeper question: where should truth live when many parts need it, but only one should define it?
The answer is not always centralization for its own sake. It is something more precise. A system becomes healthier when it distinguishes between ownership and visibility. One place decides what is true. Many places can display, query, and act on it.
The Hidden Cost of Copying Truth
Duplication feels efficient at first. If each part of a system keeps its own copy of the information it needs, then each part can move quickly and independently. But duplication has a built-in tax: every copy creates a new opportunity for inconsistency. The more copies you make, the more your system relies on perfect synchronization, and perfect synchronization is a fantasy under real conditions.
Imagine a calendar app with two views of the same meeting time. If one view lets you edit the time and the other also stores its own version, which one is correct after a change? If both are allowed to answer, then the system has no real answer. You have not built flexibility. You have built ambiguity.
The same thing happens in knowledge systems. A search tool might index thousands of files, summarize them, rerank them, rewrite queries, and stream results back to the user. That is powerful, but it introduces a danger: multiple representations of the same information can easily diverge. A document exists in one form, a chunk exists in another, a retrieval ranking exists in a third, and the user sees a fourth. Unless there is a clear source of truth, the system begins to behave like a committee that has forgotten who is chairing the meeting.
This is why the principle of a single source of truth matters so much. It is not a bureaucratic slogan. It is an anti-fragility mechanism. It reduces the surface area for contradiction.
The more places a fact can be edited, the less certain the system becomes about what the fact is.
A useful mental model here is to distinguish between state and views. State is the authoritative fact. Views are the shaped versions of that fact, tailored for different consumers. Problems begin when a view starts pretending it is state. That is when interfaces lie, dashboards disagree, and trust erodes.
Why Central Ownership Is Not the Same as Centralized Control
It is easy to misunderstand this principle as a call for rigid centralization. It is not. A system does not need one giant repository for everything. It needs a clear rule for each unit of truth: one owner, many consumers.
That nuance matters. A family of related facts can have different owners. One component may own a temperature setting, another may own a search query, a third may own a selected file. Likewise, a knowledge platform may have separate authoritative stores for raw files, processed embeddings, access permissions, and user annotations. The point is not to collapse all complexity into a single bucket. The point is to prevent ambiguity about which layer is responsible for what.
Think of this like a city. The city has many neighborhoods, each with local activity, but there is one legal address for each building. Delivery services, emergency responders, and utilities can all interact with that address, but nobody invents a second official address just because it would be convenient in the moment. The address is not the only thing that matters, but it is the one thing everyone can rely on.
Modern software systems increasingly behave like cities of information. Search, retrieval, streaming, ranking, caching, permissions, and user interfaces all need access to the same underlying truths, but they do not all need to own them. In fact, they function best when most of them do not.
This leads to an important distinction: ownership is not about control over every use, but control over change. The owner is the place where updates happen. Other parts can transform, present, filter, or transport the state, but they should not invent parallel realities.
That is why a system can support advanced capabilities, like streaming responses and large scale retrieval, without sacrificing coherence. The more powerful the distribution of information becomes, the more important its point of origin is.
Retrieval Is Just State Management at a Larger Scale
At first glance, user interface state and document retrieval seem like different worlds. One is about buttons, sliders, and panels. The other is about search, embeddings, and files. But both are fundamentally about how distributed parts stay aligned around one truth.
A user interface component may want to display whether a sidebar is open. A retrieval system may want to surface the most relevant passages from a corpus of files. In both cases, multiple consumers need access to a shared reality, but only one locus should decide that reality.
This similarity becomes clearer if you think of retrieval as a kind of state projection. A file search system does not merely store documents. It continuously transforms them into searchable representations, then returns slices of them to different requests. That means the system must answer a question very similar to the one in component design: where does the authoritative version live, and what can be derived from it?
Suppose an assistant can ingest 10,000 files. That scale creates a new temptation. Because there are so many documents, it becomes easy to treat the indexes, summaries, and search results as the thing itself. But they are not the thing. They are only projections. If a user edits the underlying file, the index must eventually reflect that change. If a permission changes, retrieval must respect it. If the system rewrites a query for better search performance, that rewritten query is still not the user’s original intent.
The deeper lesson is that retrieval systems need ownership boundaries just as much as component trees do. Raw content owns being raw content. Indexes own being indices. Search results own being search results. None of them should silently mutate the authority of the others.
This is where the phrase lifting state up becomes a larger architectural idea. Sometimes the right move is not to replicate knowledge at the edges, but to move the decisive version closer to where coordination happens. In software, that may mean a parent component. In knowledge systems, that may mean a canonical store, a vector store, or a metadata layer that all consumers consult.
What matters is not the specific technology. What matters is the topology of truth.
The Real Problem: Not Sharing, But Synchronizing
People often say they need to “share” data. But sharing is not the hard part. Synchronizing independent copies is the hard part. And synchronization costs rise nonlinearly as systems grow more interactive.
This is why many systems that look decentralized on the surface still require a hidden center. The UI may feel modular. The search pipeline may feel distributed. The assistant may feel conversational. But somewhere, there must be a source that answers, “What is the current value?” Without that, all the sophistication in the world merely accelerates confusion.
Here is a useful framework:
- Ownership: Who is allowed to change the truth?
- Projection: Where is that truth rendered for others?
- Derivation: What can be computed from the truth rather than stored separately?
- Synchronization: What mechanisms keep derived forms current?
- Conflict resolution: What happens when two views disagree?
Most engineering mistakes happen when these roles are blurred. A cache starts acting like a database. A search result starts acting like a record. A child component starts acting like a second editor for state it does not own. The immediate effect may be convenience, but the long term effect is loss of clarity.
A powerful system is not one that stores everything everywhere. It is one that makes it obvious which layers are allowed to change reality and which layers are only allowed to describe it.
Good architecture is not about eliminating all duplication. It is about making duplication harmless by ensuring it is derived, not authoritative.
That distinction is the difference between a dashboard and a ledger. A dashboard may repeat numbers from many places, but the ledger is where they are entered. If a dashboard begins editing the numbers, the organization is in trouble.
A Practical Rule: One Truth, Many Shapes
If there is one design principle worth carrying across interfaces, databases, retrieval systems, and AI assistants, it is this: one truth can appear in many shapes, but it should be born in only one place.
That rule does not eliminate complexity. It organizes it.
A component tree benefits because each component can focus on its own job instead of guessing about shared state. A retrieval pipeline benefits because each stage can specialize without pretending to be the source. A product team benefits because the team knows where a value lives, who may update it, and what downstream systems depend on it.
This also changes how you think about performance. The instinct to duplicate often comes from speed concerns. People worry that asking a central owner for truth will be too slow, so they copy the truth locally. But most performance problems are not solved by creating more authorities. They are solved by creating better projections, better caching rules, better streaming, and better access patterns, while preserving a clear origin.
That is why modern systems invest in helpers for streaming, polling, reranking, and query rewriting. These are not replacements for truth. They are mechanisms for making truth usable at scale. The same logic applies in a UI. Derived state, memoized views, and event handlers are useful only when they serve a known owner rather than spawning independent versions of reality.
A concise way to remember this is:
Do not duplicate what you can derive. Do not derive what you must own.
That sentence captures a design ethic that spans from component architecture to AI retrieval. It tells you where to be strict and where to be flexible.
Key Takeaways
- Assign one owner for each unique piece of truth. If something can be edited in multiple places, inconsistency is inevitable.
- Treat copies as views, not sources. A search result, cache, or UI widget should reflect reality, not redefine it.
- Distinguish ownership from visibility. Many systems can read the same state, but only one should control updates.
- Prefer derivation over duplication. If a value can be computed from canonical data, do not store a competing version unless you truly need to.
- Audit your system for hidden second sources of truth. The most dangerous bugs often come from places that quietly act like authorities without being named as such.
The Deeper Reframe: Truth Is an Architecture Choice
We often talk about truth as if it is discovered, when in practice it is also designed. Every system makes decisions about where facts live, who can change them, and how they are distributed. Those decisions shape reliability more than any individual feature does.
This is why the connection between component state and retrieval infrastructure is not superficial. Both reveal the same structural insight: the health of a system depends on whether its many parts agree on what is real.
The most elegant systems are not the ones with the fewest moving parts. They are the ones in which movement does not create contradiction. A component can update. A search engine can stream. A knowledge base can scale to thousands of files. But underneath all that motion, truth remains singular enough to be trusted.
And that may be the most important design lesson of all: the goal is not to eliminate change, but to ensure that change has a home. Once you know where truth lives, everything else can finally move without lying.
Sources
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 🐣