# Snapshot algorithm

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Snapshot_algorithm
> Markdown URL: https://mediated.wiki/source/Snapshot_algorithm.md
> Source: https://en.wikipedia.org/wiki/Snapshot_algorithm
> Source revision: 1354737915
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages) This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. See Wikipedia's guide to writing better articles for suggestions. (November 2016) (Learn how and when to remove this message) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Snapshot algorithm" – news · newspapers · books · scholar · JSTOR (August 2016) (Learn how and when to remove this message) (Learn how and when to remove this message)

A **snapshot algorithm** is used to create a consistent snapshot of the [global state](/source/Global_state_(computer_science)) of a [distributed system](/source/Distributed_system).[1] Due to the lack of globally shared memory and a global clock, this is not trivially possible.

## Example

Several computers work together in a distributed system. Each of them represents a bank account holding a certain amount of money. The participants can transfer money between their accounts by exchanging the messages.

To calculate the overall balance, just requesting the balance of each participant can lead to an incorrect result, as different accounts might be recorded before or after any transfers in progress. But a snapshot algorithm would avoid this as it makes sure to record the whole state in a point in time.

## Algorithms

- [Chandy–Lamport algorithm](/source/Chandy%E2%80%93Lamport_algorithm)

- [Lai–Yang algorithm](https://en.wikipedia.org/w/index.php?title=Lai%E2%80%93Yang_algorithm&action=edit&redlink=1)

- [Spezialetti–Kearns algorithm](https://en.wikipedia.org/w/index.php?title=Spezialetti%E2%80%93Kearns_algorithm&action=edit&redlink=1)

- [Mattern's algorithm](https://en.wikipedia.org/w/index.php?title=Mattern%27s_algorithm&action=edit&redlink=1)

## References

1. **[^](#cite_ref-Garg2002_1-0)** Vijay K. Garg (23 May 2002). [*Elements of Distributed Computing*](https://books.google.com/books?id=NlVBtVPeR0QC&dq=%22Snapshot+algorithm%22&pg=PA121). John Wiley & Sons. p. 121. [ISBN](/source/ISBN_(identifier)) [978-0-471-03600-5](https://en.wikipedia.org/wiki/Special:BookSources/978-0-471-03600-5).

This computer science article is a stub. You can help Wikipedia by adding missing information.

- [v](https://en.wikipedia.org/wiki/Template:Comp-sci-stub)
- [t](/source/Template_talk%3AComp-sci-stub)
- [e](https://en.wikipedia.org/wiki/Special:EditPage/Template:Comp-sci-stub)

---
Adapted from the Wikipedia article [Snapshot algorithm](https://en.wikipedia.org/wiki/Snapshot_algorithm) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Snapshot_algorithm?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
