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.
External links#
Similar concepts and prior art:
- The Log: What every software engineer should know about real-time data’s unifying abstraction — Jay Kreps; the essay this entry is drawn from (LinkedIn’s original is offline, so this is the Internet Archive copy)
- Apache Kafka and its log-centric design
- State machine replication and Raft — ordering by consensus
- Conflict-free replicated data types — convergence without a total order
- Lamport timestamps and vector clocks — partial order without a leader
- Event sourcing — Martin Fowler; state as a replayable record of changes
- Transaction log, write-ahead logging, journaling file system, and log-structured file system on Wikipedia
- Merkle DAG — how IPFS names and links immutable records