SlideShare una empresa de Scribd logo
1 de 41
Descargar para leer sin conexión
Tips for writing Apache Fluo
Applications
Keith Turner
Peterson Technologies
Percolator : Google’s Use Case
● Terabytes of new data coming in each day
● To build index: join new data with petabytes of existing data.
● Joining new data with existing data via Map Reduce took
multiple days.
● Using Percolator, index update time dropped from days to
minutes.
Fluo Features
● Layer on top of Accumulo
● Snapshot Isolation : only see committed data.
● Cross Row Transactions
○ Read/write data from multiple nodes
○ Fail if two transactions modify same cell : collision
○ Correct in case of faults on multiple nodes
● Observers
○ User code, executes a transaction
○ Triggered by persistent notifications.
○ Observers can trigger other observers
○ Runs in parallel on many nodes
Fluo 101 - Architecture
Accumulo
HDFS
Zookeeper
YARN
Client Cluster
Fluo Client
for App 1
Fluo Client
for App 1
Fluo Client
for App 2
Fluo Application 2Fluo Application 1
Fluo Worker
Observer1 Observer2
Fluo Oracle
Fluo Worker
ObserverA
Fluo Oracle
Fluo Worker
Observer1 Observer2
Table1 Table2
Fluo Recipes Overview
● Separate project from Fluo
● Can have different release cadence and support older versions of Fluo
● Provides higher level abstractions that build on Fluo primitives
○ Collision Free Map : recipe for many-to-many updates
○ Export Queue : recipe for updating external systems in a fault tolerant manner
○ Recording TX : recipe for recording changes made by a TX
○ Each recipe is documented and tested
● Common code
○ Transient ranges
○ Table optimizations
Observers incrementally transform datasets
Input Dataset 1
Input Dataset 2
Derived Dataset
A
Derived Dataset
B
Observer Y
Observer X
Fluo
Client
Fluo
Client
External
System
Observer Z
Uneven data -> low utilization
Tablet
Server 1
Tablet
Server 2
Tablet
Server 3
Tablet
Server 4
Tablet
Server 5
Tablet
Server 6
Input dataset 1Input dataset 2
Derived dataset A
Derived dataset B
Balance is important
Evenly spread data -> maybe high utilization
Tablet
Server 1
Tablet
Server 2
Tablet
Server 3
Tablet
Server 4
Tablet
Server 5
Tablet
Server 6
Input dataset 1
Input dataset 2
Derived dataset A
Derived dataset B
Many instances of observers running
Tablet
Server 1
Tablet
Server 2
Tablet
Server 3
Tablet
Server 4
Tablet
Server 5
Tablet
Server 6
Input dataset 1
Input dataset 2
Derived dataset A
Derived dataset B
X X X X X X X X X X X X X X X X X
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
Balancing details
● Fluo Recipes provides an API to specify table ranges to
balance
● Other recipes use this balancing API
● Implementation uses Accumulo RegexGroupBalancer
introduced in 1.7.0
May still have hotspots
● Popular keys may cluster. Add short hash to prefix.
● <prefix>:<hash of key>:<key>
● p:a8j42:com.example/popular-link
● Fluo Recipes can help hash and evenly spread data.
○ Generates tablet splits for hashed prefix
○ Generates balancing config for hashed prefix
○ Util code to add/remove hash+prefix
Incrementing link counts
//When a document changes, determine changes in its links
foreach(url : newOutlinks)
C = tx.get(url, ‘inLinks’)
tx.set(url, ‘inLinks’, C + 1)
foreach(url : removedOutlinks)
C = tx.get(url, ‘inLinks’)
tx.set(url, ‘inLinks’, C - 1)
Collisions : One TX fails
Observer 1
Processing
Doc2
URL 1
URL 2
URL 3
Transactions attempting to
update URL in link count.
Do this by reading current
count, adding or subtracting
1, writing back.
Observer 1
Processing
Doc1
Queue updates for url
//When a document changes, determine changes in its links
foreach(url : newOutlinks)
tx.set(url, ‘queue:’+uuid, +1)
foreach(url : removedOutlinks)
tx.set(url, ‘queue:’+uuid, -1)
Use queues + multiple txs to avoid collisions
Observer 1
Processing
Doc2
URL 1
Update
Queue
URL 2
Update
Queue
URL 3
Update
Queue
Observer 1
Processing
Doc1
Observer 2
Processing
Queue
Observer 2
Processing
Queue
Observer 2
Processing
Queue
URL 1
URL 2
URL 3
Updates leave a trail
An Accumulo’s Tablet’s files
K1.1=45
K2.1=22
K3.1=99
.
.
A ton of
other key
values
Flush a file with some updates
An Accumulo’s Tablet’s files
K1.1=45
K2.1=22
K3.1=99
.
.
A ton of
other key
values
K1U.1=+1
K1U.2=-2
K2U.1=+5
K2U.2=-7
Flush a file with some deletes
An Accumulo’s Tablet’s files
K1.1=45
K2.1=22
K3.1=99
.
.
A ton of
other key
values
K1U.1=+1
K1U.2=-2
K2U.1=+5
K2U.2=-7
K1.2=44
K2.2=20
K1U.1
K1U.2
K2U.1
K2U.2
Compact smaller files into one
An Accumulo’s Tablet’s files
K1.1=45
K2.1=22
K3.1=99
.
.
A ton of
other key
values
K1.2=44
K2.2=20
K1U.1
K1U.2
K2U.1
K2U.2
Compacting all files drops delete markers
An Accumulo’s Tablet’s files
K1.2=44
K2.2=20
K3.1=99
.
.
A ton of
other key
values
Compactions will clean it up
● Too expensive to compact all data
● Accumulation of delete markers will cause slow down
● Accumulo supports compactions of ranges
● Organize data so that updates are in separate ranges.
● <update prefix>:<hash of key>:<key>
● <data prefix>:<hash of key>:<key>
● Use fluo scan raw command to see trail of data left by
transactions
Fluo Table
Derived
dataset A
Updates
for
A
Derived
dataset B
Updates
For
B
Input
dataset 2
Input
dataset 1
Can compact
just these
ranges.
Evenly spread update data
Tablet
Server 1
Tablet
Server 2
Tablet
Server 3
Tablet
Server 4
Tablet
Server 5
Tablet
Server 6
Input dataset 1
Input dataset 2
Derived dataset A Updates
Derived dataset A
Derived dataset B Updates
Derived dataset B
Transient data
● Fluo Recipes provides transient data registry
○ Used by other recipes (export Q and CFM)
● Fluo Recipes has a utility to compact transient ranges
○ Since data is evenly spread, compactions are also
○ Utility periodically compacts
Collision Free Map Recipe
● Recipe that implements queued update pattern
● Like map reduce, but continuous
● Two transactions
○ One queues updates to one or more values.
○ One processes queued updates.
● User provides two functions
○ Combiner
○ Update Observer
Exporting Data
● Export data from Fluo to external system
○ Useful for continuously updating an external user facing query system
● Assume external system needs to see every change
Exporting Data from Transaction
oldV = tx1.get(K1,”old”)
newV = tx1.get(K1,”new”)
exportDiffsExternalSystem(K1,oldV,newV)
//update old and new
tx1.commit()
Committ
ed
Key oldV newV
True K1 9 13
False K1 13 17
True K1 13 21
True K1 21 37
Assume external system deletes old and inserts new. Oh no
17 is inserted and never deleted.
Export Queue Recipe
● Only export committed data.
● Transactions add key/values to export queue
○ Gives each export entry a sequence number.
○ Only makes it in queue if tx succeeds
● User provides an idempotent export function.
○ Passed list of (key,seq,value)
● Receiving system must handle out of order and redundant
data.
○ Sequence can help
○ Use sequence number for timestamp when exporting to Accumulo
● Automatic balancing config, transient range config, and table
splits.
Export Queue
Transaction tx1
oldV = tx1.get(K1,”old”)
newV = tx1.get(K1,”new”)
queueExport(K1,oldV,newV)
tx1.commit()
Key Sequen
ce
oldV newV
K1 6 9 13
K1 13 13 21
K1 45 21 37
Export Queue Observer
● Transactions add to export queue and
notify observer
● An observer will export data on queue
○ May export same data multiple times
Ke
y
Sequen
ce
old
V
new
V
K1 6 9 13
K1 17 13 21
K1 45 21 37
Example of data being exported twice
● TX1 : Export K1,6,9,13
● TX1 : Export K1,17,13,21
● TX1 : Fault
● TX2 : Export K1,6,9,13
● TX2 : Export K1,17,13,21
● TX2 : Export K1,45,21,37
● TX2 : delete queued exports
● TX2 : commit
Evenly spread export data
Tablet
Server 1
Tablet
Server 2
Tablet
Server 3
Tablet
Server 4
Tablet
Server 5
Tablet
Server 6
Input dataset 1
Input dataset 2
Derived dataset A Updates
Derived dataset A
Derived dataset B Updates
Derived dataset B
Export Queue
Invert on export
● Compute information to index in Fluo
● Invert information when exporting
● Assume want to build a system that can answer following.
○ For a domain, which page has the most inbound links?
○ For a page, how many inbound links does it have?
○ For all pages, which page has the most inbound links?
● Index number of inbound links three ways.
○ Do not need to build 3 indexes in fluo.
○ Compute # of inbound links in fluo and export.
○ On export, update 3 indexes.
● Fluo orchestrates reliably and incrementally updating
external index.
Invert on export example
● URI1 incount changes from
90 to 115
● Queues URI1:90:115 for
export
● Makes 5 updates for one
export queue entry
Export actions
Action Row
Insert t:(99999-115) <uri>
Insert d:<domain>:(99999-115
) <uri>
Insert p:<uri> incount 115
Delete t:(99999-90) <uri>
Delete d:<domain>:(99999-90)
<uri>
Webindex video
Same row different columns
Tablet A
Row 1
Row 2
Tablet B
Row 3
Row 4
TX1
Fluo Client L
TX2
Fluo Client N
TX3
Fluo Client P
TX4
Fluo Client R
Col U
Col V
Col W
Col X
Row Locking
● Fluo uses Accumulo Conditional Mutations
● Tserver locks entire row to check conditions
● Concurrent transactions against a single row can slow each
other, even if they do not collide.
Example Schemas
Row Column Row Lock
Contention
<node1> edge:<node2> Likely
<node1>/<node2> edge Unlikely
How much work should an observer do?
● Reasons to do less work :
○ Has to fit into memory.
○ Should have a low probability of collisions.
● Reasons to do more work :
○ Minimizing total # of seeks
○ Avoiding recomputation
Fluo Releases
● Fluo 1.0.0 Release vote passed on October 4th
● Fluo Recipes 1.0.0 will be released soon
● Did well on 3 day cluster test
● Will follow semver
Fluo Tour
● Self guided set of exercises on website
● Considering stepping through it at hackathon tonight
Moved to Apache
https://fluo.apache.org

