# Percolator Background

![left](./student-guide/diagram/11-Percolator-background-knowledge-01-01.png)
------------------------------------------------------------
Percolator background

Percolator is implement on top of Bigtable, which can be said to be customized for Bigtable, and it is implement as a client library. Percolator leverages Bigtable's single-line transaction capabilities to implement multi-line transaction across machines by relying only on client-side protocols and a global timing server TSO.

Bigtable is a distributed structured data storage system introduced by Google. It was designed to process massive data. In that era, clusters were described as thousands of machines and petabytes of storage.

From the perspective of the data model, Bigtable can be understood as a sparse, multi-dimensional persistent map of key-value pairs. The format of a key-value pair is as follows:

```
(row:string, column:string,timestamp:int64)->string
```

Key is a combination of row keyword (row), column keyword (column), and timestamp (timestamp), and value is an arbitrary byte array.
In Bigtable, a row can contain multiple columns. Bigtable provides cross-column transaction capability for a single row, and Bigtable single-row transaction are used in many places in Percolator to ensure atomicity of multiple operations on the same row.

Percolator solves the problem of global timing of transactions in a distributed environment by giving transaction a global timestamp through a global timing server TSO, and solves the problem of atomic commits of distributed transaction through classic two-stage commits. More than an improved two-stage commit, Percolator covers much more and can be considered a complete distributed transaction solution. It also includes a concurrency control protocol that implement Snapshot Isolation isolation levels based on global timestamps, and gives details on how to automatically failover in the event of a failure.
