SlideShare une entreprise Scribd logo
1  sur  33
Sky




4 장 Google의 분산 Data 처리
   Review

   MapReduce

   Sawzall
Repository
                 DocIndex
                                                          ②
         ⑩                          ③
                 Lexicon                               Crawler
                            구조 해석                       Crawler
                                                         Crawler
             ⑧
Search                      ④                                      ①
Server                      단어 처리                      URL Server
                                          ⑤
         ⑨
                            Link 처리                        ⑥
                                                URLlist
                 Barrels        Ranking
                                          ⑦      Links
Switch
                     Cluster    Cluster
PC    PC

PC    PC
                               Cluster
PC    PC             Cluster
                               Cluster
PC    PC


Rack       Cluster    Data Center
Shard
                       Index 검색 후              Cluster
            이용자의
                       목록 반환
 검          검색요청 분석
 색                         Index
 요                         Server
 청     LB    GWS


                                     Ranking
                           GWS       결과 반영



Good
       검색                 Document
       결과    GWS           Server

            HTML로 정리         정보생성
Client            Master                 Chubby           Master


                                         Tablet
                                         Server
         Chunk         Chunk
         Server        Server            Tablet           GFS
                                Client
                                         Server

                                         Tablet
         H   D        D                  Server

             < GFS >                       < Bigtable >
 MapReduce
 MapReduce – Ex
 MapReduce – 전체 모습
 3단계 처리
 분산 처리
 Usage
고속화
 실행 과정
   분산처리를 위한 기반기술
             MapReduce           GFS




                 방대한 양의 Data 효율적인 처리



   MapReduce?
     Map + Reduce !
   Map
     어떤 data의 집합을 받아들여 새로운 data를 처리하는 기술
     < 키, 값 > → < 키’, 값’ >*
     주어진 키를 사용하여 새로운 키와 값을 원하는 만큼 생성
     Map(2배, [1,2,3]) → [2,4,6]

   Reduce
     Map에 의해 만들어진 data를 모아서 최종적으로 원하는
      결과로 만들어내는 Process
     < 키’, 값’ *> → 값’’*
     같은 키의 값을 하나로 통합 시킴
     Reduce(덧셈, [2,4,6]) → 12
역 Index
        docID = 1
                                                                wordID      docID   위치
   벚꽃학교의 페이지                                                        101       1     1
                                                                              2     1
        docID = 2
                                                                    201       1     2
   단풍학교의 페이지                         단어      wordID
                                                                              2     2
                                     학교       101
                                                                    203       1     3
                                         의    201
                                                                              2     3
                                    페이지       203
                                                                    301       1     0
                                     벚꽃       301
                                                                    302       2     0
                                     단풍       302


                                                          Shuffle                             Reduce
              Map의 출력
                                                  키                                     값(wordID = docID:위치, …)
   키                     키                                값(docID:위치)의 List
           값(docID)              값(docID)      (wordID)
(wordID)              (wordID)                                                                101 = 1:1 2:1
                                                 101            1:1 2:1
  301         1:0       302        2:0                                                        201 = 1:2 2:2
                                                 201            1:2 2:2
  101         1:1       101        2:1                                                        203 = 1:3 2:3
                                                 203            1:3 2:3
  201         1:2       201        2:2                                                         301 = 1:0
                                                 301                1:0
  203         1:3       203        2:3                                                         302 = 2:0
                                                 302                2:0
Master


      Worker            Worker

       Map              Reduce

GFS                              GFS

       Map              Reduce
   Map → Reduce → Shuffle

   Map
     새로운 키와 값을 출력
     Worker에서 중간 file로 저장
     Combiner : 중간 file을 쓰기 전에 Reduce한번 진행

   Shuffle
     Map의 출력을 정리하여 같은 키의 값을 모음
     Map과 병행해서 진행됨

   Reduce
     같은 키를 가진 모든 값이 모이면 Reduce를 호출
16~64MB
입력 파일        입력 1       입력 2                …           입력 M




        Map              Map            …       Map




중간 파일   1     2     …     1    2    …   R       2   …    R




        Shuffle           Shuffle                   Shuffle
        Reduce            Reduce                    Reduce




