Skip to Content
Sparkによるデータアルゴリズム
book

Sparkによるデータアルゴリズム

by Mahmoud Parsian
March 2025
Intermediate to advanced
438 pages
6h 47m
Japanese
O'Reilly Media, Inc.
Content preview from Sparkによるデータアルゴリズム

第10章. 実践的なデータ・デザイン・パターン

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

本章の目的は、一般的なデータ問題の解決に役立つ実践的なデータデザインパターンを紹介することである。ビッグデータ・ソリューションで使用され、本番環境でデプロイされている実際のデザインパターンに焦点を当てる。

前章と同様に、それぞれの使い方を簡単な例で説明し、Sparkの変換を使って実装する方法を紹介する。また、削減変換をより理解するために、モノイドの概念についても詳しく説明する。

デザインパターンの本で最も優れているのは、コンピュータ・サイエンスの代表的な本である『デザイン・パターン』だ:Elements of Reusable Object-Oriented Software」(Erich Gamma、Richard Helm、Ralph Johnson、John Vlissides著、「Gang of Four」として知られる)である。本書では、"Gang of Four "にあるようなデータ・デザイン・パターンを紹介するのではなく、本番環境で使用されている実用的で非公式なデータ・デザイン・パターンに焦点を当てる。

この章で取り上げるデータデザインパターンは、Sparkクラスタにデプロイするスケーラブルなソリューションを書くのに役立つ。 しかし、デザインパターンを採用し使用する場合、特効薬はないことに注意しよう。どのパターンも、本番環境に近い環境で、実際のデータを使ってパフォーマンスとスケーラビリティをテストする必要がある。

ソフトウェア工学におけるデザインパターンの一般化については、前述のデザインパターンを参照されたい:Elements of Reusable Object-Oriented Software」(Erich Gamma、Richard Helm、Ralph Johnson、John Vlissides著、Addison-Wesley)を参照されたい。 MapReduceのデザインパターンについては、Donald MinerとAdam Shook著のMapReduce Design Patternsと拙著Data Algorithms(いずれもO'Reilly社刊)を参照されたい。

この章で取り上げるデザインパターンには、以下のようなものがある:

  • インマッパーの組み合わせ

  • トップ10

  • MinMax

  • 複合パターン/モノイド

  • ビンニング

  • ソート

まずは、インマッパー・コンバイナーを使った便利な要約デザインパターンから始めよう。

インマッパーの組み合わせ

MapReduceパラダイムでは、コンバイナー(セミリデューサーとも呼ばれる)は、各ワーカー上でローカルに実行されるプロセスであり、データをリデューサーにネットワーク越しに送る前に集約する。Hadoopのようなフレームワークでは、これは通常、局所的最適化のオプションとみなされる。インマッパーコンバイナーは、マッパーから(キーと値)のペアを受け取るときに、ローカルディスクにすべて書き込んでからキーごとに値を集約するのではなく、メモリ内で集約を実行することで、さらなる最適化を行う。(Sparkは全ての処理をメモリ内で行うので、デフォルトではこのように動作する。) in-mapper結合デザインパターンの目的は、マッパーがその出力を可能な限り効率的に結合して要約することである。そのため、ソートやシャッフル、あるいは演算子( ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

メダリオンアーキテクチャの構築

メダリオンアーキテクチャの構築

Piethein Strengholt

Publisher Resources

ISBN: 9798341635302