SlideShare a Scribd company logo
1 of 17
Download to read offline
Google BigQuery 
Analytics 読書会#2 
2014/08/26(Tue) 
tagomoris
MapReduce 
ここ10年くらいのびっぐでーたなアレ 
データ処理の抽象化がキモ 
Map: データ変換 
Reduce: データ集約 
data.map(&:convert).reduce(&:aggregate)
キモ(い)
かわいい
Hadoop 
Doug CuttingがYahoo!でつくった
MapReduce Design 
実はMapとReduceだけじゃない 
Map, Combine, Shuffle, Reduce + 分散FS 
FS 
Map 
Map 
Map 
Map 
Map 
Combine 
Combine 
Combine 
Combine 
Combine 
Reduce 
Reduce FS 
Reduce 
Reduce 
shuffle
Map phase 
Map: 副作用なしで作りましょう 
これにより順序や並列度を好きにできる 
Mapper in MapReduce 
input -> [ (key, value), (key, value), ... ]
Combine phase 
Combiner in MapReduce 
Mapperの出力をまとめてI/Oを最適化 
Shufflerにわたす
Shuffle phase 
Shuffler in MapReduce: 要は並列分散sort 
sort keyはMapperの出力key 
同一keyのvalueは同一Reducerに送る 
[(k,v1),(k,v2),...] -> (k, [v1,v2,v3,...]) 
たいてい最も重い 
hash partitioningだけでよい場合も多い 
がHadoopは完全なmerge sortを行う
Reduce phase 
Reduce: 結果セットをまとめる 
Reducer in MapReduce 
(k,[v1,v2,...]) -> (k,V)
MapReduce example 
みんな大好きword count 
省略!
Storage system 
MapReduce自体はストレージ非依存 
だが実際には分散ストレージが必要 
大量の並列DiskI/Oを高スループットで処理 
する必要がある 
書かれていないが 
並列度以外にスループット確保のためのbig 
chunk sizeが必要なはず 
でも書かれてないってことはGoogleは……?
Worker management 
Worker managerが必要 
Controller in Google MapReduce 
Name Node in Hadoop: 間違い! 
正: JobTracker (MRv1) or AppMaster(MRv2) 
大量のノード管理、failed worker管理、failed 
job管理 
アクシデントで死んだworkerと、バグや入力 
データがおかしくて死んだworkerの区別
Comparative analysis(1) 
フツーのHWを買い足せばリニアにスケール 
Mapper/Reducerを書けばなんでもできる 
ノードのspinupが遅い、shuffle待ちが長い 
手を動かしながらの解析には向かない 
MapとReduceに処理を分解するのはダルい 
あれこれやると多段MRになりダルさ倍増
Comparative analysis(2) 
ダルいんでみんなあれこれ作っている 
Cascading: Java+FluentAPI -> MR 
Hive,Pig: SQL or SQL-style queries -> MR 
PigはSQLじゃないだろ……手続き型なDSL
Comparative analysis(3) 
MapReduce: 低レベルフレームワーク 
いろいろ考えないといけない 
Googleではもう普通は直接使わない 
FlumeJava経由でMapReduce使う 
デカいデータ変換とかで使われてる 
データ調査についてはDremel
Summary 
BigQueryがどう動くか見たよ 
Dremel query engine + Colossus FS 
次になんか起きたらどうにかできるかもね 
HadoopやMySQLと較べたよ 
何にでも向くものはないよね、選ぼう 
次章はいろんなクエリを見ていくよ

More Related Content

What's hot

QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
OSgeo Japan
 
Gps森林管理 カスタム・マップ(国土地理院地形図)編
Gps森林管理  カスタム・マップ(国土地理院地形図)編Gps森林管理  カスタム・マップ(国土地理院地形図)編
Gps森林管理 カスタム・マップ(国土地理院地形図)編
mondaiarimasen
 
D3.jsとthree.jsによるgeoプログラミング
D3.jsとthree.jsによるgeoプログラミングD3.jsとthree.jsによるgeoプログラミング
D3.jsとthree.jsによるgeoプログラミング
Koichiro Mori
 

What's hot (18)

05QGISで地図印刷
05QGISで地図印刷05QGISで地図印刷
05QGISで地図印刷
 
地理教育での地理院地図の活用ポイント
地理教育での地理院地図の活用ポイント地理教育での地理院地図の活用ポイント
地理教育での地理院地図の活用ポイント
 
FOSS4Gだらけの 古地図Platform Maplatのご紹介 (OFF4G 2016)
FOSS4Gだらけの古地図Platform Maplatのご紹介 (OFF4G 2016)FOSS4Gだらけの古地図Platform Maplatのご紹介 (OFF4G 2016)
FOSS4Gだらけの 古地図Platform Maplatのご紹介 (OFF4G 2016)
 
QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
QGISによる図面情報への位置情報付与手法の検討 アジア航測株式会社 野中 秀樹様
 
03紙地図をGISで使う
03紙地図をGISで使う03紙地図をGISで使う
03紙地図をGISで使う
 
GRASSセミナー基礎編
GRASSセミナー基礎編GRASSセミナー基礎編
GRASSセミナー基礎編
 