출력 파일   출력1                   출력1                     출력1
   Counter
     Map의 출력을 < 키, “1”> -> Reduce에서 “1” 개수 파악
     Key를 증가시킴으로 종류가 다양해짐, 여러 가지 출현 빈도 파악 가능

   분산 Grep
     Grep : File에서 특정 문자열을 포함하는 행을 찾는 Program

   분산 Sort
     Shuffle 과정에서 data가 key의 순서대로 정렬됨을 이용

   역 Link List
     Map에 Web Page의 URL과 HTML 전달
     < 자신의 URL, 링크한 곳의 URL >
     Web Page별로 링크하고 있는 곳의 List 얻음
   System 구성
     수 백에서 수 천대의 machine

   분산 Parameter
     M Parameter : 입력 파일을 분할하는 숫자
     R Parameter : 중간 파일을 분할하는 숫자

   Locality
     Split → Chunk
     Master는 Chunk의 처리를 가능한 Chunk를 가지고
     있는 Chunk Server와 동일한 Machine에 할당
   Work Queue
     Locality로 인해 Worker각각의 작업량에 편차 발생
     Cluster내에 있는 모든 Machine의 CPU부하와 Disk부
     하를 감시하고 있다가 부하가 적게 걸려 잇는
     Machine에게 Master를 할당

   Backup Master
     Backup Task
     Map과 Reduce가 얼마 남지 않았을 경우 동일한 처
     리를 복수의 Machine에서 동시에 실행
①   Map처리가 시작
②   Shuffle이 시작     M   M


③   Shuffle이 계속
                    M

④   Reduce처리가 시작
⑤   Reduce에 의한 출력       M



⑥   MapReduce의 완료
①   Map처리가 시작
②   Shuffle이 시작     M   M


③   Shuffle이 계속
                    M   S

④   Reduce처리가 시작
⑤   Reduce에 의한 출력   S   M



⑥   MapReduce의 완료
①   Map처리가 시작
②   Shuffle이 시작     M   S


③   Shuffle이 계속
                    S   S

④   Reduce처리가 시작
⑤   Reduce에 의한 출력   S   S



⑥   MapReduce의 완료
①   Map처리가 시작
②   Shuffle이 시작     S   S


③   Shuffle이 계속
                    S   R

④   Reduce처리가 시작
⑤   Reduce에 의한 출력   R   S



⑥   MapReduce의 완료
①   Map처리가 시작
②   Shuffle이 시작     R   R


③   Shuffle이 계속
                    R   R

④   Reduce처리가 시작
⑤   Reduce에 의한 출력   R   S



⑥   MapReduce의 완료
①   Map처리가 시작
②   Shuffle이 시작     R


③   Shuffle이 계속
④   Reduce처리가 시작
⑤   Reduce에 의한 출력       R



⑥   MapReduce의 완료
 Sawzall?
 Sawzall – 처리도
 Specification
 Command
 Protocol Buffer
표준 Aggregator
 실제 사용
 실행 시간
   분산 처리를 위해 고안된 DSL
     DSL(Domain-Specific Language), 특정 도메인 언어
   RDB의 SQL과 흡사
   GFS와 MapReduce를 기반으로 하는 언어
     Map → Filter
     Reduce → Aggregator
   키와 값의 구별이 없음
     Filter에 의해 선택된 값이 Aggregator로 정리
   정적인 유형의 절차형 Programming

   기본적인 기능만 지원 → 객체지향 X

   Interpreter → 사전 Compile 불필요

   한 번 Sawzall을 실행하면 몇천 대의 machine이
    움직이기 때문에 사전 체크가 중요
   saw command
     인수- -program : Program이 작성된 파일을 지정
     인수- -workqueue : program실행할 work queue
      cluster 이름 지정
     인수- -input_files : 입력 파일 지정
     인수- -destination : 출력 파일 지정

   dump command
     인수- -source : saw command에서 사용한 출력 파일
      지정
     인수- -format : 출력 형식 지정
   Record
     한 번에 읽어 들이는 data의 단위
   Protocol Buffer
     쓰는 쪽과 읽는 쪽의 record형식의 통일
   Google 내부에서 읽기/쓰기가 가능한 data
    는 Protocol Buffer에 의해 통일됨

   Process 간 데이터 교환
   Collection
     Emit된 값을 모두 그대로 모음
   Sample
     일부 값만을 불규칙적으로 꺼냄 – data sampling
   Sum
   Maximum
     Weight
   Top
     가장 많이 등장하는 값을 찾음
     출현 횟수의 조사
   기타 Agrregator
     Quantile
     Unique
   평균값과 분산
     입력 파일에서 다수의 수치 → 평균, 분산


   Page Rank
     Domain별로 Page Rank가 가장 높은 Web Page


   지역별 access 수
     전 세계의 검색 요청 로그를 분석, 이용자의 장소
     별 검색 수 측정
