SlideShare a Scribd company logo
1 of 34
Download to read offline
HaLoop: Efficient Iterative
Data Processing On Large
        Clusters
Yingyi Bu, UC Irvine
Bill Howe, UW
Magda Balazinska, UW
Michael D. Ernst, UW

                                        QuickTimeᆰ and a
                                          decompressor
                                  are needed to see this picture.
                                                                    http://escience.washington.edu/
                   Horizon
 http://clue.cs.washington.edu/
                                    May-2011, UC Berkeley Cloud Computing Seminar
Outline
   Motivation
   Caching & scheduling
   Fault-tolerance
   Programming model
   Related work
   Conclusion
   Cloud Computing Projects in UCI
Motivation
   MapReduce can’t express recursion/iteration
   Lots of interesting programs need loops
          graph algorithms
          clustering
          machine learning
          recursive queries (CTEs, datalog, WITH clause)
   Dominant solution: Use a driver program outside
    of MapReduce
   Hypothesis: making MapReduce loop-aware
    affords optimization
          lays a foundation for scalable implementations of
           recursive languages
05/03/11                       Yingyi Bu, UCI                  3
Example 1: PageRank
 Rank Table R0     Linkage Table L
url        rank
                  url_src   url_dest
www.a.com 1.0
www.b.com 1.0
                  www.a.com www.b.com                   Ri+1
                  www.a.com www.c.com
www.c.com 1.0
                  www.c.com www.a.com          π(url_dest, γurl_destSUM(rank))
www.d.com 1.0
                  www.e.com www.c.com
www.e.com 1.0
                  www.d.com www.b.com
                                             Ri.rank = Ri.rank/γurlCOUNT(url_dest)
Rank Table R3     www.c.com www.e.com
url        rank   www.e.com www.c.com
www.a.com 2.13    www.a.com www.d.com            Ri.url = L.url_src
www.b.com 3.89
www.c.com 2.60                                 Ri                 L
www.d.com 2.60
www.e.com 2.13

05/03/11                    Yingyi Bu, UCI                                     4
PageRank Implementation on MapReduce
        Join & compute rank

  Ri        M                     Aggregate         Fixpoint evaluation

Count
            M           r         M             r     M         r
L-split0
            M           r         M             r     M         r
L-split1
            M

                            Converged?
                i=i+1
                                Client
                                         done
 05/03/11                     Yingyi Bu, UCI                         5
What’s the problem?
      Ri    m

 Count
            m           r          M         r     M          r
 L-split0
            m           r          M         r     M          r
                                                        3.
 L-split1          2.
            m
 1.

  L and Count are loop invariants, but
1. They are loaded on each iteration

2. They are shuffled on each iteration

3. Also, fixpoint evaluated as a separate MapReduce job per
   iteration
05/03/11                    Yingyi Bu, UCI                        6
Example 2: Transitive Closure
       Friend              Find all transitive friends of Eric

                               R0 {Eric, Eric}


                               R1 {Eric, Elisa}

 (semi-naïve evaluation)
                               R2 {Eric, Tom
                                   Eric, Harry}

                                R3 {}


05/03/11                     Yingyi Bu, UCI                      7
Transitive Closure on MapReduce
      (compute next generation of friends)            (remove the ones
                                                      we’ve already seen)
                     Join
                                                      Dup-elim
     Si
                M
                                    r             M             r
    Friend0
                M
                                    r             M             r
    Friend1
                M
                                                  M

                                  Anything new?
           i=i+1
                                    Client
                                             done

05/03/11                                Yingyi Bu, UCI                      8
What’s the problem?
                           Join
                                                        Dupe-elim
           Si
                       M
                                        r               M      r
           Friend0
                       M
                                         r              M      r
           Friend1
                       M          2.
             1.                                         M

                Friend is loop invariant, but
       1.       Friend is loaded on each iteration
       2.       Friend is shuffled on each iteration

05/03/11                               Yingyi Bu, UCI               9
Example 3: k-means
                                                                 ki   = k centroids at iteration i

                    ki
           P0                M
                                                 r
                        ki
           P1                M
                                                 r
                    ki
           P2
                             M

                                 ki - ki+1 < threshold?


                i=i+1               Client
                                                          ki+1

                                       done


