• 検索結果がありません。

AWSビッグデータソリューション Amazon Redshift, Amazon EMR, Amazon DynamoDBご紹介

N/A
N/A
Protected

Academic year: 2021

シェア "AWSビッグデータソリューション Amazon Redshift, Amazon EMR, Amazon DynamoDBご紹介"

Copied!
101
0
0

読み込み中.... (全文を見る)

全文

(1)

AWS

ビッグデータソリューション

Amazon  Redshift,  Amazon  EMR,  Amazon  DynamoDBご紹介

Yuta  Imai

Solutions  Architect

Amazon  Data  Services  Japan

(2)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved. ©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(3)

フィードバックをお寄せ下さい

本イベントについてツイートされる際は

 

ハッシュタグをご利利⽤用ください

#AWSRoadshow

お帰りになる前には

アンケートへのご協⼒力力をお願いします

引換⽤用の記念念品をご⽤用意しています

      

(4)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

⾃自⼰己紹介

名前

今井  雄太  (いまい  ゆうた)

所属

  

アマゾンデータサービスジャパン

      ソリューションアーキテクト

仕事

広告業界

ゲーム業界のお客様を担当

50ms  or  dieなWebサービスの技術全般

4

(5)

アジェンダ

1.

AWSのサービス全体像と

ビッグデータ関連サービス

2.

解剖ビッグデータ

3.

Getting  Started  with  Big  Data  Services

Amazon  Redshift

Amazon  Elastic  MapReduce

Amazon  DynamoDB

(6)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

アジェンダ

1.

AWSのサービス全体像と

ビッグデータ関連サービス

2.

解剖ビッグデータ

3.

Getting  Started  with  Big  Data  Services

Amazon  Redshift

Amazon  Elastic  MapReduce

Amazon  DynamoDB

(7)

AWSサービスの全体像

AWSグローバルインフラ

Regions  /  Availability  Zones  /  Contents  Delivery  POPS

AZ

Region

コンピュート処理理

ストレージ

データベース

EC2 Elastic

Load  BalancingAuto  Scaling S3 Glacier EBS Storage  Gateway RDS DynamoDB ElastiCache Redshift

データ分析

Kinesis EMR Data  Pipeline

コンテンツ配信

CloudFront

ネットワーク

Virtual  Private  Cloud Direct  Connect Rout53

アプリケーションサービス

WorkSpaces

SQS SNS SES SWF Elastic  Transcoder CloudSearch

Management  &  Administration

CloudWatch CloudTrail IAM Management  Console SDK CLI

⾃自動化とデプロイメント

CloudFormation BeanStalk OpsWorks

Ecosystem

(8)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Interface

Storage

Big  Data  services  on  AWS

DWH

NoSQL

DynamoDB

Redshift

S3

Glacier

Data  Pipeline

RDB

Hadoop

Workflow

Management

RDS

Elastic  

MapReduce

8

Kinesis

(9)

AWSビッグデータサービス群

Amazon  Simple  Storage  Service(S3)

Amazon  Glacier(Glacier)

容量量制限がなく

利利⽤用分だけの⽀支払い

で利利⽤用できるストレージ

データの耐久性は99.999999999%

静的HTTPサーバーとしても利利⽤用可

S3と同等のデータ耐久性

S3の1/3の価格で利利⽤用可能なストレージ

データの取り出しリクエストからアクセ

ス可能になるまで約4時間かかる

(10)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWSビッグデータサービス群

Amazon  DynamoDB(DynamoDB)

Amazon  Redshift(Redshift)

NoSQL  as  a  Service

ストレージ容量量の制限なし

必要なスループットをプロビジョンして利利⽤用

マネージドData  Ware  House

EC2やRDSと同じように使った分だけの課⾦金金

スケールアウト/インも容易易

Amazon  RDS(RDS)

マネージドRelational  Database

PostgreSQL,MySQL,Oracle,SQL  Serverか

らエンジンを選択可能

(11)

AWSビッグデータサービス群

Amazon  Elastic  MapReduce(EMR)

