21
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Amazon Redshiftの ご紹介 2013.04.10 アマゾンデータサービスジャパン 株式会社

Amazon redshiftのご紹介

Embed Size (px)

Citation preview

Page 1: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

Amazon Redshiftの ご紹介

2013.04.10

アマゾンデータサービスジャパン 株式会社

Page 2: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

2

クラウドコンピューティングとは?

初期投資が不要 実際の使用分 のみ支払い

セルフサービスなインフラ

スケールアップ、ダウンが容易

ビジネススピードの改善

低額な利用価格

Deploy

Page 3: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

3

お客様のアプリケーション

Low-Level Building Blocks

High-Level Building Blocks

Tools to Access Services

Cross-Service Features

ライブラリ & SDKs Java, PHP, .NET,

Python, Ruby

Web インターフェース

Management Console

IDE プラグイン

Eclipse

Visual Studio

デプロイと自動化 AWS Elastic Beanstalk AWS CloudFormation

認証 & 請求 AWS IAM

Identity Federation Consolidated Billing

モニタリング Amazon CloudWatch

スケーリング Auto Scale

ネットワーク&ルーティング Amazon VPC

Amazon Elastic LB Amazon Route 53

AWS Direct Connect

コンテンツ配信Amazon

CloudFront

メッセージAmazon SNS Amazon SQS

分散処理 Elastic MapReduce

メール配信 Amazon

SES

オンデマンド ワークホース

Amazon Mechanical Turk

コンピュータ処理 Amazon EC2

ストレージ Amazon S3

Amazon EBS Amazon Glacier

AWS StorageGateway

データベース Amazon RDS

Amazon DynamoDB Amazon SimpleDB Amazon Elasticache

Amazon Redshift

AWS のグローバルなインフラ Geographical Regions, Availability Zones, Points of Presence

Page 4: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

世界中のインフラを利用可能

カリフォルニア ダブリン

シンガポール

東京

オレゴン

AWSを利用開始すれば、 世界8(+1)カ所のリージョン(地域)

17のアベイラビリティゾーン(データセンター群) 39のエッジロケーションを即座に利用可能

バージニア

サンパウロ

リージョン

エッジローケーション

GovCloud

シドニー

4

Page 5: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

なぜマネージド・データベースなのか?

5

backup & recovery, data load & unload

performance tuning 25% 40%

5% 5%

scripting & coding security planning

install, upgrade, patch and migrate

documentation, licensing & training

システムの 独自性を向上

Page 6: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

AWSの各種ビッグデータサービス

6

Amazon RDS

OLTP用フルマネージドのSQLデータベース サービス

Amazon DynamoDB

高速、予測可能かつ拡張性の高いフルマネージドNoSQLデータベースサービス

Redshift

データウェアハウス用フルマネージド、 超並列、カラムナ型(列指向型)データベースサービス

Amazon EMR

拡張性の高い、Hadoopのフルマネージド サービス

Page 7: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

行型 vs. カラムナ型

DWHにはカラムナ型のデータベースが用いられる

7

orderid name qty

1 Book 100

2 Pen 50

n Eraser 70

orderid name qty

1 Book 100

2 Pen 50

n Eraser 70

行型 – トランザクション処理向き カラムナ型 – 分析処理向き

Page 8: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

Redshiftの概要(1)

Data Warehouse as a Service – 分析用に整理された大量の統合業務データの管理サービス(フルマネージドサービス)

拡張性:数百GB~数PBまで拡張可能

高速:カラムナ型、超並列演算(MPP)

低額:インスタンスの従量課金(初期費用、ライセンス費用不要)

8

Page 9: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

Redshiftの概要(2)

耐久性・可用性:S3へのバックアップ、ノード・ドライブ故障への対応

連携:インプットデータはS3、DynamoDB、 EMR(予定)と言ったAWSサービスとの連携

Postgres SQL JDBC/ODBC ドライバを使ったSQLクライアント、BIツールをサポート

9

Page 10: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

アーキテクチャー

リーダーノードを経由して クエリーを実行

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

各コンピュートノードにローカルストレージを保持

コンピュートノードはhs1.xlとhs1.8xlから選択

10

BIツール

リーダー ノード

コンピュートノード

コンピュートノード

コンピュートノード

JDBC/ODBC

10GigE Mesh

SQL エンドポイント: • クエリーの並列化 • 結果を生成

クエリー実行ノード • “N” スケールアウト

を実現 • ローカルディスク

