A snapshot in Zanzibar is Spanner's changelog run again somewhere else, and replication is the work of Spanner, not of the Zanzibar servers.
Snapshots are backups, and the backups are used to index the system.
A database keeps a log of every change. An instance that crashes looks at its log, and a failed transaction is undone with more operations. The database can be thought of as its log.
Keys 1 to 5 hold the values 10, 10, 10, 20, 20. There are two ways to copy them:
- Send every key value pair.
- Send the log (add 10 to 1, add 20 to 4, and so on) and repeat the operations in the same order. The result is the same database.
The snapshot is made the second way, from the changelogs in Spanner.
The five voting replicas are in the USA, in three regions, and use Paxos. The other replicas have no vote and still get the latest values.
Replication happens in Spanner. The Zanzibar servers are caches, and a cache evicts old entries.