Más contenido relacionado

Último

RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Thomas Poetter
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024Timothy Spann
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...GQ Research
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 

Último (20)

RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Accumulo Summit 2016: Tips for Writing Fluo Applications

  • 1. Tips for writing Apache Fluo Applications Keith Turner Peterson Technologies
  • 2. Percolator : Google’s Use Case ● Terabytes of new data coming in each day ● To build index: join new data with petabytes of existing data. ● Joining new data with existing data via Map Reduce took multiple days. ● Using Percolator, index update time dropped from days to minutes.
  • 3. Fluo Features ● Layer on top of Accumulo ● Snapshot Isolation : only see committed data. ● Cross Row Transactions ○ Read/write data from multiple nodes ○ Fail if two transactions modify same cell : collision ○ Correct in case of faults on multiple nodes ● Observers ○ User code, executes a transaction ○ Triggered by persistent notifications. ○ Observers can trigger other observers ○ Runs in parallel on many nodes
  • 4. Fluo 101 - Architecture Accumulo HDFS Zookeeper YARN Client Cluster Fluo Client for App 1 Fluo Client for App 1 Fluo Client for App 2 Fluo Application 2Fluo Application 1 Fluo Worker Observer1 Observer2 Fluo Oracle Fluo Worker ObserverA Fluo Oracle Fluo Worker Observer1 Observer2 Table1 Table2
  • 5. Fluo Recipes Overview ● Separate project from Fluo ● Can have different release cadence and support older versions of Fluo ● Provides higher level abstractions that build on Fluo primitives ○ Collision Free Map : recipe for many-to-many updates ○ Export Queue : recipe for updating external systems in a fault tolerant manner ○ Recording TX : recipe for recording changes made by a TX ○ Each recipe is documented and tested ● Common code ○ Transient ranges ○ Table optimizations
  • 6. Observers incrementally transform datasets Input Dataset 1 Input Dataset 2 Derived Dataset A Derived Dataset B Observer Y Observer X Fluo Client Fluo Client External System Observer Z
  • 7. Uneven data -> low utilization Tablet Server 1 Tablet Server 2 Tablet Server 3 Tablet Server 4 Tablet Server 5 Tablet Server 6 Input dataset 1Input dataset 2 Derived dataset A Derived dataset B
  • 9. Evenly spread data -> maybe high utilization Tablet Server 1 Tablet Server 2 Tablet Server 3 Tablet Server 4 Tablet Server 5 Tablet Server 6 Input dataset 1 Input dataset 2 Derived dataset A Derived dataset B
  • 10. Many instances of observers running Tablet Server 1 Tablet Server 2 Tablet Server 3 Tablet Server 4 Tablet Server 5 Tablet Server 6 Input dataset 1 Input dataset 2 Derived dataset A Derived dataset B X X X X X X X X X X X X X X X X X Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
  • 11. Balancing details ● Fluo Recipes provides an API to specify table ranges to balance ● Other recipes use this balancing API ● Implementation uses Accumulo RegexGroupBalancer introduced in 1.7.0
  • 12. May still have hotspots ● Popular keys may cluster. Add short hash to prefix. ● <prefix>:<hash of key>:<key> ● p:a8j42:com.example/popular-link ● Fluo Recipes can help hash and evenly spread data. ○ Generates tablet splits for hashed prefix ○ Generates balancing config for hashed prefix ○ Util code to add/remove hash+prefix
  • 13. Incrementing link counts //When a document changes, determine changes in its links foreach(url : newOutlinks) C = tx.get(url, ‘inLinks’) tx.set(url, ‘inLinks’, C + 1) foreach(url : removedOutlinks) C = tx.get(url, ‘inLinks’) tx.set(url, ‘inLinks’, C - 1)
  • 14. Collisions : One TX fails Observer 1 Processing Doc2 URL 1 URL 2 URL 3 Transactions attempting to update URL in link count. Do this by reading current count, adding or subtracting 1, writing back. Observer 1 Processing Doc1
  • 15. Queue updates for url //When a document changes, determine changes in its links foreach(url : newOutlinks) tx.set(url, ‘queue:’+uuid, +1) foreach(url : removedOutlinks) tx.set(url, ‘queue:’+uuid, -1)
  • 16. Use queues + multiple txs to avoid collisions Observer 1 Processing Doc2 URL 1 Update Queue URL 2 Update Queue URL 3 Update Queue Observer 1 Processing Doc1 Observer 2 Processing Queue Observer 2 Processing Queue Observer 2 Processing Queue URL 1 URL 2 URL 3
  • 17. Updates leave a trail An Accumulo’s Tablet’s files K1.1=45 K2.1=22 K3.1=99 . . A ton of other key values
  • 18. Flush a file with some updates An Accumulo’s Tablet’s files K1.1=45 K2.1=22 K3.1=99 . . A ton of other key values K1U.1=+1 K1U.2=-2 K2U.1=+5 K2U.2=-7
  • 19. Flush a file with some deletes An Accumulo’s Tablet’s files K1.1=45 K2.1=22 K3.1=99 . . A ton of other key values K1U.1=+1 K1U.2=-2 K2U.1=+5 K2U.2=-7 K1.2=44 K2.2=20 K1U.1 K1U.2 K2U.1 K2U.2
  • 20. Compact smaller files into one An Accumulo’s Tablet’s files K1.1=45 K2.1=22 K3.1=99 . . A ton of other key values K1.2=44 K2.2=20 K1U.1 K1U.2 K2U.1 K2U.2
  • 21. Compacting all files drops delete markers An Accumulo’s Tablet’s files K1.2=44 K2.2=20 K3.1=99 . . A ton of other key values
  • 22. Compactions will clean it up ● Too expensive to compact all data ● Accumulation of delete markers will cause slow down ● Accumulo supports compactions of ranges ● Organize data so that updates are in separate ranges. ● <update prefix>:<hash of key>:<key> ● <data prefix>:<hash of key>:<key> ● Use fluo scan raw command to see trail of data left by transactions
  • 23. Fluo Table Derived dataset A Updates for A Derived dataset B Updates For B Input dataset 2 Input dataset 1 Can compact just these ranges.
  • 24. Evenly spread update data Tablet Server 1 Tablet Server 2 Tablet Server 3 Tablet Server 4 Tablet Server 5 Tablet Server 6 Input dataset 1 Input dataset 2 Derived dataset A Updates Derived dataset A Derived dataset B Updates Derived dataset B
  • 25. Transient data ● Fluo Recipes provides transient data registry ○ Used by other recipes (export Q and CFM) ● Fluo Recipes has a utility to compact transient ranges ○ Since data is evenly spread, compactions are also ○ Utility periodically compacts
  • 26. Collision Free Map Recipe ● Recipe that implements queued update pattern ● Like map reduce, but continuous ● Two transactions ○ One queues updates to one or more values. ○ One processes queued updates. ● User provides two functions ○ Combiner ○ Update Observer
  • 27. Exporting Data ● Export data from Fluo to external system ○ Useful for continuously updating an external user facing query system ● Assume external system needs to see every change
  • 28. Exporting Data from Transaction oldV = tx1.get(K1,”old”) newV = tx1.get(K1,”new”) exportDiffsExternalSystem(K1,oldV,newV) //update old and new tx1.commit() Committ ed Key oldV newV True K1 9 13 False K1 13 17 True K1 13 21 True K1 21 37 Assume external system deletes old and inserts new. Oh no 17 is inserted and never deleted.
  • 29. Export Queue Recipe ● Only export committed data. ● Transactions add key/values to export queue ○ Gives each export entry a sequence number. ○ Only makes it in queue if tx succeeds ● User provides an idempotent export function. ○ Passed list of (key,seq,value) ● Receiving system must handle out of order and redundant data. ○ Sequence can help ○ Use sequence number for timestamp when exporting to Accumulo ● Automatic balancing config, transient range config, and table splits.
  • 30. Export Queue Transaction tx1 oldV = tx1.get(K1,”old”) newV = tx1.get(K1,”new”) queueExport(K1,oldV,newV) tx1.commit() Key Sequen ce oldV newV K1 6 9 13 K1 13 13 21 K1 45 21 37
  • 31. Export Queue Observer ● Transactions add to export queue and notify observer ● An observer will export data on queue ○ May export same data multiple times Ke y Sequen ce old V new V K1 6 9 13 K1 17 13 21 K1 45 21 37 Example of data being exported twice ● TX1 : Export K1,6,9,13 ● TX1 : Export K1,17,13,21 ● TX1 : Fault ● TX2 : Export K1,6,9,13 ● TX2 : Export K1,17,13,21 ● TX2 : Export K1,45,21,37 ● TX2 : delete queued exports ● TX2 : commit
  • 32. Evenly spread export data Tablet Server 1 Tablet Server 2 Tablet Server 3 Tablet Server 4 Tablet Server 5 Tablet Server 6 Input dataset 1 Input dataset 2 Derived dataset A Updates Derived dataset A Derived dataset B Updates Derived dataset B Export Queue
  • 33. Invert on export ● Compute information to index in Fluo ● Invert information when exporting ● Assume want to build a system that can answer following. ○ For a domain, which page has the most inbound links? ○ For a page, how many inbound links does it have? ○ For all pages, which page has the most inbound links? ● Index number of inbound links three ways. ○ Do not need to build 3 indexes in fluo. ○ Compute # of inbound links in fluo and export. ○ On export, update 3 indexes. ● Fluo orchestrates reliably and incrementally updating external index.
  • 34. Invert on export example ● URI1 incount changes from 90 to 115 ● Queues URI1:90:115 for export ● Makes 5 updates for one export queue entry Export actions Action Row Insert t:(99999-115) <uri> Insert d:<domain>:(99999-115 ) <uri> Insert p:<uri> incount 115 Delete t:(99999-90) <uri> Delete d:<domain>:(99999-90) <uri>
  • 36. Same row different columns Tablet A Row 1 Row 2 Tablet B Row 3 Row 4 TX1 Fluo Client L TX2 Fluo Client N TX3 Fluo Client P TX4 Fluo Client R Col U Col V Col W Col X
  • 37. Row Locking ● Fluo uses Accumulo Conditional Mutations ● Tserver locks entire row to check conditions ● Concurrent transactions against a single row can slow each other, even if they do not collide. Example Schemas Row Column Row Lock Contention <node1> edge:<node2> Likely <node1>/<node2> edge Unlikely
  • 38. How much work should an observer do? ● Reasons to do less work : ○ Has to fit into memory. ○ Should have a low probability of collisions. ● Reasons to do more work : ○ Minimizing total # of seeks ○ Avoiding recomputation
  • 39. Fluo Releases ● Fluo 1.0.0 Release vote passed on October 4th ● Fluo Recipes 1.0.0 will be released soon ● Did well on 3 day cluster test ● Will follow semver
  • 40. Fluo Tour ● Self guided set of exercises on website ● Considering stepping through it at hackathon tonight