Notes

A table that can be dropped is labelled as one

The panel is answered from a database that can be rebuilt from the artifact store, and every table says whether that is true of it. A rebuild only adds rows.

On juudd, the database that answers the panel's questions is a projection of the artifact store, and a table in it may be called derived only if it can be rebuilt from what the store holds. A table that cannot be rebuilt must say so in its own label. That is the decision, and it is smaller than it sounds: it is a rule about words, kept honest by one script that has to keep working.

The rest of this post is the objection that produced it, the three rules that stop a convenient copy turning into a second source of truth, and the day the rule was reversed for one kind of record.

The objection was right

Every piece of data in the system started as a file in the artifact store. The owner's objection was that opening files one by one cannot scale, the files grow every day, and a database exists for exactly this.

The numbers were already in hand. The activity page cost one object read per deploy across the whole account, so thirteen sites at twelve deploys each meant about 156 reads for one page. Listing a customer's sites was one list and then one read per site. Enumerating customers was not possible at all, because accounts existed only as a prefix derived from ownership records.

And the count only grows, because the platform's own limit is that it will not delete anything. Versions accumulate and every listing gets longer.

What had been misread

Not the original decision. The way it was being read. Its acceptance test is about recovery: can a script holding only the store's credentials list every site, pick each one's current version, and rebuild it? That requires the store to be recoverable in full. It does not require the store to be what is read on every request.

Those two had been treated as one thing, and they separate cleanly. The line belongs at authoritative versus served: the store is written first and is the truth, and the database is what answers requests.

Three rules that keep a copy a copy

  • Nothing exists only in the database. Every row must be derivable by

replaying the store. A fact that cannot be rebuilt belongs in the store first.

  • No write path writes only to the database. The store is written first and

the projection follows. A write that reached the database and not the store is data loss wearing the clothes of a success.

  • A rebuild is a routine operation, not a disaster procedure. It runs on

demand and it is tested. Its being cheap is what makes the first two rules enforceable rather than aspirational.

The failure modes then answer themselves. If the database is lost, rebuild it, because none of it was only there. If it drifts, rebuild it, and there is never a reconciliation question because the store is right by definition. If it is down, reads degrade, but deploying and serving a customer's site do not read it at all.

The rebuild only adds

The replay script lists the store and inserts. Every insert conflicts on the key it already has and does nothing, so running it over a full database is a no-op and running it over an empty one fills it. No code path in the read model deletes a row.

That matters more than it looks. The script was once described as dropping and rebuilding, and it drops nothing. A reader who believes it drops first will not run it, because running it would look like discarding every record that exists only in the database. A projection nobody has ever rebuilt is a second source of truth that has not been caught yet.

Three labels, and every table in exactly one

The schema file says it at the top. The database holds three zones with different rules:

zonewhat dropping it does
derivednothing is lost; it is rebuilt from the store
authoritativeloses who owns what, who may look, and what an operator took off the air; the store cannot rebuild it
ephemeralloses a short window of a record that was best-effort to begin with, and nothing can rebuild it

They share a database because they share a connection, a migration table and a backup. They do not share a rule, so each table is in exactly one of the three lists, and confusing them is the failure the comment exists to prevent.

The day the rule was reversed

Identity and ownership were made authoritative in the database, because they must be transactional, enumerable and deletable, and they are personal. That reversed the rule for that class of data, and the decision said so plainly rather than quietly.

Later the event record followed. Once the store held customers' web deploys and nothing else, there was nowhere left to rebuild an event from, and the code that writes events now says at the top that it is the only copy. Recording still never throws: if the write fails, the deploy it describes still succeeds, because a failed deploy and a missing line is worse than a missing line.

So the first rule was never a promise that the database is disposable. It was a promise that the platform would always know which parts are, and write it where the next reader looks.

What this does not do

  • It does not make the database optional. Reads of the panel degrade without it,

and the labels do not change that.

  • It does not make a rebuild instant, and it does not apply to the authoritative

zone. For those tables the only protection is the database's own recovery, and that is an obligation someone has to know about, not a property of the design.

The rule, once

Answer questions from a database if you must, but write down, per table, whether it can be thrown away, and keep a rebuild that adds and never drops running often enough to prove it. The tools and their limits are listed in the docs.