36
Amazon Redshift로 DW구축하기 윤석찬, AWS KOREA Tech Evangelist http://twitter.com/channyun http://facebook.com/channyblog http://channy.creation.net

Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Embed Size (px)

Citation preview

Page 1: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Amazon Redshift로 DW구축하기

윤석찬, AWS KOREA Tech Evangelist http://twitter.com/channyun http://facebook.com/channyblog http://channy.creation.net

Page 2: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

과거 데이터분석 및 리포팅

실시간 데이터프로세싱 및 대시보드

데이터 예측 학습을 통한 스마트 전망

AmazonKinesisAmazonEC2AWSLambda

AmazonRedshi6,AmazonRDSAmazonS3AmazonEMR

Data-driven development

AmazonMachineLearning

Page 3: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Networking

VPC Direct

Connect ELB Route53

Storage

S3 EBS Glacier Storage Gateway EC2

Compute

WorkSpaces

Elastic MapReduce Data Pipeline

Hosted Hadoop framework

Move data among AWS services and on-premises data

sources

Redshift

Petabyte-scale data warehouse

service

Kinesis Real-time

processing of streaming data at

massive scale

Zero admin NoSQL DB with fast, predictable

performance

DynamoDB

AWS 빅데이터 서비스 빌딩 블록

Page 4: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

•  Kinesis:Real-'medatastreamofin-gameac'vity•  MulApleKinesisapplicaAons:Dashboards,analy'csandstorage

•  DataWarehouse:BIrepor'ngandinterac'vequeries•  S3andGlacier:Datastorageandlongtermarchival

슈퍼셀 게임 분석 사례

Page 5: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

데이터 분석 데이터 저장

Import/Export

Direct Connect

데이터 수집

Amazon Kinesis

Amazon Glacier

S3

DynamoDB

Amazon Aurora

AWS 빅데이터 빌딩 블럭

DataPipeline

CloudSearch

EMR EC2

Amazon RedshiC

Machine Learning

Page 6: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

관계형 데이터 웨어하우스 대용량 병렬 처리 – 페타 바이트급 매니지드 서비스 $1,000/TB/Year; starts at $0.25/hour

AmazonRedshi6

더 빠르고더 간단하고더 싸게

Page 7: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

기존 데이터웨어하우스(DW)의 문제 ...

글로벌 2,000개 회사

다년 계약 요구

다년 개발 배포 요구

수백만 달러 사용료 요구

Page 8: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

변화에 대한 불일치 사항

작은 기업도 대용량 데이터를 가진다 (모바일, 소셜, 광고기술, IoT) 분석에 대한 고비용, 관리 복잡성이 혁신 저해

0

200

400

600

800

1000

1200

EnterpriseData DatainWarehouse

Page 9: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Amazon Redshift의 서비스 관점

•  10배 저렴 •  손쉬운 배포 •  높은 DBA 생산성

•  10배 빠름 •  프로그래밍이 없음 •  손쉽게 Hadoop, 머신러닝,스트림을 도구와 연동

•  워크 플로우 상에 분석 •  필요할 때만 사용 가능 •  고가용성 및 재해 복구

Enterprise Big Data SaaS

Page 10: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

주요 고객

Page 11: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Amazon Redshift 아키텍처 •  리더(Leader)Node

SQL end point/메타 데이터 저장 쿼리 플랜 최적화/쿼리 실행 관장

•  컴퓨팅(Compute)Nodes로컬 열 기반 스토리지 모든 데이터 로드/쿼리/백업 등에 대한 병렬 분산 처리

•  $0.25/hour에서 시작 , 2 PB (압축)까지 DC1: SSD; scale from 160 GB to 326 TB DS2: HDD; scale from 2 TB to 2 PB

SQLClients/BITools

128GBRAM

16TBdisk

16cores

Inges'on/BackupBackupRestoreAmazonS3/AmazonDynamoDB/SSH

JDBC/ODBC

10GigE(HPC)

128GBRAM

16TBdisk

16coresComputeNode

128GBRAM

16TBdisk

16coresComputeNode

128GBRAM

16TBdisk

16coresComputeNode

LeaderNode

Page 12: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #1: 빠르다 •  I/O를 최대한 줄이는 구조

컬럼(Column) 기반 스토리지 c.f RDB-행기반

데이터 압축

스토리지 직접 연결

대용량 블록 사이즈

Sort Keys and Zone Maps

analyze compression listing; Table | Column | Encoding ---------+----------------+---------- listing | listid | delta listing | sellerid | delta32k listing | eventid | delta32k listing | dateid | bytedict listing | numtickets | bytedict listing | priceperticket | delta32k listing | totalprice | mostly32 listing | listtime | raw

10|13|14|26|…

…|100|245|324

375|393|417…

…512|549|623

637|712|809…

…|834|921|959

10

324

375

623

637

959

Page 13: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

SELECTCOUNT(*)FROMLOGSWHEREDATE=‘09-JUNE-2013’

MIN:01-JUNE-2013MAX:20-JUNE-2013

