Daniel Pereira · Filipe Pereira · Rui Lopes · Nuno Faria · Paulo Sérgio Almeida · José Pereira
INESC TEC and University of Minho · InvisibleLab
Motivation
Can TCC be composed from what relational databases already do rather than built from scratch?
Background
Space-time diagrams throughout: time runs to the right, an open circle starts a transaction and a filled dot commits it, a dashed vertical is a reader's snapshot, and a hatched band is written to storage but not yet visible.
A transaction's snapshot must be closed under causal dependencies: if it has an effect, it has everything that precedes it.
A multi-object transaction is visible all at once or not at all — stronger than failure atomicity, which ignores concurrent readers.
What TCC allows. No global commit order, and no aborts on write conflict — so long fork and lost update are permitted, as is write skew (short fork), which SI already allows. Cure recovers lost updates with CRDTs; they are not intrinsic to TCC.
Background
Experiment
The visibility layer appears only in the scenarios that need it. Either way the application sees an ordinary database.
Scenario 1 · one node, one agent per DC
Applying each batch as a transaction provides atomic visibility, while agent-enforced order keeps the installed state causally closed. PostgreSQL's native SI can therefore expose causally consistent snapshots to clients.
Scenario 2 · many nodes, one agent per DC
-- rewritten, TiQuE-style
WHERE t.k <= AppliedVV[t.d]
Visibility moves into the query and the database is left needing only row-level atomicity. A near miss: PostgreSQL already has SET TRANSACTION SNAPSHOT — in Citus it applies to the coordinator's local transaction only.
DSI makes it straightforward to use many nodes per DC with a single agent. But it would not be necessary if a coordinator could explicitly set each node's snapshot when starting a distributed transaction.
Scenario 3 · many nodes, one agent each
Per-shard dependencies are all an agent can enforce, and agent coordination doesn't fix it. So visibility moves to the reader: a commit vector per item.
Remote transactions are materialised as independent physical transactions across nodes, so even native DSI cannot ensure their atomic visibility. Enforcing TCC requires a logical visibility layer.
Not covered today
Summary
| Scenario | Nodes per DC |
Agents per DC |
Isolation required |
Replication ordering |
Visibility layer |
Transaction timestamp |
Agent timestamp |
|---|---|---|---|---|---|---|---|
| S1 | 1 | 1 | SI | causal | no | none | vector |
| S2 · CDB, YDB | N | 1 | DSI | causal | no | none | vector |
| S2 · Citus | N | 1 | row | causal | yes | scalar | vector |
| S3 | N | N | row | FIFO | yes | vector | vector |
Shaded rows are where we re-implement, in SQL, the version management the database already has.
Conclusions
Neither is SQL the application writes: the agent supplies the snapshot and collects the commit position, on connections the application never sees.
-- per node, at transaction start
BEGIN WITH SNAPSHOT <external>
Lets an external component define the causally consistent cut instead of reconstructing it with WHERE clauses. Citus-style architectures would then need no DSI at all, and scenario 3 would need no visibility layer.
-- at the effective commit point
COMMIT RETURNING <position>
The second gap, not covered today. The commit position exists only after the commit, so visibility expressed through it breaks read-your-writes unless the position is exposed atomically at the commit point.
The obstacle to composable isolation is not missing mechanisms — it's the absence of interfaces onto the ones already there.
Daniel Pereira · Filipe Pereira · Rui Lopes · Nuno Faria · Paulo Sérgio Almeida · José Pereira
INESC TEC and University of Minho · InvisibleLab
Co-funded by the European Regional Development Fund through Portugal 2030 — COMPETE 2030, project CDMS (ref. 17409, COMPETE2030-FEDER-01193000); NORTE 2030, projects Rescueware (ref. 21746, NORTE2030-FEDER-02306900) and BCD.S+M (ref. 14436, NORTE2030-FEDER-00584600). Financed by national funds through FCT — Fundação para a Ciência e a Tecnologia: UID/50014/2025, and CMU–Portugal project ADAPQO (2024.12585.CMU).