First, the problem, because it shapes half of what SCUA is for. A live game runs on config: drop rates, feature flags, event schedules, graphics tiers, the economy numbers someone tunes at 11pm because the new shop is printing gold. None of that should require a redeploy to change, and in most studios it still does, because the alternative is standing up etcd or Consul or a Redis instance, wiring every game server to it, and teaching the team to operate it. That is a real distributed system bought to move one number. Most teams reasonably refuse the purchase, and the deploy pipeline stays the config tool.
We want changing a live number to be the easiest thing a developer
does all day. So 0.13.0 ships the small version of that distributed
system inside the language, as the cluster capability:
import cluster
let cfg = cluster.open("game_config")
cluster.set(cfg, "economy/starting_gold", 100)
print(cluster.get(cfg, "graphics/shadows/quality") ?? 1)
Open a named table, write path-shaped keys, and every node that
opened the same table converges on the same values. Writes are
last-writer-wins, with the superseded write kept in the host's audit
trail rather than lost. delete writes a tombstone that an
older in-flight write cannot resurrect. subtree pulls a
whole section in one call, and a watch lets a script react to a key
changing instead of polling it.
It is a capability like fs and net: without
--allow-cluster, import cluster is a compile
error, and the grant carries a shared secret every joining node must
present. Nodes discover each other and gossip changes; a node that
restarts rejoins and converges, and with the durable option its view
survives the restart locally. Under the hood that is Merkle-tree gossip
with delta cursors, which is exactly the sentence you should never have
to think about again. You read a table. The cluster is the runtime's
problem.