05/03/11                                 Yingyi Bu, UCI                                              10
What’s the problem?
                   ki                                        ki   = k centroids at iteration i
           P0            M
                                          r
                    ki
           P1            M
                                          r
                   ki
           P2
                         M
           1.
                             ki - ki+1 < threshold?

                i=i+1           Client                ki+1
                                   done

     P is loop invariant, but
1.   P is loaded on each iteration
05/03/11                           Yingyi Bu, UCI                                                11
Push loops into MapReduce!
   Architecture
   Cache loop-invariant data
   Scheduling
   Fault-tolerance
   Programming Model




05/03/11             Yingyi Bu, UCI   12
HaLoop Architecture




05/03/11          Yingyi Bu, UCI   13
Inter-iteration caching


           M
                                         r

           M             …
                                         r
           M

                                              Reducer output cache (RO)
                                   Reducer input cache (RI)
               Mapper output cache (MO)
   Mapper input cache (MI)
05/03/11                     Yingyi Bu, UCI                        14
RI: Reducer Input Cache
   Provides:
      Access to loop invariant data without map/shuffle
    Data:
                                                            …


      Reducer function

   Assumes:
     1. Static partitioning (implies: no new nodes)
     2. Deterministic mapper implementation

   PageRank
        Avoid loading and shuffling the web graph at
         every iteration
   Transitive Closure
        Avoid loading and shuffling the friends graph at
         every iteration
   K-means
        No help



05/03/11                                 Yingyi Bu, UCI         15
Reducer Input Cache Benefit


                                         Friends-of-friends query
                                         Billion Triples Dataset (120GB)
                                         90 small instances on EC2




           Overall run time


05/03/11                      Yingyi Bu, UCI                         16
Reducer Input Cache Benefit


                                   Friends-of-Friends query
                                   Billion Triples Dataset (120GB)
                                   90 small instances on EC2


                                          Livejournal, 12GB



           Join step only


05/03/11                Yingyi Bu, UCI                         17
Reducer Input Cache Benefit


                                 Friends-of-friends query
                                 Billion Triples Dataset (120GB)
                                 90 small instances on EC2

                                          Livejournal, 12GB




  Reduce and Shuffle of Join Step


05/03/11              Yingyi Bu, UCI                          18
RO: Reducer Output Cache
   Provides:
         Distributed access to output of previous
          iterations
   Used By:
         Fixpoint evaluation
                                                         …
   Assumes:
     1. Partitioning constant across iterations
     2. Reducer output key functionally determines
        Reducer input key

   PageRank
      Allows distributed fixpoint evaluation
      Obviates extra MapReduce job

   Transitive Closure
         No help
   K-means
         No help

05/03/11                                Yingyi Bu, UCI       19
Fixpoint evaluation (s)
                          Reducer Output Cache Benefit




                                Iteration #                             Iteration #

                            Livejournal dataset                    Freebase dataset
                            50 EC2 small instances                 90 EC2 small instances
             05/03/11                             Yingyi Bu, UCI                            20
MI: Mapper Input Cache
   Provides:
        Access to non-local mapper input on later

                                                         …
         iterations
   Data for:
        Map function
   Assumes:
     1. Mapper input does not change

   PageRank
        No help
   Transitive Closure
        No help
   K-means
        Avoids non-local data reads on iterations > 0



05/03/11                              Yingyi Bu, UCI         21
Mapper Input Cache Benefit




           5% non-local data reads;         However, Facebook has
           ~5% improvement                  70% non-local data
                                            reads!!
05/03/11                   Yingyi Bu, UCI                           22
Loop-aware Task Scheduling

 Input: Node node, int iteration
 Global variable: HashMap<Node, List<Parition>> last, HashMaph<Node,
      List<Partition>> current
 1: if (iteration ==0) {
                                                                The same as
 2:        Partition part = StandardMapReduceSchedule(node);
                                                                MapReduce
 3:        current.add(node, part);
 4: }else{
 5:        if (node.hasFullLoad()) {
 6:               Node substitution = findNearbyNode(node);
 7:                                                               Find a substitution
                  last.get(substitution).addAll(last.remove(node));
 8:               return;
 9:        }
 10:       if (last.get(node).size()>0) {
 11:                    Partition part = last.get(node).get(0);
 12:                    schedule(part, node);               Iteration-local
 13:                    current.get(node).add(part);        Schedule
 14:                    list.remove(part);
 15:       }
 16: }
