Skip to content
Design17 min readUpdated 27 Oct 2026

16. Problems of multi-runtime systems

The fallacies of distributed computing were listed in the 1990s: that the network is reliable, that latency is zero, that bandwidth is infinite, that the network is secure, that topology does not change, that there is one administrator, that transport costs nothing, and that the network is homogeneous [303]. A multi-runtime system meets all eight and adds its own. Each runtime has its own failure model, deployment unit, scheduler and debugger, and each runtime’s guarantees stop at its edge.

Studies of production failures show where such systems break in practice.

  • In 198 failures of five data-intensive systems, 92% of the catastrophic ones came from incorrect handling of errors that had been explicitly signalled, and almost all could be reproduced on three nodes or fewer [362].

  • Across 597 outages of 32 cloud services, upgrades, network faults and bugs led the known root causes [158].

  • Network partitions caused 136 failures in 25 systems, most of them catastrophic and deterministic, and many triggered by isolating a single node [13].

  • About two thirds of 123 upgrade failures came from data that two versions interpreted differently [365].

  • Configuration is a dominant cause of failures [357]; at Facebook it caused 16% of high-impact incidents [326].

  • A fifth of the studied incidents of three large clouds came from interactions between systems [327].

This section selects twenty problems that recur in these studies and in the survey of Section 20.2. For each problem it states the basic implementation, which is what code does without a model of the system: each call site, service and runtime handles the problem locally, by convention. It then states how the basic implementation fails, and what the graph changes. Table 22 maps the problems to the twelve mechanisms that address them. Most problems need two or three mechanisms, and most mechanisms serve several problems.

Table 22. Twenty problems of multi-runtime systems and the RG mechanisms that address them (• primary, ∘ contributing).
Problem
P1 Unknown outcomes • ∘ ∘
P2 Duplicate effects ∘ • ∘
P3 Retry amplification, metastability ∘ • ∘
P4 Deadlines that do not compose ∘ ∘ •
P5 Tail latency and capacity ∘ • ∘
P6 Gray and partial failure ∘ •
P7 Partitions and split brain • ∘ ∘
P8 Dual writes ∘ •
P9 Stale owners • ∘ ∘
P10 Derived data and deletion ∘ •
P11 Schema evolution • •
P12 Ordering assumptions •
P13 Version skew during upgrades • ∘
P14 Configuration errors ∘ ∘ •
P15 Topology drift ∘ •
P16 Code pushed to clients ∘ ∘ •
P17 Interaction between systems ∘ • ∘
P18 Emergent misbehaviour • ∘
P19 Ambient authority ∘ ∘ •
P20 Diagnosis across runtimes ∘ •

16.1 Failure and time#

P1 Unknown outcomes#

Basic: a call that times out, or whose connection drops, is reported as a failure, and the caller retries or gives up. Failure: a timeout cannot distinguish a slow peer from a dead one, so the effect may have happened. Reading the timeout as “not applied” tells the user that a payment failed when it succeeded; TLC finds that trace in eight steps (Table 34). With RG: a Session call returns an Outcome with four cases: success, domain rejection, failure and UNKNOWN. W5 rejects an effectful call whose outcome type lacks UNKNOWN, and a reconciler resolves unknown outcomes later by querying the provider for the effect identity.

P2 Duplicate effects#

Basic: each call site wraps its call in a retry loop. Idempotency keys are optional, are sometimes generated per attempt rather than per effect, and are rarely bound to the request they protect. Failure: a retried charge is applied twice, or a reused key silently returns the result of a different request. A unique request identifier in the contract is what makes retries safe [131]. With RG: effect identity is a QoS dimension of the Session, and its strongest level binds the key to the digest of the request. A binding qualifies only if the provider deduplicates at that level (A2), and the key is minted once per logical effect, outside the retry loop.

P3 Retry amplification and metastable failure#

Basic: every layer retries on its own. Failure: retries multiply along call paths. Three layers that each make up to four attempts send up to 64 requests to the bottom layer for one request at the top. Under overload this extra work can keep a system down after the trigger has gone, a metastable failure [39]; the standard advice is to retry at one layer only, with backoff, jitter and a retry budget [40]. With RG: retry policies are attributes of Session bindings, including retries inside a database driver once they are declared, and redelivery is an attribute of a Channel. The worst-case amplification along one path is then a path problem over a max-times semiring, computed at plan time and checked against a budget (Listing 22). The load that reaches a shared resource sums over every path and every fan-out that leads to it, which is the same traversal over the counting semiring of sums and products. A cycle of retrying calls has unbounded amplification and is reported as such.

P4 Deadlines that do not compose#

Basic: each hop has a fixed timeout, chosen locally. Failure: an inner timeout longer than the outer one keeps working after the caller has given up, and inner timeouts whose sum exceeds the outer deadline make retries pointless. With RG: a deadline travels with the call. A traversal checks that every callee’s deadline fits within its caller’s remaining budget, and the max-plus semiring gives the worst-case latency of every acyclic call chain (Section 8.2). Expiry after the request may have been sent yields UNKNOWN, never failure; expiry before it was sent is a known failure.