4 구글의 분산 데이터 처리
4 구글의 분산 데이터 처리
4 구글의 분산 데이터 처리

Contenu connexe

En vedette

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
 
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
 

En vedette (20)

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...
 
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
 

4 구글의 분산 데이터 처리

  • 1. Sky 4 장 Google의 분산 Data 처리
  • 2. Review  MapReduce  Sawzall
  • 3. Repository DocIndex ② ⑩ ③ Lexicon Crawler 구조 해석 Crawler Crawler ⑧ Search ④ ① Server 단어 처리 URL Server ⑤ ⑨ Link 처리 ⑥ URLlist Barrels Ranking ⑦ Links
  • 4. Switch Cluster Cluster PC PC PC PC Cluster PC PC Cluster Cluster PC PC Rack Cluster Data Center
  • 5. Shard Index 검색 후 Cluster 이용자의 목록 반환 검 검색요청 분석 색 Index 요 Server 청 LB GWS Ranking GWS 결과 반영 Good 검색 Document 결과 GWS Server HTML로 정리 정보생성
  • 6. Client Master Chubby Master Tablet Server Chunk Chunk Server Server Tablet GFS Client Server Tablet H D D Server < GFS > < Bigtable >
  • 7.  MapReduce  MapReduce – Ex  MapReduce – 전체 모습  3단계 처리  분산 처리  Usage 고속화  실행 과정
  • 8. 분산처리를 위한 기반기술 MapReduce GFS 방대한 양의 Data 효율적인 처리  MapReduce?  Map + Reduce !
  • 9. Map  어떤 data의 집합을 받아들여 새로운 data를 처리하는 기술  < 키, 값 > → < 키’, 값’ >*  주어진 키를 사용하여 새로운 키와 값을 원하는 만큼 생성  Map(2배, [1,2,3]) → [2,4,6]  Reduce  Map에 의해 만들어진 data를 모아서 최종적으로 원하는 결과로 만들어내는 Process  < 키’, 값’ *> → 값’’*  같은 키의 값을 하나로 통합 시킴  Reduce(덧셈, [2,4,6]) → 12
  • 10. 역 Index docID = 1 wordID docID 위치 벚꽃학교의 페이지 101 1 1 2 1 docID = 2 201 1 2 단풍학교의 페이지 단어 wordID 2 2 학교 101 203 1 3 의 201 2 3 페이지 203 301 1 0 벚꽃 301 302 2 0 단풍 302 Shuffle Reduce Map의 출력 키 값(wordID = docID:위치, …) 키 키 값(docID:위치)의 List 값(docID) 값(docID) (wordID) (wordID) (wordID) 101 = 1:1 2:1 101 1:1 2:1 301 1:0 302 2:0 201 = 1:2 2:2 201 1:2 2:2 101 1:1 101 2:1 203 = 1:3 2:3 203 1:3 2:3 201 1:2 201 2:2 301 = 1:0 301 1:0 203 1:3 203 2:3 302 = 2:0 302 2:0
  • 11. Master Worker Worker Map Reduce GFS GFS Map Reduce
  • 12. Map → Reduce → Shuffle  Map  새로운 키와 값을 출력  Worker에서 중간 file로 저장  Combiner : 중간 file을 쓰기 전에 Reduce한번 진행  Shuffle  Map의 출력을 정리하여 같은 키의 값을 모음  Map과 병행해서 진행됨  Reduce  같은 키를 가진 모든 값이 모이면 Reduce를 호출
  • 13. 16~64MB 입력 파일 입력 1 입력 2 … 입력 M Map Map … Map 중간 파일 1 2 … 1 2 … R 2 … R Shuffle Shuffle Shuffle Reduce Reduce Reduce 출력 파일 출력1 출력1 출력1
  • 14. Counter  Map의 출력을 < 키, “1”> -> Reduce에서 “1” 개수 파악  Key를 증가시킴으로 종류가 다양해짐, 여러 가지 출현 빈도 파악 가능  분산 Grep  Grep : File에서 특정 문자열을 포함하는 행을 찾는 Program  분산 Sort  Shuffle 과정에서 data가 key의 순서대로 정렬됨을 이용  역 Link List  Map에 Web Page의 URL과 HTML 전달  < 자신의 URL, 링크한 곳의 URL >  Web Page별로 링크하고 있는 곳의 List 얻음
  • 15. System 구성  수 백에서 수 천대의 machine  분산 Parameter  M Parameter : 입력 파일을 분할하는 숫자  R Parameter : 중간 파일을 분할하는 숫자  Locality  Split → Chunk  Master는 Chunk의 처리를 가능한 Chunk를 가지고 있는 Chunk Server와 동일한 Machine에 할당
  • 16. Work Queue  Locality로 인해 Worker각각의 작업량에 편차 발생  Cluster내에 있는 모든 Machine의 CPU부하와 Disk부 하를 감시하고 있다가 부하가 적게 걸려 잇는 Machine에게 Master를 할당  Backup Master  Backup Task  Map과 Reduce가 얼마 남지 않았을 경우 동일한 처 리를 복수의 Machine에서 동시에 실행
  • 17. Map처리가 시작 ② Shuffle이 시작 M M ③ Shuffle이 계속 M ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 M ⑥ MapReduce의 완료
  • 18. Map처리가 시작 ② Shuffle이 시작 M M ③ Shuffle이 계속 M S ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 S M ⑥ MapReduce의 완료
  • 19. Map처리가 시작 ② Shuffle이 시작 M S ③ Shuffle이 계속 S S ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 S S ⑥ MapReduce의 완료
  • 20. Map처리가 시작 ② Shuffle이 시작 S S ③ Shuffle이 계속 S R ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 R S ⑥ MapReduce의 완료
  • 21. Map처리가 시작 ② Shuffle이 시작 R R ③ Shuffle이 계속 R R ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 R S ⑥ MapReduce의 완료
  • 22. Map처리가 시작 ② Shuffle이 시작 R ③ Shuffle이 계속 ④ Reduce처리가 시작 ⑤ Reduce에 의한 출력 R ⑥ MapReduce의 완료
  • 23.  Sawzall?  Sawzall – 처리도  Specification  Command  Protocol Buffer 표준 Aggregator  실제 사용  실행 시간
  • 24. 분산 처리를 위해 고안된 DSL  DSL(Domain-Specific Language), 특정 도메인 언어  RDB의 SQL과 흡사  GFS와 MapReduce를 기반으로 하는 언어  Map → Filter  Reduce → Aggregator  키와 값의 구별이 없음  Filter에 의해 선택된 값이 Aggregator로 정리
  • 25.
  • 26. 정적인 유형의 절차형 Programming  기본적인 기능만 지원 → 객체지향 X  Interpreter → 사전 Compile 불필요  한 번 Sawzall을 실행하면 몇천 대의 machine이 움직이기 때문에 사전 체크가 중요
  • 27. saw command  인수- -program : Program이 작성된 파일을 지정  인수- -workqueue : program실행할 work queue cluster 이름 지정  인수- -input_files : 입력 파일 지정  인수- -destination : 출력 파일 지정  dump command  인수- -source : saw command에서 사용한 출력 파일 지정  인수- -format : 출력 형식 지정
  • 28. Record  한 번에 읽어 들이는 data의 단위  Protocol Buffer  쓰는 쪽과 읽는 쪽의 record형식의 통일  Google 내부에서 읽기/쓰기가 가능한 data 는 Protocol Buffer에 의해 통일됨  Process 간 데이터 교환
  • 29. Collection  Emit된 값을 모두 그대로 모음  Sample  일부 값만을 불규칙적으로 꺼냄 – data sampling  Sum  Maximum  Weight  Top  가장 많이 등장하는 값을 찾음  출현 횟수의 조사  기타 Agrregator  Quantile  Unique
  • 30. 평균값과 분산  입력 파일에서 다수의 수치 → 평균, 분산  Page Rank  Domain별로 Page Rank가 가장 높은 Web Page  지역별 access 수  전 세계의 검색 요청 로그를 분석, 이용자의 장소 별 검색 수 측정