Amazon  Kinesis(Kinesis)

マネージドHadoop

HDFSとシームレスにS3を扱える

Stream  Computingのためのサービス

ストリーミングMapReduceのようなこと

を容易易に可能にしてくれる

(12)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWSビッグデータサービス群

AWS  Data  Pipeline(Data  Pipeline)

データの移動やETLのバッチ処理理/

パイプライン処理理のためのオーケ

ストレーションサービス

(13)

Interface

Storage

Big  Data  services  on  AWS

DWH

NoSQL

DynamoDB

Redshift

S3

Glacier

Data  Pipeline

RDB

Hadoop

Workflow

Management

RDS

Elastic  

MapReduce

Kinesis

(14)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Storage

Big  Data  services  on  AWS

DWH

NoSQL

DynamoDB

Redshift

S3

Glacier

Data  Pipeline

RDB

Hadoop

Workflow

Management

RDS

Elastic  

MapReduce

14

Interface

Kinesis

(15)

Storage

Big  Data  services  on  AWS

DWH

NoSQL

DynamoDB

Redshift

S3

Glacier

Data  Pipeline

RDB

Hadoop

Workflow

Management

RDS

Elastic  

MapReduce

Interface

Kinesis

本⽇日はこれらのサービスの役割や使い分け

組み合わせ⽅方をメインに取り上げていきます

(16)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

アジェンダ

1.

AWS

のサービス全体像と

ビッグデータ関連サービス

2.

解剖ビッグデータ

3.

Getting  Started  with  Big  Data  Services

Amazon  Redshift

Amazon  Elastic  MapReduce

Amazon  DynamoDB

(17)

データ活⽤用の4つのステップ

1.

あつめる

多数のアプリケーションサーバーやクライアント

デバイスからの

データ収集

2.

ためる

安全でコスト効率率率よく

かつ利利⽤用しやすい形でデータを保存

3.

処理理する

抽出

除外

整形

いわゆる前処理理

⼀一次集計もここに含まれる

4.

つかう

BIツールで利利⽤用

データをAPIで提供

(18)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Glacier

RDS

EMR

EMR

Redshift

DynamoDB

Data Pipeline

S3

Data

ETL

Sum

Web app

Analytics

Dashboard

18

Kinesis

あつめる

ためる

処理する

つかう

データ活⽤用のステップで⾒見見る

(19)

1.1.1.1,  /login,      20140226000101,  … 192.168…,  /home,    20140226011226,  … 1.1.1.2,  /home,    20140226011331,  …

EMR

ETL済みデータ

Redshift

S3

ログ(オリジナル) 処理理済みデータ

S3

Webサーバー

ログ集約サーバー

ETL

例例:バッチ処理理によるアクセスログ集計

USER      PATH      TIMESTAMP       -‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒-‐‑‒ USER1        /login      2014-‐‑‒02-‐‑‒26  00:00:01 USER2        /home      2014-‐‑‒02-‐‑‒26  01:13:31

BIツールなど

1.1.1.1,  /login,      20140226000101,  … 192.168…,  /home,    20140226011226,  … 1.1.1.2,  /home,    20140226011331,  …

(20)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

USER1,      20140226000101,  … USER2,    20140226011226,  … USER1,    20140226011331,  …

EMR

ETL済みデータ

Redshift

S3

ログ(オリジナル)

S3

処理理済みデータ

Webサーバー

ログ集約サーバー

例例:収集したデータの活⽤用

 –DMP-‐‑‒

20

レポートツール

データ提供API

DynamoDB

ETL済みデータ

USER1:  {  Interest:  [  ʻ‘Carʼ’,  ʻ‘Homeʼ’  ],  ...  } USER2:  {  Interest:  [  ʻ‘Dogʼ’,  ʻ‘Catʼ’  ],  …  }

EMR

処理理済みデータ

S3

ユーザーごとにログを集計して興味分野を

(21)

データ活⽤用の4つのステップ

1.

あつめる

多数のアプリケーションサーバーやクライアント

デバイスからの

データ収集

2.

