The latest version of the specification is version v2.

Snapshot

A snapshot is the dataset resulting from walking through the log start to end and taking the latest data for each element.

type Snapshot =
  Dict ID Entry

When the snapshot is for the latest change the elements are called records.

A snapshot can be seen as a function collect that derives the snapshot from a given log:

collect : Log -> Snapshot

The algorithm:

  1. Let log be the full log to parse.

  2. Let result be an empty associative array.

  3. Foreach entry in the log:

    1. If the entry has bigger number than the one in result or it doesn't exist, add (key, entry) to result.

      Otherwise, do nothing.

To get a previous snapshot, take an slice of the log from the start.

A picture of transforming a log into a snapshot

A snapshot is sometimes referred as version of the dataset.

© Crown copyright released under the Open Government Licence.