05/03/11                                    Yingyi Bu, UCI                              23
Fault-tolerance (task failures)
             M               r
                                              Task failure
             M
                             r

             M

                                              Task re-execution
           Cache reloading

             M                                    M


             M                                    M
                             r                                r

             M                                    M
05/03/11                         Yingyi Bu, UCI                   24
Fault-tolerance (node failures)
            M           r
                                         node failure
            M
                        r

            M


                                         Task re-execution
      Cache reloading

            M                                M

                        r                                r

            M                                M

05/03/11                    Yingyi Bu, UCI                   25
Programming Model
   Mapper/reducer stay the same!
   Touch points
       – Input/Output: for each <iteration, step>
       – Cache filter: which tuple to cache?
           – Distance function: optional
   Nested job containing child jobs as loop body
   Minimize extra programming efforts




05/03/11                   Yingyi Bu, UCI           26
Related Work: Twister [Ekanayake HPDC 2010]

   Pipelining mapper/reducer
   Termination condition evaluated by main()
      13. while(!complete){
      14. monitor = driver.runMapReduceBCast(cData);
      15. monitor.monitorTillCompletion();

      16. DoubleVectorData newCData = ((KMeansCombiner) driver
                             .getCurrentCombiner()).getResults();
      17. totalError = getError(cData, newCData);
      18. cData = newCData;
      19.   if (totalError < THRESHOLD) {         O(k)
      20.        complete = true;
      21.        break;
      22.   }
      23. }



05/03/11                      Yingyi Bu, UCI                        27
In Detail: PageRank (Twister)
            while (!complete) {
              // start the pagerank map reduce process
              monitor = driver.runMapReduceBCast(new
                    BytesValue(tmpCompressedDvd.getBytes()));
run MR        monitor.monitorTillCompletion();
              // get the result of process
              newCompressedDvd = ((PageRankCombiner)
                    driver.getCurrentCombiner()).getResults();
              // decompress the compressed pagerank values
              newDvd = decompress(newCompressedDvd);
              tmpDvd = decompress(tmpCompressedDvd);
                                                       O(N) in the size
              totalError = getError(tmpDvd, newDvd);   of the graph
              // get the difference between new and old pagerank values
              if (totalError < tolerance) {
term.           complete = true;
cond.         }
              tmpCompressedDvd = newCompressedDvd;
            }


 05/03/11                          Yingyi Bu, UCI                         28
Related Work: Spark [Zaharia HotCloud 2010]

          Reduction output collected at driver program
               “…does not currently support a grouped reduce
                operation as in MapReduce”


           val spark = new SparkContext(<Mesos master>)    all output   sent
           var count = spark.accumulator(0)                to driver.
           for (i <- spark.parallelize(1 to 10000, 10)) {
             val x = Math.random * 2 - 1
             val y = Math.random * 2 - 1
             if (x*x + y*y < 1) count += 1
           }
           println("Pi is roughly " + 4 * count.value / 10000.0)




05/03/11                          Yingyi Bu, UCI                           29
Related Work: Pregel [Malewicz SIGMOD 2010]
    Graphs only
          clustering: k-means, canopy, DBScan
    Assumes each vertex has access to outgoing edges
    So an edge representation …

                  Edge(from, to)

     requires offline preprocessing
          perhaps using MapReduce




05/03/11                          Yingyi Bu, UCI        30
Related Work: BOOM [Alvaro EuroSys 10]

   Distributed computing based on Overlog
    (Datalog + temporal logic + more)
   Recursion supported naturally
           – app: API-compliant implementation of MR




05/03/11                  Yingyi Bu, UCI               31
Conclusions
   Relatively simple changes to MapReduce/Hadoop can
    support iterative/recursive programs
          TaskTracker (Cache management)
          Scheduler (Cache awareness)
          Programming model (multi-step loop bodies, cache control)

   Optimizations
          Caching reducer input realizes the largest gain
          Good to eliminate extra MapReduce step for termination checks
          Mapper input cache benefit inconclusive; need a busier cluster

   Future Work
          Iteration & Recursion on top of Hyracks core!