ためる

安全でコスト効率率率よく

かつ利利⽤用しやすい形でデータを保存

3.

処理理する

抽出

除外

整形

いわゆる前処理理

⼀一次集計もここに含まれる

4.

つかう

BIツールで利利⽤用

データをAPIで提供

(22)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

アジェンダ

1.

AWS

のサービス全体像と

ビッグデータ関連サービス

2.

解剖ビッグデータ

:  

あつめる

ためる

つかう

3.

Getting  Started  with  Big  Data  Services

Amazon  DynamoDB、Amazon  Elastic  MapReduce、

Amazon  Redshift

4.

Practical  Deep  Dive

(23)
(24)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Redshiftのアーキテクチャ

MPP

(超並列列演算)

CPU、Disk・Network  I/Oの並列列化

論論理理的なリソースの括り「ノードスライス」

データの格納

列列指向(カラムナ)

圧縮

データの通信

コンピュート・ノード間の通信

各コンピュート・ノードからリーダー・ノードへの通信

他のAWSサービスとの通信

(25)

Amazon  Redshift概要

リーダーノードを経由して

クエリーを実⾏行行

インターフェイスはPostgreSQL互

換(psqlで使えます)

各コンピュートノードで演算が並列列

実⾏行行

各コンピュートノードにローカルス

トレージを保持

BIツール リーダー ノード コン ピュー トノー コン ピュー トノー コン ピュー トノー JDBC/ODBC 10GigE  Mesh SQL  エンドポイント: •  クエリーの並列列化 •  結果を⽣生成 クエリー実⾏行行ノー •  “N”  スケールア ウトを実現 •  ローカルディス ク S3,  DynamoDB,  EMRとの統合

(26)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

アーキテクチャ:列列指向

⾏行行指向(RDBMS)

列列指向(Redshift)

orderid name

price

1

Book

100

2

Pen

50

n

Eraser

70

orderid name

price

1

Book

100

2

Pen

50

(27)

Amazon  Redshiftのノードタイプ

dw2.large:

CPU:  2  virtual  cores

ECU:  7

Memory:  15  GiB

Storage:  160GB(SSD)

Network:  0.2GB/s

dw2.8xlarge

CPU:  32  virtual  cores

ECU:  104

Memory:  244  GiB

Storage:  2.56TB(SSD)

Network:  3.7GB/s

"  

dw1.xlarge:

CPU:  2  virtual  cores

ECU:  4.4

Memory:  15  GiB

Storage:  2TB(HDD)

Network:  0.3GB/s

"  

dw1.8xlarge

CPU:  16  virtual  cores

ECU:  35

Memory:  120  GiB

Storage:  16TB(SSD)

(28)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon  Redshiftの拡張性

28

XL 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L 8X L シングルノード XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL XL クラスター 2 – 32ノード クラスター 2 – 100ノード

dw1.xlarge  &  

(29)

Amazon  S3からCSVファイルをロードしてみる

まずはRedshiftにログイン

psql -d mydb –h YOUR_REDSHIFT_ENDPOINT -p

5439 -U awsuser -W!

!

COPY customer FROM 's3://data/customer.tbl.’

CREDENTIALS

’aws_access_key_id=KEY;aws_secret_access_key=

SEC’ DELIMITER ‘,’ GZIP TIME_FORMAT ‘auto’;!

(30)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon  Redshiftにログインしてデータロードしてク

エリを掛けてみる

30

Redshiftのシェルでテーブルを定義

CREATE TABLE nginx (!

remote_addr char(15),!

time timestamp,!

request varchar(255),!

status integer,!

bytes bigint,!

ua varchar!

);!

(31)

あとはいつものSQL

SELECT ua, request, COUNT(*) !

FROM nginx!

(32)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3へデータを書き出すのも簡単

32

UNLOAD TO ‘s3://YOUR_BUCKET/PATH/!

SELECT * FROM nginx;!

(33)

Amazon  Redshiftとは・・・

⼤大量量のデータを⾼高速に

SQL

で処理理してくれる

RDB