S3, DynamoDB, EMRとの統合

Page 11: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

DWノード(コンピュートノード)

High Storage Extra Large (XL) DW Node:

• CPU: 2 virtual cores

• ECU: 4.4

• Memory: 15 GiB

• Storage: 3 HDD with 2 TB of local attached storage

• Network: Moderate

• Disk I/O: Moderate

• API: dw.hs1.xlarge

High Storage Eight Extra Large (8XL) DW Node:

• CPU: 16 virtual cores

• ECU: 35

• Memory: 120 GiB

• Storage: 24 HDD with 16 TB of local attached storage

• Network: 10 Gigabit Ethernet with support for cluster placement groups

• Disk I/O: Very High

• API: dw.hs1.8xlarge

11

Page 12: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

シングルノード (2TB)

クラスター 2 – 32ノード(4TB – 64TB)

クラスター 2 – 100ノード(32TB – 1.6PB)

拡張性

Extra Large Node (XL)

8 Extra Large Node (8XL)

数百GBから数PBまで拡張可能

12

Page 13: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

データの挿入

13

AWSの様々なサービスからデータのロードが可能

• S3からの各ノードへの並列データロード

• Amazon DynamoDBからの挿入

• Amazon EMR(予定)

• ロードの際に発生したエラーをトラッキング

スタースキーマやインデックスは不要

RDMSと比較し、x 2 – 4の圧縮率

• 複数の圧縮アルゴリズムの採用

• 自動圧縮機能

Page 14: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

データの挿入

S3からデータのローディング

14

% psql --host=mydb.wetyuioop.us-east-1.redshift-

dev.amazonaws.com --port=5439 –username=admin --

dbname=mydb

mydb=# copy customer from 's3://data/customer.tbl.1'

credentials

'aws_access_key_id=XXXXYYYYZZZZ;aws_secret_acc

ess_key=abcdefghijklmn' delimiter '|';

Page 15: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

クエリー

PostgreSQL JDBC/ODBCドライバ経由で標準的な SQLを実行可能

対応BIツール • ACTUATE

• birst

• JASPERSOFT

• MicroStrategy

リーダーノードに接続し、クエリー実行

• リーダーノードがクエリーを分配し、C++のコードを生成、 コンピュートノードで実行

• 使用可能な全コンピュートノードにおいてリーダーノードに 結果を返す

15

• pentaho • PERVASIVE • tableau など

Page 16: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

セキュリティ

データベース内のデータの暗号化

• ロード前のデータをS3に暗号化した状態で保持することも可能

クライアント・クラスタ間におけるSSL通信

クラスタ単位でのセキュリティ・グループの指定

• EC2 Security Group/CIDRの指定

VPC(Virtual Private Cloud)への対応

• 外部から隔離されたPrivateサブネット内にクラスタ構築が可能

16

Page 17: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

耐久性

全データは非同期でS3上にバックアップを生成

• データの挿入速度によってバックアップ取得時間は依存

• 増分バックアップをスナップショットにより取得可能

バックアップ頻度はユーザーが決定

• 自動・手動によるバックアップが可能

17

Page 18: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

可用性

データはプライマリとは、別ノードにセカンダリコピーが保存される

ドライブの故障は透過的に処理 • リーダーノードは自動的にクエリーをセカンダリ・コピーに

ルート

• 冗長性を維持するために、データの再配置が実行される

単一・複数ノードの故障 • 新規ノードが割当てられるまで、クラスタは使用不可となる

• 自動的に他ノードからデータがコピーされる

• 複数ノード障害時にプライマリ/セカンダリのデータを損失した場合、スナップショットからの復旧が必要となる

18

Page 19: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

パイロットテスト

現行の本番環境

• 32 nodes, 128 CPUs, 4.2TB RAM, 1.6 PB disk

Amazon Redshift

• 20億行、6つの代表的なクエリー

• 2ノードクラスタ

19

クエリーの実行速度 > 10倍に向上

Page 20: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

金額

20

hs1.xlarge コンピュートノード

$/時

hs1.8xlarge コンピュート

ノード $/時

TB当たりの時間単価

TB当たりの年単価

オンデマンド $0.850 $6.80 $0.425 $3,723

1年リザーブド $0.500 $4.00 $0.250 $2,190

3年リザーブド $0.228 $1.82 $0.114 $999

従量課金

ノード数 x 時間単価

コンピュートノードのみの課金(リーダーノードは課金されません)

Page 21: Amazon redshiftのご紹介

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

21