Skip to content

How Sirius Works

James Wakemen edited this page Feb 24, 2014 · 4 revisions

#How it works Sirius works internally by distributing updates across all nodes in the cluster. These updates must be applied in the same order across all nodes in the cluster to maintain consistency. This sequence is created by establishing a total ordering of all updates to the state stored by Sirius. Updates are not applied until their turn comes. When applying an update a serialized version is also stored, ahead of its application, in order to allow the state to be recovered in the event of a restart.

When Sirius receives a request for an update it first decides an ordering using a variant of multi-paxos derived from the algorithm described in Paxos Made Moderately Complex. Once the Paxos algorithm arrives at a decision for the ordering it distributes this decision to the cluster. When nodes receive a new decision they notify the requesting client of the completion of ordering and queue it for application to the in-memory state. As updates may arrive out of order, they are queued in memory until their time has come to be applied. An update is applied once all prior updates have been applied. Updates that arrive at a node prior to a previous update in the Paxos total ordering sequence remain in the queue until the earlier updates are received and applied. Updates may be received from the result of a Paxos round, from local storage when recovering a node’s state, or from another node in the cluster when catching up in the event of missed updates.