Datom.World and the Collapse of the Wave Function
The Observation
DaoDB is a local-first distributed tuple store. When a device operates in isolation, it maintains its own complete database. But when devices entangle into a synchronization group, something profound happens: each device holds only a partial view of the whole state.
No single device in an entanglement group possesses the complete database. Together, all devices collectively maintain the total state. The information is preserved across the system—this is quantum unitarity—but distributed among observers, not concentrated in any one place.
When devices sync, they encounter conflicting local states—the same entity modified differently by disconnected observers. This sounds like a bug. A design flaw. Something to fix with clever algorithms.
But what if it's not a bug at all? What if distributed databases are quantum systems, and conflicts are wave function collapse?
Relational Quantum Mechanics (RQM) says there is no global state—only local states relative to observers. When two observers interact, their local states entangle. The "collapse" is just correlation between observers, not a global event.
This is exactly how DaoDB works. DaoDB is an implementation of RQM.
What Is Relational Quantum Mechanics?
Relational Quantum Mechanics (RQM), proposed by Carlo Rovelli, is a radical interpretation of quantum mechanics:
The Core Claim
There is no observer-independent state of the universe.
All properties of a system are relative to the observer. What you measure depends on your interaction with the system, not some global "true" state.
Example: Schrödinger's cat is neither alive nor dead from an external perspective. From your perspective (before you open the box), it's in superposition. From the cat's perspective (inside the box), it has a definite state. Both are correct, relative to their own reference frame.
Key Principles
- All systems are quantum — Even macroscopic observers like humans or databases
- States are relational — Properties exist only relative to an observer
- No global state — There's no "view from nowhere"
- Collapse is correlation — Measurement creates entanglement between observer and system
- Locality — Information propagates at finite speed (no spooky action)
The Radical Implication
Two observers can have different, incompatible views of the same system, and both are correct. There's no contradiction because reality is relational, not absolute.
Observer A sees the electron spin-up. Observer B sees it spin-down. Both measurements are real relative to each observer. When A and B compare notes (interact), their states entangle, and they agree on a correlated outcome—but there was never a moment when the electron had a global, observer-independent spin.
DaoDB as a Quantum System
Now consider DaoDB:
Unitarity: Partial States, Complete System
In quantum mechanics, unitarity means the total information in the system is preserved. The wave function never loses information—it only evolves.
In DaoDB, when devices form an entanglement group (a sync network), unitarity manifests as distributed partial states—similar to RAID 5 storage arrays.
The RAID 5 Analogy
In RAID 5, data is striped across multiple disks with parity information:
Disk 1: [A1, A2, _, P4] ; Holds data blocks + parity
Disk 2: [B1, _, P3, B4] ; Different blocks + parity
Disk 3: [_, C2, C3, C4] ; Different blocks + parity
No single disk has complete data.
But ANY 2 disks can reconstruct the complete state.
Total information = distributed across array (unitary).No single disk contains the complete data, yet the total information is preserved across the array. Any N-1 disks can reconstruct the whole. This is distributed unitarity.
DaoDB's Distributed Unitarity
DaoDB implements the same principle:
Isolated Device A (complete state):
[entity-1 :name "Alice" :tx 100]
[entity-1 :age 30 :tx 100]
[entity-2 :name "Bob" :tx 100]
[entity-2 :age 35 :tx 100]
Device A joins entanglement group → holds partial state:
[entity-1 :name "Alice" :tx 100]
[entity-1 :age 30 :tx 100]
; entity-2 is now on Device B
Device B (partial state):
[entity-2 :name "Bob" :tx 100]
[entity-2 :age 35 :tx 100]
Total system state = Device A + Device B (unitary)No single device has the complete picture—just like no single RAID disk has all the data. But the total information is preserved across the entanglement group.
The Critical Difference: No Redundancy
Here's where the RAID 5 analogy breaks down. RAID 5 has parity redundancy:
RAID 5 with redundancy:
Disk 1: A1
Disk 2: A2
Disk 3: P (parity = A1 XOR A2)
If Disk 1 fails → A1 = P XOR A2 (reconstructable)
Information is DUPLICATED via parity.But in true quantum unitarity, there is NO redundancy:
Quantum entangled particles:
Particle A: ↑ or ↓ (maximum uncertainty, 50/50)
Particle B: ↑ or ↓ (maximum uncertainty, 50/50)
Joint state: |ψ⟩ = (|↑↓⟩ - |↓↑⟩)/√2 (perfectly defined!)
Neither particle contains 'half the information.'
Each particle is maximally uncertain.
Information exists in the CORRELATION, not in copies.This is the no-cloning theorem: quantum information cannot be duplicated. The information exists in the correlations between observers, not in redundant copies.
DaoDB's Two Modes
DaoDB can operate in two distinct modes:
Mode 1: Pure Quantum (No Redundancy)
Device A: [entity-1 :name "Alice"]
Device B: [entity-2 :name "Bob"]
Device C: [entity-3 :name "Carol"]
Each device holds UNIQUE data.
Total information = A + B + C
No redundancy. Pure unitarity.
No fault tolerance—lose a device, lose that data.Mode 2: CRDT Replication (With Redundancy)
Device A: [entity-1] + [entity-2 replica]
Device B: [entity-1 replica] + [entity-2]
CRDTs allow intentional replication.
Fault-tolerant—can lose one device.
This is RAID-like, not pure quantum.The quantum analogy is strongest in Mode 1. Each device holds a unique partial state. Information exists in the distributed correlations, not in copies. The total state is preserved (unitary), but there's no redundancy.
Mode 2 sacrifices pure quantum unitarity for fault tolerance. CRDTs replicate data, creating redundancy. This is more like RAID 5 or traditional distributed databases.
DaoDB supports both: pure quantum distribution (maximum efficiency, no redundancy) and fault-tolerant replication (redundancy for availability). The choice depends on whether you prioritize quantum-like efficiency or traditional fault tolerance.
When isolated: complete local database. When entangled in Mode 1: partial view with no redundancy, information in correlations. When entangled in Mode 2: partial view with CRDT replication for fault tolerance.
Local-First Architecture
Each device is an observer maintaining its own local view of reality. There is no central authority. No global state coordinator.
Device A (Alice's phone) - partial view:
[entity-1 :name "Alice" :tx 100]
[entity-1 :age 30 :tx 100]
Device B (Bob's laptop) - partial view:
[entity-1 :name "Alice" :tx 100]
[entity-1 :age 30 :tx 100]
Both share entity-1. Unitarity: total state distributed.Offline Divergence = Superposition
Alice goes offline. Bob goes offline. They both modify entity-1 independently:
Device A (offline):
[entity-1 :age 31 :tx 101] ; Alice's birthday
Device B (offline):
[entity-1 :age 29 :tx 102] ; Bob corrected a mistakeFrom a global perspective, entity-1 is in superposition:
entity-1.age = |30⟩ + |31⟩ + |29⟩
Or more accurately:
entity-1.age relative to Device A = 31
entity-1.age relative to Device B = 29There is no global truth. Each observer (device) has a local state that is real relative to itself.
Sync = Measurement = Wave Function Collapse
When Alice and Bob reconnect, their devices sync. This is interaction between observers:
Device A observes Device B's state:
[entity-1 :age 29 :tx 102] ; Bob's version
Device B observes Device A's state:
[entity-1 :age 31 :tx 101] ; Alice's version
CONFLICT DETECTED!This is wave function collapse. Two incompatible local states entangle. The system must reconcile into a correlated outcome.
Conflict Resolution = Entanglement
DaoDB uses CRDTs (Conflict-free Replicated Data Types) and causal ordering to resolve conflicts. Common strategies:
- Last-Write-Wins (LWW) — Higher transaction ID wins
- Multi-Value Register — Keep both values, let application decide
- Merge functions — Application-defined reconciliation logic
Example with LWW:
tx 101 vs tx 102 → tx 102 wins
Resolved state (both devices agree):
[entity-1 :age 29 :tx 102]
[entity-1 :age-conflict-from 31 :tx 103] ; Provenance preservedAfter reconciliation, both observers now share a correlated state. They've entangled. Neither state "collapsed" to some pre-existing global truth. Instead, they created a new correlated reality through interaction.
The RQM Parallel
Let's make the parallels explicit:
Quantum Mechanics → DaoDB
| RQM Concept | DaoDB Implementation |
|---|---|
| Observer | Device/Database instance |
| System being observed | Shared entity (e.g., entity-1) |
| Local state | Device's local tuple store |
| Superposition | Conflicting states across disconnected devices |
| Measurement | Sync/replication between devices |
| Wave function collapse | Conflict detection |
| Entanglement | Conflict resolution (CRDT merge) |
| Correlation | Agreed-upon state after sync |
| No global state | No central database; only local replicas |
| Locality | Changes propagate at network speed |
The "Collapse" Is Not Collapse
In RQM, wave function collapse is not a physical process. It's correlation between two observers.
Before measurement:
- Observer A has state |ψ⟩
- System has state |φ⟩
- States are independent
After measurement:
- Observer A and System are entangled: |ψ⟩⊗|φ⟩ → |ψ'⟩⊗|φ'⟩
- A now has information correlated with the system
- But relative to observer B, the system is still in superposition!
In DaoDB:
Before sync:
- Device A has state
{entity-1: {age: 31}} - Device B has state
{entity-1: {age: 29}} - States are independent (no network)
After sync:
- Devices A and B entangle via CRDT merge
- Both agree:
{entity-1: {age: 29}} - But relative to Device C (still offline),
entity-1is still in superposition!
Retrocausality: Reconciling Past States
Here's where it gets wild: retrocausality.
What Is Retrocausality?
Retrocausality is the idea that future events can influence the past. In quantum mechanics, certain interpretations (like the two-state vector formalism) suggest that measurements can "reach backward in time" to determine what the state "was."
RQM reframes this: There is no past state independent of the observer. When you measure now, you're not discovering what the state was—you're creating correlation with your current perspective.
Retrocausality in DaoDB
When two devices sync and resolve conflicts, they reconcile their histories:
Device A's history:
tx 100: [entity-1 :age 30]
tx 101: [entity-1 :age 31]
Device B's history:
tx 100: [entity-1 :age 30]
tx 102: [entity-1 :age 29]
After sync, both devices agree on a merged history:
tx 100: [entity-1 :age 30]
tx 101: [entity-1 :age 31 :branch-A]
tx 102: [entity-1 :age 29 :branch-B]
tx 103: [entity-1 :age 29 :merged-from [101 102]]The key: the "correct" history was never determined until the sync happened. Device A believed tx 101 was the future. Device B believed tx 102 was the future. When they interact, they retroactively construct a correlated history.
This is retrocausality. The sync event (future) influences how we interpret the past states. But there's no actual backward-in-time causation—just observers reconciling their local timelines.
Causal Ordering Preserves Locality
DaoDB uses causal ordering (via vector clocks or similar mechanisms) to ensure that:
- Events that happened-before each other are ordered correctly
- Concurrent events (no causal relationship) can be reconciled without contradiction
- No device needs a global clock or central authority
This is local causality—the same principle RQM enforces. Information propagates at finite speed (network latency). No observer can know about a distant event until the causal signal reaches them.
The Multiverse Interpretation
In RQM, when two observers have incompatible measurements, we don't say one is "wrong." We say they inhabit different relational states.
From observer A's perspective: electron is spin-up.
From observer B's perspective: electron is spin-down.
Both are true. The universe is multi-perspective, not multi-world. There's one reality, but reality is relational, not absolute.
DaoDB's Multiverse
Before sync, DaoDB creates a temporary multiverse:
Universe A (Device A's perspective):
entity-1.age = 31
Universe B (Device B's perspective):
entity-1.age = 29These universes coexist. Neither is "the truth." When devices sync, the universes merge:
Merged Universe (correlated):
entity-1.age = 29 (resolved via LWW)
entity-1.age-history = [30, 31*, 29] (* denotes overridden)The merge is not "discovering the truth." It's creating a new correlated reality through interaction.
Why This Matters: Distributed Systems Are Quantum
Traditional distributed systems textbooks treat conflicts as bugs to eliminate. They assume there's a "correct" global state, and our job is to approximate it despite network partitions.
But RQM reveals a deeper truth: there is no global state. Conflicts aren't bugs—they're fundamental features of reality.
CAP Theorem as Uncertainty Principle
The CAP theorem says you can't have Consistency, Availability, and Partition-tolerance simultaneously. Pick two.
RQM reframes this: The CAP theorem is the distributed systems uncertainty principle.
- Consistency = Global state (impossible in RQM)
- Availability = Local state always accessible (RQM guarantee)
- Partition-tolerance = Observers can be isolated (locality principle)
You can't have global consistency because there is no global state. Each observer maintains local consistency. When observers interact, they correlate.
CRDTs as Quantum Operators
CRDTs (Conflict-free Replicated Data Types) ensure that any order of operations converges to the same state. This is commutativity:
A ⊕ B = B ⊕ A
Device A applies: [op1, op2]
Device B applies: [op2, op1]
Both converge to the same state.In quantum mechanics, commuting observables can be measured simultaneously without disturbing each other:
[Â, B̂] = 0 → Measurements of A and B commuteCRDTs are the distributed systems equivalent: operations that commute don't create irreconcilable conflicts. They're compatible observables.
Vector Clocks as Causal Cones
Vector clocks track causal relationships between events:
Event A: {Device1: 5, Device2: 3}
Event B: {Device1: 5, Device2: 4}
B happened-after A on Device2 (4 > 3)
A and B are concurrent on Device1 (5 = 5)This is identical to light cones in relativity:
- Events inside the light cone are causally related
- Events outside the light cone are space-like separated (concurrent)
- No observer can influence events outside their light cone
Vector clocks enforce local causality—the foundation of both relativity and RQM.
Bell's Theorem and the Locality Question
Here's where skepticism is warranted: Bell's theorem proves that quantum mechanics violates local realism. Experiments confirm quantum correlations that cannot be explained by local hidden variables. So how can RQM claim to be a local theory?
What Bell's Theorem Actually Says
Bell's theorem proves that no local hidden variable theory can reproduce quantum mechanical predictions. The key word is hidden. Bell assumes:
- Realism — Physical properties exist independently of measurement
- Locality — No faster-than-light influence between distant events
- Hidden variables — There's some underlying deterministic state we just can't see
Quantum mechanics violates this combination. But which assumption does it violate?
RQM Rejects Realism, Not Locality
RQM says: properties do not exist independently of measurement. This is the rejection of realism, not locality.
In RQM:
- An electron's spin is not determined until an observer measures it
- The spin exists relative to the observer who measured it
- Different observers can have incompatible but equally valid descriptions
- When observers interact, their descriptions correlate locally through physical interaction
There is no spooky action at a distance. When Alice measures her entangled particle's spin, nothing happens to Bob's particle. Alice's measurement creates a definite spin relative to Alice. Bob's particle remains in superposition relative to Bob until he measures it.
The correlation only becomes manifest when Alice and Bob meet and compare results—a local interaction that happens at or below the speed of light. No information traveled faster than light. No distant influence occurred.
The EPR Paradox Revisited
The Einstein-Podolsky-Rosen (EPR) thought experiment highlights this:
1. Create entangled particles: |ψ⟩ = (|↑↓⟩ - |↓↑⟩)/√2
2. Send one to Alice, one to Bob (light-years apart)
3. Alice measures spin: gets ↑
4. Bob measures spin: gets ↓ (guaranteed anti-correlation)
5. How did Bob's particle 'know' what Alice measured?Traditional answer: Spooky action at a distance! Alice's measurement caused Bob's particle to collapse.
RQM answer: Nothing happened at Bob's location when Alice measured. Alice established a correlation relative to herself. Bob's particle is still in superposition relative to Bob. When Bob measures, he establishes his own correlation. Only when Alice and Bob later meet and compare (a local event) do they discover the anti-correlation was always encoded in the joint state.
The correlation was latent in the entangled state from the beginning. No faster-than-light signaling occurred. Locality is preserved.
DaoDB's Bell Test
In DaoDB, the same pattern emerges:
Device A (offline): [entity-1 :color "red" :tx 101]
Device B (offline): [entity-1 :color "blue" :tx 102]
Neither device 'knows' what the other chose.
Both are correct relative to their local state.
When they sync (local interaction via network):
Conflict detected! Apply CRDT merge.
Result: [entity-1 :color "blue" :tx 103 :merged-from [101 102]]
The correlation emerges through LOCAL interaction,
not through spooky action at a distance.Device A's write did not cause Device B's state to change. Device B's write did not cause Device A's state to change. Both evolved independently based on local causality. The conflict resolution happens when the causal light cones intersect during sync—a local event.
Why Distributed Databases Don't Violate Bell
DaoDB doesn't face Bell's theorem because:
- No hidden variables — The state is explicitly represented as datoms, not hidden
- No realism — Entities don't have observer-independent properties.
entity-1.coloris only defined relative to which device you ask - Locality preserved — Conflicts resolve through network messages (causal, speed-of-light limited), not instantaneous global coordination
- Correlations emerge locally — When devices sync, they perform a local computation (CRDT merge) that creates correlation
This is exactly RQM's resolution of the Bell paradox applied to databases.
The Key Insight
Bell's theorem eliminates local realism (local + hidden variables + pre-existing properties). RQM eliminates realism while preserving locality:
- ❌ Local Realism (Bell proves this is impossible)
- ✓ Local Anti-Realism (RQM: properties are relational, locality preserved)
- ✓ Non-Local Realism (Many-Worlds, Bohmian mechanics: properties exist, but non-local)
- ❌ Non-Local Anti-Realism (pointless—gives up both)
RQM chooses local anti-realism. Properties emerge through interaction. Correlations manifest locally. No faster-than-light influence. Bell's theorem is satisfied because we reject realism, not locality.
Practical Implications
1. Embrace Conflicts, Don't Fight Them
Traditional databases treat conflicts as failures. DaoDB treats them as expected reality.
Design CRDT merge semantics that preserve user intent:
- Shopping cart: Union of items (both users' additions count)
- Counter: Sum of increments (both users' votes count)
- Document: Operational transform or merge conflicts explicitly
Don't try to enforce global consistency. There is no global state to enforce.
2. Causality, Not Timestamps
Don't rely on wall-clock timestamps for ordering. Clocks drift. Devices lie.
Use causal ordering:
- Vector clocks
- Lamport timestamps
- Merkle DAGs (like Git)
Causality is local and observable. Timestamps are global and fragile.
3. Provenance Is Essential
RQM says measurements create correlations. In DaoDB, every merge creates a new fact with provenance:
[entity-1 :age 29 :tx 103]
[tx-103 :merged-from [tx-101 tx-102]]
[tx-103 :resolution-strategy :last-write-wins]
[tx-103 :timestamp "2025-11-17T10:30:00Z"]Track how the state was derived. This enables:
- Auditing (who decided what?)
- Debugging (why did this merge happen?)
- Time-travel (what did the world look like before the merge?)
4. Offline-First Is Quantum-First
If your app requires a central server, you're assuming global state. This breaks RQM principles.
DaoDB is offline-first:
- Every device is a complete observer
- Local operations always succeed
- Sync is interaction, not synchronization to truth
This isn't just good UX. It's physically correct.
The Philosophical Insight
RQM says: Reality is a network of interactions, not a collection of independent facts.
An electron doesn't have a spin until you measure it. Not because it's "hidden"—but because properties are relational. The spin exists relative to your measurement apparatus.
DaoDB says: Data is a network of interactions, not a collection of independent tuples.
An entity doesn't have an age until observers sync. Not because it's "uncertain"—but because properties are relational. The age exists relative to which device you're on.
The Universe Is a Database
Or rather: Databases are microcosms of the universe.
Every distributed system faces the same problems as quantum mechanics:
- How do local observers maintain consistent views?
- What happens when observers interact?
- How do we reconcile incompatible states?
- Is there a global truth, or only local perspectives?
RQM answers: Local perspectives are all there is. Global truth is an illusion.
DaoDB implements this: Every device is correct from its own perspective. Sync creates correlation, not convergence to truth.
Connection to Other Work
CRDT Research
CRDTs (Shapiro et al., 2011) formalize conflict-free merge semantics. DaoDB uses CRDTs extensively.
What RQM adds: CRDTs aren't just algorithms—they're physical laws for how observers correlate in a relational universe.
Pi-Calculus and Process Algebra
The π-calculus models distributed systems as interacting processes. Communication is message-passing, not shared memory.
RQM is the quantum version: observers interact via measurement, not shared state. DaoDB implements this with streams and sync.
Both share the same fundamental insight: reality is interaction, not state. Read π-Calculus, RQM, and the Primacy of Interaction to understand how these models are structurally isomorphic.
Git as a Quantum Database
Git is a distributed version control system where:
- Every clone is a complete observer
- Commits create local histories
- Merges reconcile divergent histories
- Conflicts are explicit and preserved
Git is already an RQM implementation—for code instead of data. DaoDB generalizes this to arbitrary tuples.
Conclusion: Local-First Is Physics-First
DaoDB isn't just a local-first database. It's an implementation of Relational Quantum Mechanics:
- No global state — Every device is an observer with local reality
- Unitarity — Total information preserved across entanglement group, but no single device holds complete state
- Partial states — When entangled, each device has partial view; together they maintain the whole
- Superposition — Conflicting states across disconnected devices
- Measurement — Sync triggers conflict detection
- Entanglement — CRDT merge creates correlated states
- Retrocausality — Observers reconcile their histories through interaction
- Locality — Causality propagates at network speed
- Bell's theorem satisfied — We reject realism (observer-independent properties), not locality
This isn't metaphor. This is isomorphism. The mathematics is the same. The principles are the same. The physical constraints are the same.
When devices are isolated, each maintains a complete database. When devices entangle into a sync group, no single observer possesses the complete state—yet the total information is preserved across the system. This is quantum unitarity in distributed form.
Distributed databases are quantum systems. Conflicts are wave function collapse. Sync is entanglement. Partial states preserve unitarity. And DaoDB embraces this instead of fighting it.
The universe has no global state. Why should your database?
Learn more:
- DaoDB Documentation (local-first distributed tuple store)
- Unitarity, π-Calculus, and the Cosmic Speed Limit (why communication must have finite speed)
- What Makes Datalog Datalog (query semantics for distributed data)
- DaoStream (the flow through which datoms travel)
- Stanford Encyclopedia: Relational Quantum Mechanics (philosophical foundations)