3. Three Realities

The test suite is green. Staging has been green for a week. You ran the migration against a copy of the database and watched it finish in nine seconds. You deploy on a Thursday afternoon, because everything you can see says there is nothing left to fear. Ninety seconds later the pager goes off. The migration that took nine seconds in staging is still running in production, holding a lock on a table that forty other queries are now queued behind, and the queue is growing.

You knew this could not happen. You had checked. The thing you checked was real, and it answered you honestly, and its answer did not survive the deploy.

Advaita Vedanta has a name for what just happened, and it is not “a bug.” The tradition holds that reality comes in orders, graded by what can cancel what. The classic teaching names three. Pratibhasika is apparent reality: the snake you see in the coiled rope, vivid enough to freeze your blood, gone the instant the light reveals the rope. Vyavaharika is transactional reality: the workaday world you move through and act in, solid until deeper knowledge dissolves it. Paramarthika is absolute reality: the one order nothing further can cancel.

The relation between the orders is the whole point, and it has a name too. Badha, sublation. A higher reality does not correct a lower one. It cancels it. When you see the rope, you do not decide the snake was a slightly inaccurate snake. There was no snake. It was never there.

Line the environments up against the orders. Local dev is pratibhasika, a private reality that is vivid and complete and answerable only to you, real until the moment it meets anything outside your machine. Staging is vyavaharika, a shared world you can transact in, real enough to demo and sign off against, still not final. Production is paramarthika. It is the order that, when it contradicts everything you established below it, wins, and does not have to explain itself.

We are trained to see this differently. We treat dev, staging, and production as one system rendered at three fidelities, the same thing photographed at low, medium, and high resolution. Staging is “prod-like,” and the phrase smuggles in the whole assumption: that a truth found lower down carries upward, that green below is evidence of green above.

Sublation says the relation is not fidelity. It is negation from above. The nine-second migration was not a slightly-off reading that production sharpened. Staging’s verdict was cancelled whole, the way waking cancels a dream, and the certainty you carried into the deploy was worth exactly nothing the moment a higher order spoke. This is why “works on my machine” is not an excuse and not bad luck. It is a category error. It mistakes the apparent for the absolute, the private reality for the one that counts.

Gaudapada, writing his verses on the Mandukya, gives the mechanism, and it is sharper than a slogan. His argument runs through dream. What is absent at the beginning and absent at the end, he says, is absent in the middle too. The mirage water is not there before you reach it and not there after, so it was not there while you looked. Apply the rule. A result that holds only inside the environment that produced it, that nothing above that environment would reproduce, had no existence before it and none after. It was never real in the way you needed. It lived inside a boundary, and the boundary was the fiction.

He closes the escape route before you reach it. The obvious defense is that staging clearly worked, it served its purpose, it did the job. Gaudapada answers with the dream meal. You eat to fullness in a dream and wake up hungry. Usefulness inside one order is no evidence of reality in another. Passing locally proves that it passed locally, and nothing more.

And the negation only runs one way. A behavior confirmed in the live system is not undone by a failing test on your laptop, but a passing test on your laptop is undone every day by the live system. That asymmetry is the part you can act on.

Production is the only reality. Local dev and staging are useful fictions.

Only production can overrule production.

The rule earns its keep where the environments differ in kind, not degree. An index that was instant on ten thousand rows crawls on ten million. A race you could never trigger on one laptop fires a thousand times a second. Data arrives misshapen in ways no fixture imagined. Then there is real time, real locale, and the config and secrets that live in only one place. These are the failures that sail through every lower environment green, because the lower environments are a different order of reality and do not contain the thing that breaks.

It has limits, and a mapping that hides its limits is just another fiction.

Production is not Brahman. In the tradition, even the waking world is sublated in the end, cancelled by the Absolute, and production is nowhere near that. We are borrowing the structure, sublation, not the metaphysics. Production is the top of this ladder for a plain operational reason: it is where consequences are real, where a wrong answer costs money or a night’s sleep. It is the last order, not the highest thing that exists.

The fictions are useful, and the word is not an insult. Advaita never tells you to stop dreaming. You live and build in the transactional world precisely because you cannot build in the absolute one. Dev and staging are where the work happens, and you need them. The discipline is not to abandon staging. It is to never again mistake staging-green for prod-real.

And the count of three is a lens, not a census. Your pipeline may have local, CI, staging, canary, and prod, or fewer. The number does not matter. What matters is that nothing below the last rung is final.

The Mandukya, having named waking, dream, and deep sleep, adds a fourth it calls turiya, “with which there can be no dealing.” It has no environment. It is not a place you deploy to. It points past all of them to the thing every environment is only running, the code itself, and that is a different essay.

On the last day of June 2012, the world’s official clocks held for one extra second. A leap second, inserted by decree to keep atomic time in step with the planet’s slowing spin. Real time did something a clock is not usually allowed to do, and a dormant fault in the Linux kernel’s timer handling woke up. Processes that asked the kernel what time it was fell into a livelock and began to spin, pinning the CPU. Jonathan Ellis, who built Cassandra, put it plainly afterward: the reports blamed Java, they blamed Cassandra, but the actual problem was a livelock in the Linux system calls responsible for timers.

Java systems, Cassandra and Hadoop among them, and databases on MySQL hung across the internet at the same moment. Reddit went down. So did LinkedIn, and the reservation system Qantas runs on. The fix was not a patch. Administrators reset the clock or rebooted, hundreds of machines at a time, and the spinning stopped. No application code was wrong.

That is the part worth sitting with. No test caught it because no test lived through it. You can fake a clock, but nobody had faked that particular second, and the environments below production do not run in real, continuous time. Production does. The fault was not in the code and not in the tests. It was in the collision between the code and a second of reality that only production was standing in to receive.

You build in the dream because you have to. You deploy knowing the only verdict that counts is the one you have not heard yet.

Further Reading

The Mandukya Upanishad is twelve verses; Robert Ernest Hume’s 1921 translation in The Thirteen Principal Upanishads (Oxford) is public domain and carries the four states cleanly. Gaudapada’s Karika, with Shankara’s commentary, is in Manilal Dvivedi’s 1894 edition (Bombay, public domain); the dream-and-waking argument is the second book, the Vaitathya Prakarana. Swami Nikhilananda’s edition reads more naturally when you can find it. The three orders of reality, pratibhasika, vyavaharika, and paramarthika, are a framework of the later Advaita tradition rather than the Upanishad itself, and the honest blend is worth knowing as a blend. On the software side, the 2012 leap-second incident is well documented in the contemporary postmortems and reporting. For the fourth state, turiya, and the sense in which the running system and the code are one, see the essay on Vivarta.