Large-scale Incremental ProcessingUsing Distributed Transactions and Notifications
Daniel Peng and Frank Dabek
Google, Inc.
OSDI 2010
15 Feb 2012
Presentation @ IDB Lab. Seminar
Presented by Jee-bum Park
IDB-bluelogo(shadow).jpg
Outline
Introduction
Design
Bigtable overview
Transactions
Notifications
Evaluation
Conclusion
Good and Not So Good Things
2
IDB-bluelogo(shadow).jpg
Introduction
How can Google find the documents on the web so fast?
3
http://kamvar.org/assets/images/personalized-search_orange.jpg
http://www.whitefireseo.com/wp-content/uploads/2011/07/Google-logo.jpg
http://www.euroccor.com/images/document_handling.jpg
IDB-bluelogo(shadow).jpg
Introduction
Google uses an index, built by the indexing system, that can beused to answer search queries
4
http://brookecmartin.files.wordpress.com/2010/02/istock_000002330803xsmall1.jpg
http://kamvar.org/assets/images/personalized-search_orange.jpg
http://www.whitefireseo.com/wp-content/uploads/2011/07/Google-logo.jpg
IDB-bluelogo(shadow).jpg
Introduction
What does the indexing system do?
Crawling every page on the web
Parsing the documents
Extracting links
Clustering duplicates
Inverting links
Computing PageRank
...
5
IDB-bluelogo(shadow).jpg
Introduction
PageRank
6
\mathbf{R}(t+1) = d \mathcal{M}\mathbf{R}(t) + \frac{1-d}{N} \mathbf{1}
|\mathbf{R}(t+1) - \mathbf{R}(t)| < \epsilon
File:PageRank-hi-res.png
http://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/PageRanks-Example.svg/400px-PageRanks-Example.svg.png
IDB-bluelogo(shadow).jpg
Introduction
Compute PageRank using MapReduce
Job 1: compute R(1)
Job 2: compute R(2)
Job 3: compute R(3)
...
7
\mathbf{R}(t+1) = d \mathcal{M}\mathbf{R}(t) + \frac{1-d}{N} \mathbf{1}
|\mathbf{R}(t+1) - \mathbf{R}(t)| < \epsilon
R(t) =
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Introduction
Now, consider how to update that index after recrawling somesmall portion of the web
8
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Introduction
Now, consider how to update that index after recrawling somesmall portion of the web
Is it okay to run the MapReducesover just new pages?
9
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Introduction
Now, consider how to update that index after recrawling somesmall portion of the web
Is it okay to run the MapReducesover just new pages?
Nope, there are links between thenew pages and the rest of the web
10
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Introduction
Now, consider how to update that index after recrawling somesmall portion of the web
Is it okay to run the MapReducesover just new pages?
Nope, there are links between thenew pages and the rest of the web
Well, how about this?
11
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Introduction
Now, consider how to update that index after recrawling somesmall portion of the web
Is it okay to run the MapReducesover just new pages?
Nope, there are links between thenew pages and the rest of the web
Well, how about this?
MapReduces must be run again over the entire repository
12
File:PageRank-hi-res.png
\mathbf{R}(t+1) = d \mathcal{M}\mathbf{R}(t) + \frac{1-d}{N} \mathbf{1}
IDB-bluelogo(shadow).jpg
Introduction
Google’s web search index was produced in this way
Running over the entire pages
It was not a critical issue,
Because given enough computing resources, MapReduce’s scalabilitymakes this approach feasible
However, reprocessing the entire web
Discards the work done in earlier runs
Makes latency proportional to the size of the repository, rather than thesize of an update
13
IDB-bluelogo(shadow).jpg
Introduction
An ideal data processing system for the task of maintaining theweb search index would be optimized for incremental processing
Incremental processing system: Percolator
14
File:PageRank-hi-res.png
IDB-bluelogo(shadow).jpg
Outline
Introduction
Design
Bigtable overview
Transactions
Notifications
Evaluation
Conclusion
Good and Not So Good Things
15
IDB-bluelogo(shadow).jpg
Design
Percolator is built on top of the Bigtable distributed storage system
A Percolator system consists of three binaries that run on everymachine in the cluster
A Percolator worker
A Bigtable tablet server
A GFS chunkserver
All observers (user applications) are linked into the Percolator worker
16
IDB-bluelogo(shadow).jpg
Design
Dependencies
17
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
IDB-bluelogo(shadow).jpg
Design
System architecture
18
	Observers	Percolator worker	Bigtable tablet server	GFS chunkserver
	Observers	Percolator worker	Bigtable tablet server	GFS chunkserver
	Observers	Percolator worker	Bigtable tablet server	GFS chunkserver
