Upgrade to Pro — share decks privately, control downloads, hide ads and more …

No-Ops で大量データ処理基盤

No-Ops で大量データ処理基盤

デブサミ2017の講演資料です。Google では検索やYoutube、Gmailといったビリオンユーザを抱えるサービスのデータを効率良く処理するため、MapReduceやBigTable、Dremelといった多くの基盤技術を発明してそれらを自社で利用してきました。Google Cloud Platformを使うと、こうした最新のテクノロジーを使いやすいサービスとして利用することできます。データ処理の概要アーキテクチャと BigQuery、Dataflow を中心とした製品について説明します。

GoogleCloudPlatformJapan

February 20, 2017
Tweet

More Decks by GoogleCloudPlatformJapan

Other Decks in Technology

Transcript

  1. 福田 潔
    Google Cloud Platform カスタマーエンジニア
    Google Cloud
    No-Ops で大量データ処理基盤を
    簡単に実現する
    BigQuery と Cloud Dataflow で実現する次世代データ処理基盤

    View Slide

  2. Data + No-Ops

    View Slide

  3. Data makes software great.
    Apps (and companies) win or lose based on how they use it.

    View Slide

  4. Better software, faster.

    View Slide

  5. 分析
    クラスタを作成
    クラスタを管理
    クラスタを
    アップグレード
    インデックスを
    定義
    ソフトウェアを
    セットアップ
    ネットワークを
    セットアップ
    スケールを管理
    典型的なデータウェアハウス
    インフラではなく、データから
    知見を導くところにフォーカス
    する
    分析
    クラウド時代の
    Big Data アーキテクチャ
    分析に費やす時間を増やす

    View Slide

  6. 1 Billion Users

    View Slide

  7. View Slide

  8. Enterprise

    View Slide

  9. 世界を駆け巡る Google バックボーンネットワーク

    View Slide

  10. View Slide

  11. 11
    11
    http://www.submarinecablemap.com/#/submarine-cable/faster

    View Slide

  12. データセンター内の
    高速ネットワーク
    ● 5th generation of
    custom-made network fablic
    ● 1Pbps = 100K machines x
    10Gbps
    Jupitor

    View Slide

  13. Borg
    大規模クラスタ
    管理システム
    ● Everything at Google runs
    in a container
    ● Separate of infra /
    application
    ● Prod + Non-Prod runs on
    same machine

    View Slide

  14. 2016
    Google
    Research
    2008
    2002 2004 2006 2010 2012 2014 2015
    Open
    Source
    2005
    Google
    Cloud
    Products
    GFS
    Map
    Reduce
    15年以上、データの問題に向き合ってきた

    View Slide

  15. 2016
    Google
    Research
    2008
    2002 2004 2006 2010 2012 2014 2015
    Open
    Source
    2005
    Google
    Cloud
    Products BigQuery Pub/Sub Dataflow Bigtable ML
    GFS
    Map
    Reduce
    BigTable Dremel
    Flume
    Java Millwheel Tensorflow
    Apache Beam
    PubSub
    15年以上、データの問題に向き合ってきた

    View Slide

  16. ビッグデータのライフサイクル
    保存 分析
    処理
    収集

    View Slide

  17. 分析
    保存
    収集
    BigQuery
    (SQL)
    処理
    Cloud
    Dataflow
    (stream
    and batch)
    Cloud
    Storage
    (objects)
    Cloud
    Datastor
    (NoSQL)
    BigQuery
    Storage
    (structured)
    Cloud Dataproc (Hadoop & Ecosystem)
    Cloud
    Bigtable
    (NoSQL
    HBase)
    Cassandra hBase MongoDB
    Rabbit MQ Kafka
    Cloud 2.0
    Cloud 3.0
    可視化
    Cloud DataLab
    (iPython/Jupyter)
    Tableau
    Pub/Sub
    Stackdriver
    Logging
    BQ
    Streaming
    App
    Engine
    Cloud
    SQL
    (SQL)
    Cloud
    Machine
    Learning
    プロダクトをマップすると
    Cloud
    Spanner
    (NewSQL)

    View Slide

  18. リファレンスアーキテクチャ : データを収集する
    Cloud Pub/Sub
    At Leaast One の信頼性を持つ、スケーラブルな
    No-Opsグローバル分散
    メッセージ・キュー
    Cloud Storage
    オブジェクトストレージ。外部システムが出力するファイルの
    GCPへのエントリーポイントとなる
    生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    Stackdriver Logging
    GCP および AWS(EC2) からログイベントを収集
    APIを介して任意のアプリケーションログも収集
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Transfer Service

    View Slide

  19. リファレンスアーキテクチャ : 処理および変換
    生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Stream
    Batch
    Cloud Dataflow
    バッチ/ストリーム両方に対応した
    データ処理エンジン
    Transfer Service

    View Slide

  20. リファレンスアーキテクチャ : 処理および変換
    生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Stream
    Batch
    Cloud Dataflow
    バッチ/ストリーム両方に対応した
    データ処理エンジン
    Cloud Dataproc
    Spark / Hadoop のマネージド・サービス
    Batch

    View Slide

  21. リファレンスアーキテクチャ : 分析および保存
    生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Stream
    Batch
    Batch
    BigQuery
    大規模データセットに対する
    高性能クエリーエンジン

    View Slide

  22. リファレンスアーキテクチャ : 分析および可視化
    生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Stream
    Batch
    Batch
    外部
    アプリケー
    ション
    Cloud Datalab
    可視化および
    BI
    データ共有
    B C
    A
    BigQuery
    Dataproc
    Dataflow
    Cloud Storage
    Pub/Sub
    Stackdriver Logging

    View Slide

  23. 生ログ、ファイル、外
    部システムからのア
    ウトプット 等
    イベント、
    メトリック等
    GCPのシステムロ
    グ、アプリケーション
    ログ 等
    Stream
    Batch
    Batch
    外部
    アプリケー
    ション
    Cloud Datalab
    可視化および
    BI
    データ共有
    B C
    A
    a No-Ops big data stack
    that scales automatically

    View Slide

  24. Cloud
    Dataflow
    Batch/Streaming
    Processing
    BigQuery
    Large Scale
    Analytics

    View Slide

  25. BigQuery
    Fully managed, Petabyte Scale, Low Cost
    Enterprise Data Warehouse for analytics

    View Slide

  26. 26
    BigQuery とは?
    耐久性があり高可用性を備える
    スタンダードSQL
    ペタバイト規模で高速
    フルマネージドの No-Ops データウェアハウス

    View Slide

  27. BigQuery の内部構造
    SQL クエリ
    ペタビット
    ネットワーク
    BigQuery
    カラム指向ストレージ コンピュート
    ストリーミングイン
    ジェスト
    高速バッチロード
    Google Cloud
    Storage
    Google
    Drive
    Google
    スプレッドシート
    Federated Query

    View Slide

  28. デモ
    1PB Query

    View Slide

  29. View Slide

  30. 継続的な改善
    2010 2011 2012 2013 2014
    公開
    大規模なクエリ結果
    2015 2016
    900
    300
    0
    1,200
    Google I/O でベータリリース
    Dremel X
    Big JOIN サポート
    ダイナミック
    エグゼキューション
    Capacitor
    シャッフル高速化
    100k qps のストリーミン

    ユーザー定義関数
    100k qps の
    ストリーミング
    Code Submits

    View Slide

  31. Unstructured data accounts for
    90% of enterprise data*
    *Source: IDC

    View Slide

  32. Dataflow
    New default of stream processing

    View Slide

  33. バッチ処理の問題点:データは継続的に生成される
    (=Unbounded Data)。なぜ処理するために待たなければなら
    ないのか?
    Dataflow(Apache Beam) は
    ストリーム処理の新しいデフォルト
    バッチ処理はストリーム処理のサブセットと捉える
    Cloud Dataflow とは?

    View Slide

  34. 2012
    2002 2004 2006 2008 2010
    MapReduce
    GFS Big Table
    Dremel
    Pregel
    FlumeJava
    Colossus
    Spanner
    2014
    MillWheel
    Dataflow
    2016
    Dataflow は新しいデフォルト

    View Slide

  35. Dataflow モデル および Cloud Dataflow
    Dataflow Model & SDKs
    バッチおよびストリーム処理の
    統合プログラムモデル
    no-ops, フルマネージドサービス
    (実行環境)
    Google Cloud Dataflow
    Apache
    Beam

    View Slide

  36. {a->[apple, art, argentina], ar->[art, argentina, armenia],...}
    Count
    ExpandPrefixes
    Top(3)
    Write
    Read
    ExtractTags
    {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, ...}
    Tweets
    Predictions

    View Slide

  37. Count
    ExpandPrefixes
    Top(3)
    Write
    Read
    ExtractTags
    Tweets
    Predictions
    Pipeline p = Pipeline.create(new PipelineOptions());
    p
    p.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()));
    }
    }
    }

    View Slide

  38. NYC Taxi and Limousine Commissions : Open Data

    View Slide

  39. Cloud Pub/Sub
    (public dataset)
    Dataflow
    ETL using
    Cloud Dataflow
    BigQuery
    BigQuery
    Cloud Pub/Sub
    Visualize
    Application
    Datalab
    DataStudio

    View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. デモの結果は?
    1PB Query

    View Slide

  44. View Slide

  45. “クラウドプロバイダは成熟してきた。
    コストが下がり、信頼性が増し、様々なサービス
    を提供するようになってきた”
    Spotify
    http://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external

    View Slide

  46. “物理マシンを所有して運用することは、我々に
    とっては競争優位ではない “
    Spotify
    http://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external

    View Slide

  47. “我々はビッグデータ技術におけるGoogle の
    先進性が、我々のデータ処理に優位をもたら
    してくれると信じている”
    Spotify
    http://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external

    View Slide

  48. cloud.google.com

    View Slide

  49. https://goo.gl/EolvdJ
    4月21日 | 10:00 AM - 5:30 PM
    ベルサール渋谷ファースト

    View Slide

  50. 参考
    ● 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-a
    nalytics-ingestion

    View Slide

  51. Thank You!
    [email protected]

    View Slide