P5 Tail latency and capacity#

Basic: a request fans out to many shards and waits for all of them, and capacity is planned from estimates and staging tests. Failure: the slowest shard sets the latency. If each server is slow on one request in a hundred, a request that fans out to a hundred servers is slow 63% of the time [87]. Bottlenecks often appear only under production traffic, which is why some operators test capacity by shifting live traffic [345]. With RG: fan-out and join policies are explicit in code entries (Listing 8). A hedging policy is an attribute that qualifies only on idempotent reads. Latency and capacity are path problems over observed values, so a placement or a release can be predicted before it ships and compared with observations afterwards.

P6 Gray and partial failure#

Basic: each process has a health check. Failure: a component can look healthy to its failure detector while its clients fail. This differential observability is what defines gray failure [174], and partial failures of this kind often need production conditions to appear [229]. With RG: observations are joined to incidences, not only to processes, so a connection’s health is measured from both of its ends. A disagreement between a component’s own health and what its clients observe is a finding, and a claim about liveness can be stated per connection.

P7 Partitions and split brain#

Basic: partitions are assumed to be rare, and a leader holds a lease. Failure: partitions lose data, bring deleted data back and break locks [13], and independent testing keeps finding systems that violate their advertised guarantees under partitions [196]. With RG: each Channel and Session declares its levels of delivery, order and effect identity (Table 6). A binding qualifies only if partition tests of its provider found no violation of those levels. During a partition a provider may become unavailable, so that calls end in failure or UNKNOWN, but it must not weaken its levels; a test can refute that, never prove it. Exclusive components are fenced by epoch at the stores they write (Figure 4). Places record failure domains, so partition tests can be generated from the declared guarantees instead of written by hand.

16.2 State and data#

P8 Dual writes#

Basic: a service writes its database and then publishes an event, or publishes first. Failure: a crash between the two loses an event or announces a write that never committed, and concurrent writers to two stores race and leave them permanently inconsistent [198]. With RG: atomic(store) commits the effect and its outbox record in one transaction, and the record is published only after the commit. The outbox model of Table 34 shows the dual write losing an event in one step, while the outbox holds.

P9 Stale owners#

Basic: a component holds a lease and checks it before each write. Failure: a holder that pauses past its lease writes after a new owner has taken over (Figure 4). Checking the lease just before writing does not help; TLC finds the trace in three steps. With RG: the store checks the writer’s epoch inside its own transaction, so a stale write is rejected where it would take effect. Activations carry their epochs, and observations report them.

P10 Derived data and deletion#

Basic: caches, search indexes, analytics copies in ClickHouse and graph projections in Memgraph are kept up to date by jobs and scripts. Failure: reads are stale for an unknown time, and a deletion misses a copy that nobody remembered. With RG: every copy is a dataset related to its source by Derives, with lineage. Invalidation is a traversal, and freshness is a declared attribute. Rows are not part of the graph, so a deletion is a data plan: its targets are the closure of the deleted data over Derives, and it runs as a saga with one receipt per store. Labels follow Derives, so a copy of personal data is personal.

P11 Schema evolution#

Basic: migrations run separately from code deployments. Failure: during a rollout, code and schema disagree. F1 showed that safe online schema change needs intermediate states, such as delete-only and write-only, and servers at most one schema version apart [284]. With RG: a schema change is a patch to datasets, and its data migration is induced by a functor between schemas (Section 14). The expand and contract steps are separate revisions, and each intermediate revision must be well formed. Contract compatibility between the code and each schema is computed, not assumed. F1 also bounds version skew with leases, which phones cannot give; for clients, the bound is the oldest version that admission still accepts.

P12 Ordering assumptions#

Basic: code assumes that a queue preserves order. Failure: some queues order only on a best-effort basis (Section 13), so consumers see reordered events in rare cases and corrupt state silently. With RG: order is a QoS dimension of the Channel, ordered from none to per key to total. A binding to a queue that does not provide the declared order fails A2 before activation.

16.3 Change#

P13 Version skew during upgrades#

Basic: rolling upgrades, with the hope that versions are compatible. Failure: mixed-version operation can last a long time [8], upgrades lead the causes of outages [158], and most upgrade failures come from data that two versions read differently, which pre-release tests usually miss [365]. With RG: every boundary carries contract fingerprints. Compatibility is computed for each pair of versions that admission may combine, a release region is closed under the relations that must change together (Equation 3), and the window during which two versions coexist is explicit in the plan.

P14 Configuration errors#

Basic: configuration files and environment variables, kept per runtime and copied between them. Failure: misconfiguration is a leading cause of failures [357], which is why Facebook manages configuration as code with validation, review and canaries [326]. With RG: configuration is typed attributes of elements. The deployment layer is generated from one graph (Listing 19), and a configuration change is a patch that is checked, reviewed as a graph diff and released in stages like code.