Gps森林管理 カスタム・マップ(国土地理院地形図)編
Gps森林管理  カスタム・マップ(国土地理院地形図)編Gps森林管理  カスタム・マップ(国土地理院地形図)編
Gps森林管理 カスタム・マップ(国土地理院地形図)編
 
04ベクタデータを利用した地図表現
04ベクタデータを利用した地図表現04ベクタデータを利用した地図表現
04ベクタデータを利用した地図表現
 
01GIS概論
01GIS概論01GIS概論
01GIS概論
 
Qgislecture 0
Qgislecture 0Qgislecture 0
Qgislecture 0
 
20140625 nenvgis2014
20140625 nenvgis201420140625 nenvgis2014
20140625 nenvgis2014
 
第3回ジオメディアサミットLt
第3回ジオメディアサミットLt第3回ジオメディアサミットLt
第3回ジオメディアサミットLt
 
D3.jsとthree.jsによるgeoプログラミング
D3.jsとthree.jsによるgeoプログラミングD3.jsとthree.jsによるgeoプログラミング
D3.jsとthree.jsによるgeoプログラミング
 
PCD作成手順
PCD作成手順PCD作成手順
PCD作成手順
 
NTT空間情報 ちばんMAP ご説明資料
NTT空間情報 ちばんMAP ご説明資料 NTT空間情報 ちばんMAP ご説明資料
NTT空間情報 ちばんMAP ご説明資料
 
地理教育でのGoogle Earthの活用ポイント
地理教育でのGoogle Earthの活用ポイント地理教育でのGoogle Earthの活用ポイント
地理教育でのGoogle Earthの活用ポイント
 
Code for Fukuoka 公園データを集めよう
Code for Fukuoka 公園データを集めようCode for Fukuoka 公園データを集めよう
Code for Fukuoka 公園データを集めよう
 
地理教育でのGoogleMapsの活用ポイント
地理教育でのGoogleMapsの活用ポイント地理教育でのGoogleMapsの活用ポイント
地理教育でのGoogleMapsの活用ポイント
 

Viewers also liked (8)

templateとautoの型推論
templateとautoの型推論templateとautoの型推論
templateとautoの型推論
 
Emcpp item31
Emcpp item31Emcpp item31
Emcpp item31
 
Emcpp item41
Emcpp item41Emcpp item41
Emcpp item41
 
Emcpp0506
Emcpp0506Emcpp0506
Emcpp0506
 
Effective Modern C++勉強会#4 Item 17, 18資料
Effective Modern C++勉強会#4 Item 17, 18資料Effective Modern C++勉強会#4 Item 17, 18資料
Effective Modern C++勉強会#4 Item 17, 18資料
 
Effective Modern C++ 読書会 Item 35
Effective Modern C++ 読書会 Item 35Effective Modern C++ 読書会 Item 35
Effective Modern C++ 読書会 Item 35
 
Effective modern c++ 5
Effective modern c++ 5Effective modern c++ 5
Effective modern c++ 5
 
「実践ドメイン駆動設計」社内読書会まとめ ~IDDD本難民に捧げる1章から7章~
「実践ドメイン駆動設計」社内読書会まとめ ~IDDD本難民に捧げる1章から7章~「実践ドメイン駆動設計」社内読書会まとめ ~IDDD本難民に捧げる1章から7章~
「実践ドメイン駆動設計」社内読書会まとめ ~IDDD本難民に捧げる1章から7章~
 

Similar to BigQuery読書会#2資料 (7)

MapReduce基礎
MapReduce基礎MapReduce基礎
MapReduce基礎
 
MapReduce/Spark/Tezのフェアな性能比較に向けて (Cloudera World Tokyo 2014 LT講演)
MapReduce/Spark/Tezのフェアな性能比較に向けて (Cloudera World Tokyo 2014 LT講演)MapReduce/Spark/Tezのフェアな性能比較に向けて (Cloudera World Tokyo 2014 LT講演)
MapReduce/Spark/Tezのフェアな性能比較に向けて (Cloudera World Tokyo 2014 LT講演)
 
OSC2011 Tokyo/Spring Hadoop入門
OSC2011 Tokyo/Spring Hadoop入門OSC2011 Tokyo/Spring Hadoop入門
OSC2011 Tokyo/Spring Hadoop入門
 
Googleの基盤クローン Hadoopについて
Googleの基盤クローン HadoopについてGoogleの基盤クローン Hadoopについて
Googleの基盤クローン Hadoopについて
 
TinyMapReduce on ruby
TinyMapReduce on rubyTinyMapReduce on ruby
TinyMapReduce on ruby
 
Hadoop for programmer
Hadoop for programmerHadoop for programmer
Hadoop for programmer
 
BPStudy32 CouchDB 再入門
BPStudy32 CouchDB 再入門BPStudy32 CouchDB 再入門
BPStudy32 CouchDB 再入門
 

More from SATOSHI TAGOMORI

More from SATOSHI TAGOMORI (20)

Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
Good Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/OperationsGood Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/Operations
 
Maccro Strikes Back
Maccro Strikes BackMaccro Strikes Back
Maccro Strikes Back
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of Ruby
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
 
Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in Ruby
 
Lock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive OperationsLock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive Operations
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd Season
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT To
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In Ruby
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud Service
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 

Recently uploaded

Recently uploaded (11)

Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 

BigQuery読書会#2資料