05/03/11                           Yingyi Bu, UCI                           32
Hyracks [Borkar et al., ICDE'11]
    Partitioned-Parallel Platform for data-intensive computing
          Flexible (DAGs, location constraints)
          Extensible (“micro-kernel” core, online-aggregation plugin
           (VLDB'11), B-tree plugin, R-tree plugin, Dataflow plugin...), an
           iteration/recursion plugin?

    Jobs
          Dataflow DAG of operators and connectors
          Can set location constraints
          Can use a library of operators: joins, group-by, sort and so on

    V.s. “competitors”
          V.s. Hadoop: more flexible model and less pressimistic
          V.s. Dryad: support data as first class citizens

05/03/11                           Yingyi Bu, UCI                             33
Questions?



             34

More Related Content

Recently uploaded

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Recently uploaded (20)

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

Featured

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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Efficient Iterative Data Processing On Large Clusters

  • 1. HaLoop: Efficient Iterative Data Processing On Large Clusters Yingyi Bu, UC Irvine Bill Howe, UW Magda Balazinska, UW Michael D. Ernst, UW QuickTimeᆰ and a decompressor are needed to see this picture. http://escience.washington.edu/ Horizon http://clue.cs.washington.edu/ May-2011, UC Berkeley Cloud Computing Seminar
  • 2. Outline  Motivation  Caching & scheduling  Fault-tolerance  Programming model  Related work  Conclusion  Cloud Computing Projects in UCI
  • 3. Motivation  MapReduce can’t express recursion/iteration  Lots of interesting programs need loops  graph algorithms  clustering  machine learning  recursive queries (CTEs, datalog, WITH clause)  Dominant solution: Use a driver program outside of MapReduce  Hypothesis: making MapReduce loop-aware affords optimization  lays a foundation for scalable implementations of recursive languages 05/03/11 Yingyi Bu, UCI 3
  • 4. Example 1: PageRank Rank Table R0 Linkage Table L url rank url_src url_dest www.a.com 1.0 www.b.com 1.0 www.a.com www.b.com Ri+1 www.a.com www.c.com www.c.com 1.0 www.c.com www.a.com π(url_dest, γurl_destSUM(rank)) www.d.com 1.0 www.e.com www.c.com www.e.com 1.0 www.d.com www.b.com Ri.rank = Ri.rank/γurlCOUNT(url_dest) Rank Table R3 www.c.com www.e.com url rank www.e.com www.c.com www.a.com 2.13 www.a.com www.d.com Ri.url = L.url_src www.b.com 3.89 www.c.com 2.60 Ri L www.d.com 2.60 www.e.com 2.13 05/03/11 Yingyi Bu, UCI 4
  • 5. PageRank Implementation on MapReduce Join & compute rank Ri M Aggregate Fixpoint evaluation Count M r M r M r L-split0 M r M r M r L-split1 M Converged? i=i+1 Client done 05/03/11 Yingyi Bu, UCI 5
  • 6. What’s the problem? Ri m Count m r M r M r L-split0 m r M r M r 3. L-split1 2. m 1. L and Count are loop invariants, but 1. They are loaded on each iteration 2. They are shuffled on each iteration 3. Also, fixpoint evaluated as a separate MapReduce job per iteration 05/03/11 Yingyi Bu, UCI 6
  • 7. Example 2: Transitive Closure Friend Find all transitive friends of Eric R0 {Eric, Eric} R1 {Eric, Elisa} (semi-naïve evaluation) R2 {Eric, Tom Eric, Harry} R3 {} 05/03/11 Yingyi Bu, UCI 7
  • 8. Transitive Closure on MapReduce (compute next generation of friends) (remove the ones we’ve already seen) Join Dup-elim Si M r M r Friend0 M r M r Friend1 M M Anything new? i=i+1 Client done 05/03/11 Yingyi Bu, UCI 8
  • 9. What’s the problem? Join Dupe-elim Si M r M r Friend0 M r M r Friend1 M 2. 1. M Friend is loop invariant, but 1. Friend is loaded on each iteration 2. Friend is shuffled on each iteration 05/03/11 Yingyi Bu, UCI 9
  • 10. Example 3: k-means ki = k centroids at iteration i ki P0 M r ki P1 M r ki P2 M ki - ki+1 < threshold? i=i+1 Client ki+1 done 05/03/11 Yingyi Bu, UCI 10
  • 11. What’s the problem? ki ki = k centroids at iteration i P0 M r ki P1 M r ki P2 M 1. ki - ki+1 < threshold? i=i+1 Client ki+1 done P is loop invariant, but 1. P is loaded on each iteration 05/03/11 Yingyi Bu, UCI 11
  • 12. Push loops into MapReduce!  Architecture  Cache loop-invariant data  Scheduling  Fault-tolerance  Programming Model 05/03/11 Yingyi Bu, UCI 12
  • 13. HaLoop Architecture 05/03/11 Yingyi Bu, UCI 13
  • 14. Inter-iteration caching M r M … r M Reducer output cache (RO) Reducer input cache (RI) Mapper output cache (MO) Mapper input cache (MI) 05/03/11 Yingyi Bu, UCI 14
  • 15. RI: Reducer Input Cache  Provides:  Access to loop invariant data without map/shuffle Data: …   Reducer function  Assumes: 1. Static partitioning (implies: no new nodes) 2. Deterministic mapper implementation  PageRank  Avoid loading and shuffling the web graph at every iteration  Transitive Closure  Avoid loading and shuffling the friends graph at every iteration  K-means  No help 05/03/11 Yingyi Bu, UCI 15
  • 16. Reducer Input Cache Benefit Friends-of-friends query Billion Triples Dataset (120GB) 90 small instances on EC2 Overall run time 05/03/11 Yingyi Bu, UCI 16
  • 17. Reducer Input Cache Benefit Friends-of-Friends query Billion Triples Dataset (120GB) 90 small instances on EC2 Livejournal, 12GB Join step only 05/03/11 Yingyi Bu, UCI 17
  • 18. Reducer Input Cache Benefit Friends-of-friends query Billion Triples Dataset (120GB) 90 small instances on EC2 Livejournal, 12GB Reduce and Shuffle of Join Step 05/03/11 Yingyi Bu, UCI 18
  • 19. RO: Reducer Output Cache  Provides:  Distributed access to output of previous iterations  Used By:  Fixpoint evaluation …  Assumes: 1. Partitioning constant across iterations 2. Reducer output key functionally determines Reducer input key  PageRank  Allows distributed fixpoint evaluation  Obviates extra MapReduce job  Transitive Closure  No help  K-means  No help 05/03/11 Yingyi Bu, UCI 19
  • 20. Fixpoint evaluation (s) Reducer Output Cache Benefit Iteration # Iteration # Livejournal dataset Freebase dataset 50 EC2 small instances 90 EC2 small instances 05/03/11 Yingyi Bu, UCI 20
  • 21. MI: Mapper Input Cache  Provides:  Access to non-local mapper input on later … iterations  Data for:  Map function  Assumes: 1. Mapper input does not change  PageRank  No help  Transitive Closure  No help  K-means  Avoids non-local data reads on iterations > 0 05/03/11 Yingyi Bu, UCI 21
  • 22. Mapper Input Cache Benefit 5% non-local data reads; However, Facebook has ~5% improvement 70% non-local data reads!! 05/03/11 Yingyi Bu, UCI 22
  • 23. Loop-aware Task Scheduling Input: Node node, int iteration Global variable: HashMap<Node, List<Parition>> last, HashMaph<Node, List<Partition>> current 1: if (iteration ==0) { The same as 2: Partition part = StandardMapReduceSchedule(node); MapReduce 3: current.add(node, part); 4: }else{ 5: if (node.hasFullLoad()) { 6: Node substitution = findNearbyNode(node); 7: Find a substitution last.get(substitution).addAll(last.remove(node)); 8: return; 9: } 10: if (last.get(node).size()>0) { 11: Partition part = last.get(node).get(0); 12: schedule(part, node); Iteration-local 13: current.get(node).add(part); Schedule 14: list.remove(part); 15: } 16: } 05/03/11 Yingyi Bu, UCI 23
  • 24. Fault-tolerance (task failures) M r Task failure M r M Task re-execution Cache reloading M M M M r r M M 05/03/11 Yingyi Bu, UCI 24
  • 25. Fault-tolerance (node failures) M r node failure M r M Task re-execution Cache reloading M M r r M M 05/03/11 Yingyi Bu, UCI 25
  • 26. Programming Model  Mapper/reducer stay the same!  Touch points – Input/Output: for each <iteration, step> – Cache filter: which tuple to cache? – Distance function: optional  Nested job containing child jobs as loop body  Minimize extra programming efforts 05/03/11 Yingyi Bu, UCI 26
  • 27. Related Work: Twister [Ekanayake HPDC 2010]  Pipelining mapper/reducer  Termination condition evaluated by main() 13. while(!complete){ 14. monitor = driver.runMapReduceBCast(cData); 15. monitor.monitorTillCompletion(); 16. DoubleVectorData newCData = ((KMeansCombiner) driver .getCurrentCombiner()).getResults(); 17. totalError = getError(cData, newCData); 18. cData = newCData; 19. if (totalError < THRESHOLD) { O(k) 20. complete = true; 21. break; 22. } 23. } 05/03/11 Yingyi Bu, UCI 27
  • 28. In Detail: PageRank (Twister) while (!complete) { // start the pagerank map reduce process monitor = driver.runMapReduceBCast(new BytesValue(tmpCompressedDvd.getBytes())); run MR monitor.monitorTillCompletion(); // get the result of process newCompressedDvd = ((PageRankCombiner) driver.getCurrentCombiner()).getResults(); // decompress the compressed pagerank values newDvd = decompress(newCompressedDvd); tmpDvd = decompress(tmpCompressedDvd); O(N) in the size totalError = getError(tmpDvd, newDvd); of the graph // get the difference between new and old pagerank values if (totalError < tolerance) { term. complete = true; cond. } tmpCompressedDvd = newCompressedDvd; } 05/03/11 Yingyi Bu, UCI 28
  • 29. Related Work: Spark [Zaharia HotCloud 2010]  Reduction output collected at driver program  “…does not currently support a grouped reduce operation as in MapReduce” val spark = new SparkContext(<Mesos master>) all output sent var count = spark.accumulator(0) to driver. for (i <- spark.parallelize(1 to 10000, 10)) { val x = Math.random * 2 - 1 val y = Math.random * 2 - 1 if (x*x + y*y < 1) count += 1 } println("Pi is roughly " + 4 * count.value / 10000.0) 05/03/11 Yingyi Bu, UCI 29
  • 30. Related Work: Pregel [Malewicz SIGMOD 2010]  Graphs only  clustering: k-means, canopy, DBScan  Assumes each vertex has access to outgoing edges  So an edge representation … Edge(from, to) requires offline preprocessing  perhaps using MapReduce 05/03/11 Yingyi Bu, UCI 30
  • 31. Related Work: BOOM [Alvaro EuroSys 10]  Distributed computing based on Overlog (Datalog + temporal logic + more)  Recursion supported naturally – app: API-compliant implementation of MR 05/03/11 Yingyi Bu, UCI 31
  • 32. Conclusions  Relatively simple changes to MapReduce/Hadoop can support iterative/recursive programs  TaskTracker (Cache management)  Scheduler (Cache awareness)  Programming model (multi-step loop bodies, cache control)  Optimizations  Caching reducer input realizes the largest gain  Good to eliminate extra MapReduce step for termination checks  Mapper input cache benefit inconclusive; need a busier cluster  Future Work  Iteration & Recursion on top of Hyracks core! 05/03/11 Yingyi Bu, UCI 32
  • 33. Hyracks [Borkar et al., ICDE'11]  Partitioned-Parallel Platform for data-intensive computing  Flexible (DAGs, location constraints)  Extensible (“micro-kernel” core, online-aggregation plugin (VLDB'11), B-tree plugin, R-tree plugin, Dataflow plugin...), an iteration/recursion plugin?  Jobs  Dataflow DAG of operators and connectors  Can set location constraints  Can use a library of operators: joins, group-by, sort and so on  V.s. “competitors”  V.s. Hadoop: more flexible model and less pressimistic  V.s. Dryad: support data as first class citizens 05/03/11 Yingyi Bu, UCI 33