と違いデータ量量が増えても性能が劣劣化しにく

ただし

あくまで

OLAP

⽤用データベースである

データは

ETL

や正規化されている必要がある

集計や統計など

数値の可視化に有効

レポートツール等

,

データ可視化に最適

(34)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Redshiftについてより深く知りたい⽅方は・・

Amazon  Redshiftパフォーマンス・チューニン

資料料:  http://media.amazonwebservices.com/jp/

summit2014/TA-‐‑‒08.pdf

動画:  https://www.youtube.com/watch?

v=_̲x4o1vNWbAA

(35)
(36)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Hadoop

Elastic  MapReduce

AWSが提供するマネージドHadoop

Hadoop1系、2系、MapRが利利⽤用可能

マネージド?

クラスタの構築・監視・復復旧

CloudWatchによるモニタリング

S3のデータを扱える

2つの⼤大きな特徴

ワークフローマネジメント

S3、DynamoDBのデータを扱える

Hadoop

ユーザーは普通のHadoopとして

利用できる

36

(37)

ワークフローマネージメント:スクリプトでHadoopを起動

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

(38)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

38

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

名前をつける

ワークフローマネージメント:スクリプトでHadoopを起動

(39)

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

AMI(Hadoop)のバージョンを指定する

ワークフローマネージメント:スクリプトでHadoopを起動

(40)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

40

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

インストールするアプリケーションを指定

ワークフローマネージメント:スクリプトでHadoopを起動

(41)

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

インスタンスタイプを指定

ワークフローマネージメント:スクリプトでHadoopを起動

(42)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

42

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

ログの吐き出し先を指定

ワークフローマネージメント:スクリプトでHadoopを起動

(43)

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

VPCなどの情報を指定

ワークフローマネージメント:スクリプトでHadoopを起動

(44)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(45)

仕事を予め定義して起動し

終わったら⾃自動削除

aws emr create-cluster \!

--name bigdata-handson \!

--ami-version 3.2.1 \!

--applications Name=Hive \!

--instance-groups

InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.large

InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.large \!

--log-uri s3:/PATH/TO/LOG/ \!

--ec2-attributes SubnetId=subnet-a06474e6,KeyName=YOUR_KEY!

--steps Type=HIVE,Name='Hive program’, Args=[-f,s3://PATH/TO/

QUERY.q] \!

(46)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

cronやData  Pipelineでワークフローを制御す

ればHadoopのジョブを⾃自動化できる!

(47)
(48)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3のデータを扱える

HDFSとシームレスにS3上のデータを扱える

INPUTやOUTPUTにs3://〜~を指定する

48

hadoop jar YOUR_JAR.jar \!

--src s3://YOUR_BUCKET/logs/

\!

--dest s3://YOUR_BUCKET/output/!

hadoop jar YOUR_JAR.jar \!

--src s3://YOUR_BUCKET/logs/

\!

--desct hdfs:///output/ !

S3からデータを取り出して結果を更更にS3に吐き出す

(49)

もちろんHiveでも

CREATE

EXTERNAL TABLE

