A log is an append-only sequence of records ordered by time — a very simple storage abstraction, and the one underneath every Gargantis stream. It acts as a kind of messaging system with durability guarantees and strong ordering semantics, and it solves the two problems every distributed data system has: ordering changes and distributing data.

The load-bearing property is the State Machine Replication Principle: if two identical, deterministic processes begin in the same state and get the same inputs in the same order, they will produce the same output and end in the same state. A game loop is exactly such a process, which is why a realm can converge across the network with no authoritative server deciding what is true.

In a peer-to-peer network#

The classic formulation assumes a broker, or an elected leader, that assigns the order. Gargantis has neither: there is no central server and every node is ephemeral. What the protocol keeps is the shape — records appended and replayed in order — carried by the Web Stream Message Protocol over Helia / IPFS, where content addressing makes a record’s identity its hash and replay a matter of fetching blocks from whichever peers still hold them.

How a total order is agreed among peers — or whether realms should instead adopt order-free convergent structures, in which concurrent updates merge without anyone agreeing on a sequence — is not yet specified. The prior art below maps that design space.

Similar concepts and prior art:

See also#