MIN:08-JUNE-2013MAX:30-JUNE-2013

MIN:12-JUNE-2013MAX:20-JUNE-2013

MIN:02-JUNE-2013MAX:25-JUNE-2013

UnsortedTableMIN:01-JUNE-2013MAX:06-JUNE-2013

MIN:07-JUNE-2013MAX:12-JUNE-2013

MIN:13-JUNE-2013MAX:18-JUNE-2013

MIN:19-JUNE-2013MAX:24-JUNE-2013

SortedByDate

장점 #1: 빠르다 SortKeysandZoneMaps

Page 14: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #1: 빠르다 • 병렬 및 분산 처리

Query

Load

Export

Backup

Restore

Resize

Amazon S3/EMR/DynamoDB/SSH

128GB RAM

16TB disk

16 cores Compute Node

128GB RAM

16TB disk

16 cores Compute Node

128GB RAM

16TB disk

16 cores Compute Node

SQL Clients/BI Tools

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores Leader Node

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores

CN

128GB RAM

48TB disk

16 cores Leader Node

Page 15: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

128GB RAM

16TB disk

16 cores Compute Node

128GB RAM

16TB disk

16 cores Compute Node

128GB RAM

16TB disk

16 cores Compute Node

128GB RAM

16TB disk

16 cores Leader Node ID Name

1 JohnSmith

2 JaneJones

3 PeterBlack

4 PatPartridge

5 SarahCyan

6 BrianSnail

1 JohnSmith

4 PatPartridge

2 JaneJones

5 SarahCyan

3 PeterBlack

6 BrianSnail

장점 #1: 빠르다 DistribuAonKeys

Page 16: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #1: 빠르다

•  높은 I/O 워크로드를 처리를 위한 하드웨어 최적화(4GB/sec/node)

•  향상된 네트워크 대역폭 (1M packets/sec/node)

•  인스턴스 크기 및 스토리지 선택 가능

•  주기적인 자동 패치 기능 제공

•  사례 : 신규 Dense Storage (HDD) 인스턴스 타입 ü  메모리 2x, 컴퓨팅 2x, disk 처리량 1.5x ü  비용: 이전 타입과 같음!

Page 17: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #2: 싸다

DS2(HDD) PricePerHourforDW1.XLSingleNode

EffecAveAnnualPriceperTBcompressed

On-Demand $0.850 $3,7251YearReserva'on $0.500 $2,1903YearReserva'on $0.228 $999

DC1(SSD) PricePerHourforDW2.LSingleNode

EffecAveAnnualPriceperTBcompressed

On-Demand $0.250 $13,6901YearReserva'on $0.161 $8,7953YearReserva'on $0.100 $5,500

•  간단한 가격 모델 •  노드 수 x 시간당 과금 •  Leader node 과금 없음 •  초기 비용 없음 •  사용한 만큼만

Page 18: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #3: 관리는 AWS몫

• 손쉬운 백업 • 클러스터내 중복 복제본 • S3로 지속적인 증분 백업 • 리전 간 백업 • 스트리밍 복원

Amazon S3

Amazon S3

Region1

Region2

Compute Node

Compute Node

Compute Node

• 빠른 장애 복구 • 디스크 장애 • 노드 장애 • 네트워크 장애 • 리전/AZ 장애

Page 19: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #4: 우수한 보안 기능

•  데이터 연결시 SSL 사용 가능

•  Amazon VPC 적용 가능 (네트워크 분리)

•  데이터 암호화 지원

ü S3로 부터 암호화 된 데이터 로딩 가능 ü Block key, Cluster key, Master key (AES-256) ü 온프레미스 HSM & AWS CloudHSM 지원

•  AWS CloudTrail 통합을 통한 감사기능

•  SOC 1/2/3, PCI-DSS, FedRAMP, BAA 인증

10GigE(HPC)

Inges'onBackupRestore

SQL Clients/BI Tools

128GB RAM

16TB disk

16 cores

128GB RAM

16TB disk

16 cores

128GB RAM

16TB disk

16 cores

128GB RAM

16TB disk

16 cores

Amazon S3 / EMR/DynamoDB/SSH

CustomerVPC

InternalVPC

JDBC/ODBC

Leader Node

Compute Node

Compute Node

Compute Node

Page 20: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #5: 빠른 혁신 • 서비스 개시 후 100여번의 신규 기능 추가 • 격주 새로운 기능 출시 • 자동 패치 제공

Service Launch (2/14)

PDX (4/2)

Temp Credentials (4/11)

DUB (4/25)

SOC1/2/3 (5/8)

Unload Encrypted Files

NRT (6/5)

JDBC Fetch Size (6/27)

Unload logs (7/5)

SHA1 Builtin (7/15)

4 byte UTF-8 (7/18)

Sharing snapshots (7/18)

Statement Timeout (7/22)

Timezone, Epoch, Autoformat (7/25)

WLM Timeout/Wildcards (8/1)

CRC32 Builtin, CSV, Restore Progress (8/9)

Resource Level IAM (8/9)

PCI (8/22)