P15 Topology drift#

Basic: what runs where is recorded in deployment scripts, dashboards and documents. Failure: the records disagree; one surveyed product declares its topology in seven hand-kept places (Section 14). With RG: topology is the deployment layer of the graph. Reconcilers compare it with what is observed, and the truthful-state conditions of Definition 10 make agreement checkable.

P16 Code pushed to clients#

Basic: app store releases, plus a code-push service that ships a JavaScript bundle. Failure: a pushed bundle calls a host interface that the installed app does not have, or arrives in the middle of a session, and there is no principled rollback. With RG: a push is a region release. Its closure includes everything that must change together, admission checks fingerprints at the trunk on each host, and next-entry or drain-and-swap activation is fenced by epoch (Section 9.5).

16.4 Interaction, authority and diagnosis#

P17 Interaction between systems#

Basic: each system is tested alone, against mocks of the others. Failure: interactions between systems caused a fifth of the cloud incidents studied in [327], and many of the cross-system failures it studied in open-source systems involved the data that passed between them. With RG: the boundary between two systems is a typed hyperedge with contracts on both sides. A third-party system is imported as an observed scope with provenance, so the boundary is checked like any other, and labels and lineage cross it.

P18 Emergent misbehaviour#

Basic: independent control loops, such as autoscalers, retry policies, caches, circuit breakers and rebalancers, are each tuned on their own. Failure: together they synchronise, oscillate or livelock without any component being at fault [249]. With RG: controllers and reconcilers are components whose reads and writes are in the graph. A traversal finds cycles among control loops that read and write the same elements and reports each cycle with its members, so that a person can assign it a damping policy or a single owner.

P19 Ambient authority#

Basic: a service acts with its own authority on behalf of whoever calls it. Secrets live in environment variables, and the tenant is a parameter passed by convention. Failure: a caller makes a privileged service act on a resource it could not reach itself, the confused deputy [162]; secrets leak through logs; and one missing filter exposes another tenant’s data. With RG: authority is a Grant, and the authority traversal finds every effect reachable without one. Tenancy is rule A6, and secrets are resources with a secret label that W11 keeps out of logs and telemetry. An agent is a principal like any other, under the same rules (Section 17.1).

P20 Diagnosis across runtimes#

Basic: trace identifiers are propagated by instrumented libraries, as in Dapper [311], and spans are attributed to code by service and operation names. Failure: a runtime without the library breaks the trace, names attribute spans to the wrong code, and failures that would reproduce on three nodes are never reproduced [362]. With RG: instrumentation plans are generated for every connection, observations are joined by element identity and revision, and a trace with gaps states its coverage. The question “what changed?” is a query over patches, and capture and replay at boundaries turns a production failure into a test.

16.5 One incident, with and without the graph#

Consider a hypothetical incident in the platform of Figure 2. A slow query plan raises the latency of feed reads from Postgres. The phone retries a feed request up to three times; the feed Worker retries its Postgres session up to three times; and the database client inside it retries once. A single tap can therefore become 4×4×2=32 queries. The connection pool saturates, and latency rises for every route that shares it. When the slow plan is fixed, the retries keep the load above capacity, so the failure is metastable [39]. Meanwhile the database’s health check stays green while the edge sees timeouts, a gray failure [174]. Engineers join logs by time and guess.

With the graph, three findings exist before the first deployment, provided the driver’s retries are declared as an attribute of the database session’s binding. The amplification traversal of Listing 22 reports a factor of 32 on the path from the phone through the feed Worker to Postgres, against a budget of 4, and names the three bindings. Its counting variant sums the load over every route that shares the pool. The deadline check reports that the database session’s deadline exceeds the feed’s own. The shared pool appears as one Resource that several routes depend on, so its saturation is a single point of contention that the impact traversal can show. In production, observations joined to the session incidence show that the client side and the server side disagree. The gray failure is then a finding with a witness, not a guess.

val amplification = traversal<Double>("sessions.retry-amplification") {
    select(Session, from = Client, to = Server)
    semiring(MaxTimes)
    along { call -> call.binding.retry.maxAttempts.toDouble() }
    finding(where = { path, factor -> factor > path.entry.budget.amplification }) { path, factor ->
        "amplification $factor on ${path.render()} exceeds ${path.entry.budget.amplification}"
    }
}

Listing 22.

Worst-case retry amplification along one path, as a traversal over a max-times semiring (proposed API).

16.6 What the graph does not fix#

The graph changes where problems are found, not the physics that causes them. Networks still partition, disks still fail and providers still have correlated outages. Bugs inside component bodies stay bugs. Declarations can be wrong: a QoS level or an idempotency claim that a provider does not meet is caught only if qualification tests it. Approvers can still approve a bad plan, and every check has a cost that Section 20.4 must show to be worth paying. What the graph does provide is a place where the twenty problems above are stated once, checked before activation where they can be, and observed by identity where they cannot.