Timestamp oracleservice
Lightweight lockservice
IDB-bluelogo(shadow).jpg
Design
The Percolator worker
Scans the Bigtable for changed columns
Invokes the corresponding observers as a function call in the workerprocess
The observers
Perform transactions by sending read/write RPCs to  Bigtable tablet servers
19
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
IDB-bluelogo(shadow).jpg
Design
The Percolator worker
Scans the Bigtable for changed columns
Invokes the corresponding observers as a function call in the workerprocess
The observers
Perform transactions by sending read/write RPCs to  Bigtable tablet servers
20
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
1: scan
IDB-bluelogo(shadow).jpg
Design
The Percolator worker
Scans the Bigtable for changed columns
Invokes the corresponding observers as a function call in the workerprocess
The observers
Perform transactions by sending read/write RPCs to  Bigtable tablet servers
21
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
1: scan
2: invoke
IDB-bluelogo(shadow).jpg
Design
The Percolator worker
Scans the Bigtable for changed columns
Invokes the corresponding observers as a function call in the workerprocess
The observers
Perform transactions by sending read/write RPCs to  Bigtable tablet servers
22
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
1: scan
2: invoke
3: RPC
IDB-bluelogo(shadow).jpg
Design
The timestamp oracle service
Provides strictly increasing timestamps
A property required for correct operation of the snapshot isolation protocol
The lightweight lock service
Workers use it to make the search for dirty notifications more efficient
23
Timestamp oracleservice
Lightweight lockservice
IDB-bluelogo(shadow).jpg
Design
Percolator provides two main abstractions
Transactions
Cross-row, cross-table with ACID snapshot-isolation semantics
Observers
Similar to database triggers or events
24
Transactions
Observers
Percolator
IDB-bluelogo(shadow).jpg
Design – Bigtable overview
Percolator is built on top of the Bigtable distributed storagesystem
Bigtable presents a multi-dimensional sorted map to users
Keys are (row, column, timestamp) tuples
Bigtable provides lookup, update operations, and transactions onindividual rows
Bigtable does not provide multi-row transactions
25
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator provides cross-row, cross-table transactions with ACIDsnapshot-isolation semantics
26
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator stores multiple versions of each data item usingBigtable’s timestamp dimension
Multiple versions are required to provide snapshot isolation
Snapshot isolation
27
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
3
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
28
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
29
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://images-4.findicons.com/files/icons/977/rrze/720/lock.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
30
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://images-4.findicons.com/files/icons/977/rrze/720/lock.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
31
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
32
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://images-4.findicons.com/files/icons/977/rrze/720/lock.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 1: use exclusive locks
33
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://images-4.findicons.com/files/icons/977/rrze/720/lock.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
34
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
35
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
36
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
37
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
38
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
39
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://photos.weddingbycolor-nocookie.com/p000025646-m162201-p-photo-424571/question-mark.jpg
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 2: do not use any locks
40
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://photos.weddingbycolor-nocookie.com/p000025646-m162201-p-photo-424571/question-mark.jpg
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
41
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
42
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
43
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
44
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
45
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
46
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
47
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
1
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
48
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
49
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
50
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://elasticwords.files.wordpress.com/2011/06/exclamation_mark1.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Case 3: use multiple versioning & timestamp
51
http://www.docmosis.com/docmosisfiles/icons/database-icon.png
http://www.veryicon.com/icon/png/System/eWorld%20X%20eSystem/RAM%20Chip.png
2
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://aux.iconpedia.net/uploads/1516167603212363444.png
http://elasticwords.files.wordpress.com/2011/06/exclamation_mark1.png
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator stores its locks in special in-memory columns in thesame Bigtable
52
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator transaction demo
53
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator transaction demo
54
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator transaction demo
55
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator transaction demo
56
IDB-bluelogo(shadow).jpg
Design – Transactions
Percolator transaction demo
57
IDB-bluelogo(shadow).jpg
Design – Notifications
In Percolator, the user writes code (“observers”) to be triggered bychanges to the table
Each observer registers a function and a set of columns
Percolator invokes the functions after data is written to one ofthose columns in any row
58
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
1: scan
2: invoke
3: RPC
IDB-bluelogo(shadow).jpg
A Percolator application
Design – Notifications
Percolator applications are structured as a series of observers
Each observer completes a task and creates more work for “downstream”observers by writing to the table
59
Observer1
Observer2
Observer4
Observer5
Observer3
Observer6
IDB-bluelogo(shadow).jpg
Google’s new indexing system
Design – Notifications
60
DocumentProcessor (parse,extract links, etc.)
Clustering
Exporter
Observers
Percolator worker
Bigtable tablet server
GFS chunkserver
1: scan
2: invoke
3: RPC
IDB-bluelogo(shadow).jpg
Design – Notifications
To implement notifications, Percolator needs to efficiently finddirty cells with observers that need to be run
To identify dirty cells, Percolator maintains a special “notify”Bigtable column, containing an entry for each dirty cell
When a transaction writes an observed cell, it also sets the correspondingnotify cell
61
IDB-bluelogo(shadow).jpg
Design – Notifications
Each Percolator worker chooses a portion of the table to scan bypicking a region of the table randomly
To avoid running observers on the same row concurrently, each workeracquires a lock from a lightweight lock service before scanning the row
62
Timestamp oracleservice
Lightweight lockservice
IDB-bluelogo(shadow).jpg
Outline
Introduction
Design
Bigtable overview
Transactions
Notifications
Evaluation
Conclusion
Good and Not So Good Things
63
IDB-bluelogo(shadow).jpg
Evaluation
Experiences with converting a MapReduce-based indexingpipeline to use Percolator
Latency
100x faster than the previous system
Simplification
The number of observers in the new system: 10
The number of MapReduces in the previous system: 100
Easier to operate
Far fewer moving parts: tablet servers, Percolator workers, chunkservers
In the old system, each of a hundred different MapReduces needed to beindividually configured and could independently fail
64
IDB-bluelogo(shadow).jpg
Evaluation
Crawl rate benchmark on 240 machines
65
IDB-bluelogo(shadow).jpg
Evaluation
Versus Bigtable
66
IDB-bluelogo(shadow).jpg
Evaluation
Fault-tolerance
67
IDB-bluelogo(shadow).jpg
Outline
Introduction
Design
Bigtable overview
Transactions
Notifications
Evaluation
Conclusion
Good and Not So Good Things
68
IDB-bluelogo(shadow).jpg
Conclusion
Percolator provides two main abstractions
Transactions
Cross-row, cross-table with ACID snapshot-isolation semantics
Observers
Similar to database triggers or events
69
Transactions
Observers
Percolator
IDB-bluelogo(shadow).jpg
Outline
Introduction
Design
Bigtable overview
Transactions
Notifications
Evaluation
Conclusion
Good and Not So Good Things
70
IDB-bluelogo(shadow).jpg
Good and Not So Good Things
Good things
Simple and neat design
Purpose of use is clear
Detailed description based on real example: Google’s indexing system
Not so good things
Lack of observer examples (Google’s indexing system in particular)
71
Thank You!
Any Questions or Comments?