UTF-8 Substitution (8/29)

JSON, Regex, Cursors (9/10)

Split_part, Audit tables (10/3)

SIN/SYD (10/8)

HSM Support (11/11)

Kinesis EMR/HDFS/SSH copy, Distributed Tables, Audit Logging/CloudTrail, Concurrency, Resize Perf.,

Approximate Count Distinct, SNS Alerts, Cross Region Backup (11/13)

Distributed Tables, Single Node Cursor Support, Maximum Connections to 500 (12/13)

EIP Support for VPC Clusters (12/28)

New query monitoring system tables and diststyle all (1/13)

Redshift on DW2 (SSD) Nodes (1/23)

Compression for COPY from SSH, Fetch size support for single node clusters, new system tables with commit stats, row_number(), strotol() and query termination

(2/13)

Resize progress indicator & Cluster Version (3/21)

Regex_Substr, COPY from JSON (3/25)

50 slots, COPY from EMR, ECDHE ciphers (4/22)

3 new regex features, Unload to single file, FedRAMP(5/6)

Rename Cluster (6/2)

Copy from multiple regions, percentile_cont, percentile_disc (6/30)

Free Trial (7/1)

pg_last_unload_count (9/15)

AES-128 S3 encryption (9/29)

UTF-16 support (9/29)

Page 21: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #6: 강력한 지원 기능

•  맞춤형 함수 지원 •  머신 러닝 •  데이터 사이언스 •  Data Science

Amazon Machine Learning

Page 22: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #7: 다양한 연관 생태계

Data Integration

Systems Integrators

Business Intelligence

Page 23: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

장점 #8: 서비스 지향 아키텍쳐

DynamoDB

EMR

S3

EC2/SSH

RDS/Aurora

AmazonRedshij

Amazon Kinesis

Machine Learning

DataPipeline

CloudSearch

MobileAnalyAcs

Page 24: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Demo:

Page 25: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

qwikLABS 무료 실습

hkps://qwiklab.com/focuses/preview/1583

Page 26: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

사용 사례

Page 27: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Twitter Firehose 실시간 분석 사례

Page 28: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

AmazonRedshi6Startsat$0.25/hour

EC2Startsat$0.02/hour

S3$0.030/GB-Mo

AmazonGlacier$0.010/GB-Mo

AmazonKinesis$0.015/shard1MB/sin;2MB/out$0.028/millionputs

Twitter Firehose 실시간 분석 사례

Page 29: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

•  500MM tweets/day = ~ 5,800 tweets/sec

•  2k/tweet is ~12MB/sec (~1TB/day)

•  $0.015/hour per shard, $0.028/million PUTS

•  Amazon Kinesis cost is $0.765/hour

•  Amazon Redshift cost is $0.850/hour (for a 2TB node)

•  S3 cost is $1.28/hour (no compression)

Total: $2.895/hour

서비스

비용 구조

Page 30: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Amazon.com – 웹로그 분석 •  Amazon.com 로그 분석

ü  1PB+ workload, 2TB/day, growing 67% YoY

ü  Largest table: 400 TB

•  1차적 해결 방법 ü  Legacy DW—query across 1 week/hr. ü  Hadoop—query across 1 month/hr.

•  ?

Page 31: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

•  데이터 처리 용량 ü Query 15 months of data (1PB) in 14 minutes ü Load 5B rows in 10 minutes ü 21B rows joined with 10B rows – 3 days (Hive) to 2 hours ü Load pipeline: 90 hours (Oracle) to 8 hours

•  인스턴스 사양 ü 64 clusters/800 total nodes ü 13PB provisioned storage

•  인력: 2 DBAs

데이터

처리 구조

Page 32: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

마치면서…

Amazon Redshift: Spend time with your data, not your database

Page 33: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

Amazon Redshift – 무료 사용(Free tier) • DC1.Large 노드 평가판을 2개월간 무료로 사용 가능

ü 매월 750시간을 무료로 사용할 수 있음 ü 160GB의 압축된 SSD 스토리지로 필요에 따라 사용 가능

• 시간을 기준으로 계산되므로 탄력적 사용 가능 ü DC1 Large 노드 10대를 75시간 ü DC1 Large 노드 100대를 7.5시간

Page 34: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

참고 자료

• Amazon Redshift •  http://aws.amazon.com/ko/redshift

• Amazon Redshift FAQ •  http://aws.amazon.com/ko/redshift/faqs

• Amazon Redshift 관련 자료 •  http://aws.amazon.com/articles/Amazon-Redshift

• 블로그 •  http://aws.amazon.com/ko/blogs/korea/category/amazon-

redshift

Page 35: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

hkp://onoffmix.com/event/55782/

Page 36: Amazon Redshift로 데이터웨어하우스(DW) 구축하기

여러분의 피드백을 기다립니다!

•  이전 웨비나 발표 자료 및 동영상 •  https://aws.amazon.com/ko/blogs/korea/category/webinar/

•  한국어 공식 소셜 미디어 @AWSKorea

AmazonWebServices.ko

AWSKorea

AWSKorea