s3_as_external_table(!

"user_id INT,!

"movie_id INT,!

"rating INT,!

"unixtime STRING )!

ROW FORMAT DELIMITED FIELDS !

TERMINATED BY '\t'!

STORED AS TEXTFILE!

(50)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Hiveを使ったETL

INSERT INTO TABLE table2!

SELECT!

column1,!

column2,!

column5,!

FROM table1;!

!

50

←例例えばtable1から

  column3,4を除外したい

(51)

同じようにDynamoDBのテーブルもマウントできるの

で・・・

CREATE EXTERNAL TABLE dynamodb_as_external_table(!

"user_id INT,!

"movie_id INT,!

"rating INT,!

"unixtime STRING )!

STORED BY 'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler' !

TBLPROPERTIES (!

"dynamodb.table.name" = ”your_table",!

"dynamodb.column.mapping" = !

”user_id:UserID,movie_id:MovieId,rating:Rating,unixtime:UnixTime”!

);!

(52)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

INSERT OVERWRITE TABLE!

"s3_as_external_table!

SELECT * !

FROM dynamodb_as_external_table;!

52

同じようにDynamoDBのテーブルもマウントできるの

で・・・

DynamoDBのデータをS3にバックアップしたり

SELECT COUNT(*) !

FROM dynamodb_as_external_table;!

DynamoDBのデータをHiveでMapReduceしたりできる

(53)

EMR  

ちょっと

Deep  Dive

(54)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(55)

Amazon  Redshift

• 

基本的な使い勝⼿手はRDB

• 

SQLを使って解析

• 

BIツールのバックエンドとして

• 

ある程度度正規化されたデータが前提条件

• 

複雑なジョインも得意

• 

クラスタは基本的には起動しっぱなし

(56)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon  Elastic  MapReduce

• 

Hadoop

• 

map  reduce,  hive,  pig,  streamingなどのHadoopの

エコシステムが利利⽤用できる

• 

hiveでSQLっぽく使うこともできるがRedshiftのほう

が速いし簡単(ただし、TRANSFORMやUDF/UDAFな

どの独⾃自のメリットはある)

• 

正規化しづらいデータを扱うのが得意

• 

⽴立立ちあげっぱなしではなく、ジョブごとにクラスタを

起動して終了了した破棄する使い⽅方もできる

(57)

EMRかRedshiftか

SQL

を使った分析

/

解析なら

Redshift

のほ

うが圧倒的に速い

それ以外なら

EMR

(58)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon  Elastic  MapReduceとは・・・

Hadoop

を便便利利に利利⽤用できるようにしたサービスで

⼤大量量のテキストデータを整形するのが⾮非常に得意

ワークフローをうまく活⽤用すれば処理理の⾃自動が⽤用意

S3

のデータを⾃自在に扱える

(59)
(60)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

DynamoDBとは

NoSQL  as  a  Service

データ量量が増えても性能が劣劣化しない

(61)

DynamoDBの特⻑⾧長

管理理不不要で信頼性が⾼高い

プロビジョンドスループット

(62)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

特⻑⾧長1:管理理不不要で信頼性が⾼高い

SPOFの存在しない構成

データは3箇所のAZに保存されるので信頼性が⾼高い

ストレージは必要に応じて⾃自動的にパーティショニング

される

クライアント

(63)

特⻑⾧長2:プロビジョンドスループット

テーブルごとに

Read

Write

それぞれに対し

必要

な分だけのスループットキャパシティを割り当てる

(=プロビジョンする)ことができる

例例えば下記のようにプロビジョンする

Read  :  1,000

Write  :  100

書き込みワークロードが上がってきたら

Read  :  500

Write  :  1,000

この値は

DB

運⽤用中にオンラインで変更更可能

(64)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

特⻑⾧長3:ストレージの容量量制限がない

使った分だけの従量量課⾦金金制のストレージ

データ容量量の増加に応じたディスクやノードの増設作業

(65)

DynamoDBの構成要素

API

SDK

オペレーションはHTTPベースのAPIで提供されている

ユーザーはコードを書くだけで利利⽤用できる

Database

Cl

ient

 S

ide

Ser

vice  Sid

e

Client application

(66)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

DynamoDBのテーブルのプライマリキーの持ち⽅方は2種類

Hash  key

(67)

プライマリキーがハッシュキーのサンプル1:

ユーザー情報データベース

(68)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

ユーザー情報データベース

ユーザーIDをプライマリキーとしたKVS的なテーブル

UserIdで⼀一意のItemを特定し情報の参照や更更新、削除を⾏行行う

UserId (Hash)

Name Nicknames Mail Address Interests

aed9d Bob [ Rob, Bobby ] [email protected] some address [ Car, Motor Cycle] edfg12 Alice [ Allie ]

a8eesd Carol [ Caroline ] f42aed Dan [ Daniel, Danny ]

Users Table

※DynamoDBにはauto_increment等でユニークIDを払い出す機能はないので注意

(69)

プライマリキーがハッシュ&レンジのテーブルサンプル:

ゲームの⾏行行動履履歴管理理データベース

(70)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

ゲームの⾏行行動履履歴管理理データベース

User (Hash) Timestamp (Range) Opponent Result

Alice 2014-02-21 12:21:20 Bob Lost Alice 2014-02-21 12:42:01 Bob Won Alice 2014-02-24 09:48:00 Dan Won Alice 2014-02-25 16:21:11 Charlie Won

Battle History

⾃自分のバトル履履歴を確認するケースを想定

Userに⾃自分(Alice)を指定し、更更にTimestampが7⽇日以内のデータ

をクエリしたりできる

Charlie 02-25 16:21 Won! Your Battle History

Dan 02-24 09:48 Won! Alice 02-21 12:42 Won!

(71)

テーブル設計のための基礎知識識+1

Local  Secondary  Index

Range  key以外に絞り込み検索索のためのキーを持つことができる

Hash  keyが同⼀一のアイテム群の中からの検索索のために利利⽤用

インデックスもテーブルにプロビジョンしたスループットを利利⽤用する

Global  Secondary  Index

Hash  Keyをまたいで検索索を⾏行行うためのインデックス

インデックスにテーブルとは独⽴立立したスループットをプロビジョンし

(72)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon  DynamoDBとは・・・

分散型の

NoSQL

⼤大量量のデータを投⼊入しても性能が劣劣化しない

Redshift

とは違い

こちらは

OLTP

⽤用データベース

SQL

のように

JOIN

ができるわけではない

⼤大量量のデータを格納しておいて

必要な少数のデー

タを⾼高速にやりとりするのに強みを持つ

(73)

EMR

EMR

Redshift

DynamoDB

Data Pipeline

S3

Data

ETL

Sum

Web app

Analytics

Dashboard

Kinesis

データ活⽤用のステップで⾒見見る

(74)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

アジェンダ

1.

AWS

のサービス全体像と

ビッグデータ関連サービス

2.

解剖ビッグデータ

:  

あつめる

ためる

つかう

3.

Getting  Started  with  Big  Data  Services

Amazon  Redshift

Amazon  Elastic  MapReduce

Amazon  DynamoDB

(75)

AWS上でデータ処理理を⾏行行う際には

S3の利利⽤用がキー

(76)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Elastic  

MapReduce

DynamoDB

Redshift

S3

データがS3にあれば

あとは必要に応じて処理理クラスタを起動して利利⽤用できる

(77)

S3とEMR

Hadoop単体ではデータ共有はできない

ひとつのデータに対する処理理は

ひとつのクラスタに強く結合してしまう

キャパシティプランニングが難しい

時間

負荷

(78)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3とEMR

S3

時間

負荷

キャパシティ

データをHDFSではなく

S3に格納しておけば・・

78

(79)

S3とEMR

S3

S3上のデータを複数の

クラスタから共⽤用できる

仕事量量に合わせて都度度

クラスタを⽴立立ち上げて使える!

時間

負荷

キャパシティ

(80)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3とRedshift

データ

Redshiftへのデータロードは

S3経由が効率率率的

COPY table_name FROM ‘s3://hoge’

CREDENTIALS ‘access_key_id:hoge…’

DELIMITER ‘,’

Redshift

S3

(81)

S3とRedshift

RedshiftからS3への

エクスポートも容易易

Redshift

S3

UNLOAD (‘SELECT * FROM…’)

TO ‘s3://fuga/….’

(82)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3とRedshift

古いデータはより安価な

ストレージのGlacierへ

Redshift

S3

Glacier

82

(83)

S3とRedshift

クラスタに問題が起こったら

S3からクラスタを再構築

Redshift

S3

Glacier

(84)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3とDynamoDB

DynamoDB

(85)

S3とDynamoDB

古いデータはS3へオフロード

もしくはバックアップ

DynamoDB

S3

(86)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3とDynamoDB

DynamoDB

S3

Glacier

更更に古いデータはGlacierへ

86

(87)

S3を使ったパイプライン処理理

(88)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3を使ったパイプライン処理理

S3

S3

EMR

処理理1

88

(89)

S3を使ったパイプライン処理理

S3

S3

S3

EMR

EMR

(90)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3を使ったパイプライン処理理

S3をチェックポイントとして利利⽤用することによって

処理理を疎結合にできる

S3

S3

S3

EMR

EMR

処理理1

処理理2

90

(91)

S3を使ったパイプライン処理理

S3

S3

S3

EMR

EMR

処理理1

処理理2

(92)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S3を使ったパイプライン処理理

チェックポイントからやりなおせる

S3

S3

EMR

EMR

処理理1

処理理2

S3

92

(93)

Amazon S3 データ 分析 Elastic MapReduce Redshift データ バックアップ EC 2 RDS Storage Gatewa y EBS コンテンツ 配信 CloudFront データ アクセスGW Storage Gateway コンテンツ トランスコード Elastic Transcode r コンテンツ アーカイブ データ 交換 Data Pipeline

⼤大事なことなのでもう⼀一度度

中⼼心にあるのはいつもS3

(94)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(95)
(96)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

EMR

ETL済みデータ

Redshift

S3

ログ(オリジナル)

S3

処理理済みデータ

Webサーバー

ログ集約サーバー

リアルタイム性の導⼊入

96

BIツールなど

データ提供API

DynamoDB

ETL済みデータ

EMR

処理理済みデータ

S3

15分や1時間に1回データを更更新する

15分や1時間に1回データを更更新する

データは逐次的に流流れる

(97)

EMR

ETL済みデータ

Redshift

S3

ログ(オリジナル)

S3

処理理済みデータ

Webサーバー

リアルタイム性の導⼊入

BIツールなど

データ提供API

DynamoDB

ETL済みデータ

EMR

処理理済みデータ

S3

15分や1時間に1回データを更更新する

15分や1時間に1回データを更更新する

データは逐次的に流流れる

(98)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

EMR

ETL済みデータ

Redshift

S3

ログ(オリジナル)

S3

処理理済みデータ

Webサーバー

リアルタイム性の導⼊入:ラムダアーキテクチャ

98

BIツールなど

データ提供API

DynamoDB

ETL済みデータ

EMR

処理理済みデータ

S3

15分や1時間に1回データを更更新する

15分や1時間に1回データを更更新する

データは逐次的に流流れる

リアルタイムに速報値を流流し込む

リアルタイムに速報値を流流し込む

(99)
(100)

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.

各サービスの役割を理理解し

うまく組み合わせる

あつめる

ためる

処理理する

つかう

それぞ

れのフェーズに有効なサービスは異異なる

⾃自分がどのフェーズのソリューションを必要と

しているのかを⾒見見極めてサービスを選ぶ

(101)

モバイル

S3

DynamoDB

RDS

EMR

EC2

Redshift

DynamoDB

RDS

サーバー

各サービスの役割を理理解し

うまく組み合わせる

つかう

処理する

ためる

あつめる

どこから?

どのくらい?

どういう?

どうやって?

参照

関連したドキュメント

第4章 依頼データの作成 承認 明細照会 組戻し・訂正・再振込 振込依頼データの 資金返却済 振込不着明細の照会と

企業名 株式会社HAL GREEN 代表者 代表取締役 中島 英利 本社所在地 恵庭市戸磯193番地6 設立 令和2年4月20日 資本金 83,000千円.

クチャになった.各NFは複数のNF  ServiceのAPI を提供しNFの処理を行う.UDM(Unified  Data  Management) *11 を例にとれば,UDMがNF  Service

サーバー費用は、Amazon Web Services, Inc.が提供しているAmazon Web Servicesのサーバー利用料とな

サーバー API 複雑化 iOS&Android 間で複雑な API

『国民経済計算年報』から「国内家計最終消費支出」と「家計国民可処分 所得」の 1970 年〜 1996 年の年次データ (

【通常のぞうきんの様子】

保険金 GMOペイメントゲートウェイが提 供する決済サービスを導入する加盟