デブサミ2017の講演資料です。Google では検索やYoutube、Gmailといったビリオンユーザを抱えるサービスのデータを効率良く処理するため、MapReduceやBigTable、Dremelといった多くの基盤技術を発明してそれらを自社で利用してきました。Google Cloud Platformを使うと、こうした最新のテクノロジーを使いやすいサービスとして利用することできます。データ処理の概要アーキテクチャと BigQuery、Dataflow を中心とした製品について説明します。
福田 潔Google Cloud Platform カスタマーエンジニアGoogle CloudNo-Ops で大量データ処理基盤を簡単に実現するBigQuery と Cloud Dataflow で実現する次世代データ処理基盤
View Slide
Data + No-Ops
Data makes software great.Apps (and companies) win or lose based on how they use it.
Better software, faster.
分析クラスタを作成クラスタを管理クラスタをアップグレードインデックスを定義ソフトウェアをセットアップネットワークをセットアップスケールを管理典型的なデータウェアハウスインフラではなく、データから知見を導くところにフォーカスする分析クラウド時代のBig Data アーキテクチャ分析に費やす時間を増やす
1 Billion Users
Enterprise
世界を駆け巡る Google バックボーンネットワーク
1111http://www.submarinecablemap.com/#/submarine-cable/faster
データセンター内の高速ネットワーク● 5th generation ofcustom-made network fablic● 1Pbps = 100K machines x10GbpsJupitor
Borg大規模クラスタ管理システム● Everything at Google runsin a container● Separate of infra /application● Prod + Non-Prod runs onsame machine
2016GoogleResearch20082002 2004 2006 2010 2012 2014 2015OpenSource2005GoogleCloudProductsGFSMapReduce15年以上、データの問題に向き合ってきた
2016GoogleResearch20082002 2004 2006 2010 2012 2014 2015OpenSource2005GoogleCloudProducts BigQuery Pub/Sub Dataflow Bigtable MLGFSMapReduceBigTable DremelFlumeJava Millwheel TensorflowApache BeamPubSub15年以上、データの問題に向き合ってきた
ビッグデータのライフサイクル保存 分析処理収集
分析保存収集BigQuery(SQL)処理CloudDataflow(streamand batch)CloudStorage(objects)CloudDatastor(NoSQL)BigQueryStorage(structured)Cloud Dataproc (Hadoop & Ecosystem)CloudBigtable(NoSQLHBase)Cassandra hBase MongoDBRabbit MQ KafkaCloud 2.0Cloud 3.0可視化Cloud DataLab(iPython/Jupyter)TableauPub/SubStackdriverLoggingBQStreamingAppEngineCloudSQL(SQL)CloudMachineLearningプロダクトをマップするとCloudSpanner(NewSQL)
リファレンスアーキテクチャ : データを収集するCloud Pub/SubAt Leaast One の信頼性を持つ、スケーラブルなNo-Opsグローバル分散メッセージ・キューCloud Storageオブジェクトストレージ。外部システムが出力するファイルのGCPへのエントリーポイントとなる生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等Stackdriver LoggingGCP および AWS(EC2) からログイベントを収集APIを介して任意のアプリケーションログも収集GCPのシステムログ、アプリケーションログ 等Transfer Service
リファレンスアーキテクチャ : 処理および変換生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等GCPのシステムログ、アプリケーションログ 等StreamBatchCloud Dataflowバッチ/ストリーム両方に対応したデータ処理エンジンTransfer Service
リファレンスアーキテクチャ : 処理および変換生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等GCPのシステムログ、アプリケーションログ 等StreamBatchCloud Dataflowバッチ/ストリーム両方に対応したデータ処理エンジンCloud DataprocSpark / Hadoop のマネージド・サービスBatch
リファレンスアーキテクチャ : 分析および保存生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等GCPのシステムログ、アプリケーションログ 等StreamBatchBatchBigQuery大規模データセットに対する高性能クエリーエンジン
リファレンスアーキテクチャ : 分析および可視化生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等GCPのシステムログ、アプリケーションログ 等StreamBatchBatch外部アプリケーションCloud Datalab可視化およびBIデータ共有B CABigQueryDataprocDataflowCloud StoragePub/SubStackdriver Logging
生ログ、ファイル、外部システムからのアウトプット 等イベント、メトリック等GCPのシステムログ、アプリケーションログ 等StreamBatchBatch外部アプリケーションCloud Datalab可視化およびBIデータ共有B CAa No-Ops big data stackthat scales automatically
CloudDataflowBatch/StreamingProcessingBigQueryLarge ScaleAnalytics
BigQueryFully managed, Petabyte Scale, Low CostEnterprise Data Warehouse for analytics
26BigQuery とは?耐久性があり高可用性を備えるスタンダードSQLペタバイト規模で高速フルマネージドの No-Ops データウェアハウス
BigQuery の内部構造SQL クエリペタビットネットワークBigQueryカラム指向ストレージ コンピュートストリーミングインジェスト高速バッチロードGoogle CloudStorageGoogleDriveGoogleスプレッドシートFederated Query
デモ1PB Query
継続的な改善2010 2011 2012 2013 2014公開大規模なクエリ結果2015 201690030001,200Google I/O でベータリリースDremel XBig JOIN サポートダイナミックエグゼキューションCapacitorシャッフル高速化100k qps のストリーミングユーザー定義関数100k qps のストリーミングCode Submits
Unstructured data accounts for90% of enterprise data**Source: IDC
DataflowNew default of stream processing
バッチ処理の問題点:データは継続的に生成される(=Unbounded Data)。なぜ処理するために待たなければならないのか?Dataflow(Apache Beam) はストリーム処理の新しいデフォルトバッチ処理はストリーム処理のサブセットと捉えるCloud Dataflow とは?
20122002 2004 2006 2008 2010MapReduceGFS Big TableDremelPregelFlumeJavaColossusSpanner2014MillWheelDataflow2016Dataflow は新しいデフォルト
Dataflow モデル および Cloud DataflowDataflow Model & SDKsバッチおよびストリーム処理の統合プログラムモデルno-ops, フルマネージドサービス(実行環境)Google Cloud DataflowApacheBeam
{a->[apple, art, argentina], ar->[art, argentina, armenia],...}CountExpandPrefixesTop(3)WriteReadExtractTags{a->(argentina, 5M), a->(armenia, 2M), …,ar->(argentina, 5M), ar->(armenia, 2M), ...}{#argentina scores!, watching #armenia vs#argentina, my #art project, …}{argentina, armenia, argentina, art, ...}{argentina->5M, armenia->2M, art->90M, ...}TweetsPredictions
CountExpandPrefixesTop(3)WriteReadExtractTagsTweetsPredictionsPipeline p = Pipeline.create(new PipelineOptions());pp.run();.apply(ParDo.of(new ExtractTags())).apply(Top.largestPerKey(3)).apply(Count.perElement()).apply(ParDo.of(new ExpandPrefixes()).apply(TextIO.Write.to(“gs://…”));.apply(TextIO.Read.from(“gs://…”))class ExpandPrefixes … {public void processElement(ProcessContext c) {String word = c.element().getKey();for (int i = 1; i <= word.length(); i++) {String prefix = word.substring(0, i);c.output(KV.of(prefix, c.element()));}}}
NYC Taxi and Limousine Commissions : Open Data
Cloud Pub/Sub(public dataset)DataflowETL usingCloud DataflowBigQueryBigQueryCloud Pub/SubVisualizeApplicationDatalabDataStudio
デモの結果は?1PB Query
“クラウドプロバイダは成熟してきた。コストが下がり、信頼性が増し、様々なサービスを提供するようになってきた”Spotifyhttp://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external
“物理マシンを所有して運用することは、我々にとっては競争優位ではない “Spotifyhttp://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external
“我々はビッグデータ技術におけるGoogle の先進性が、我々のデータ処理に優位をもたらしてくれると信じている”Spotifyhttp://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external
cloud.google.com
https://goo.gl/EolvdJ4月21日 | 10:00 AM - 5:30 PMベルサール渋谷ファースト
参考● BigQuery○ https://cloud.google.com/bigquery/● Dataflow○ https://cloud.google.com/dataflow/● Google Big Data Blog○ https://cloud.google.com/blog/big-data/● NYC Taxi Tycoon Codelab○ https://goo.gl/4g5eep● Architecture: Optimized Large-Scale Analytics Ingestion○ https://cloud.google.com/solutions/architecture/optimized-large-scale-analytics-ingestion
Thank You![email protected]