64
Amazon Relational Database Service (Amazon RDS) AWS BlackBelt Tech Webinar 2014 2014.04.16 Amazon Data Service Japan 작성 : 솔루션 아키텍트 松尾康博, 테크니컬 트레이너 江川大地 Amazon Corporate Services Korea 번역 : 솔루션 아키텍트 정윤진

20150125 AWS BlackBelt - Amazon RDS (Korean)

Embed Size (px)

Citation preview

Page 1: 20150125 AWS BlackBelt - Amazon RDS (Korean)

Amazon Relational Database Service(Amazon RDS)

AWS BlackBelt Tech Webinar 2014

2014.04.16

Amazon Data Service Japan

작성 : 솔루션 아키텍트 松尾康博, 테크니컬 트레이너 江川大地

Amazon Corporate Services Korea

번역 : 솔루션 아키텍트 정윤진

Page 2: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

Agenda

Amazon RDS의 개요

Amazon RDS의 주요 기능

Amazon RDS의 새로운 기능 소개

과금 모델

Tips (참고자료)

정리

Page 3: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

응용 프로그램

스토리지EBS, S3, Glacier, Storage Gateway

컨텐츠 전송(CDN)CloudFront

네트워킹VPC, Route 53, Direct Connect

인증 및로그IAM,

CloudTrail,CloudHSM

모니터링CloudWatch

Web 관리 콘솔Management

Console

배포 및 자동화Elastic Beanstalk,Cloud Formation,

OpsWorks

명령줄 도구CLI

라이브러리 & SDKsJava, PHP, .NET,

Python, Ruby

글로벌 인프라리전(region), 가용 영역(Availability Zone), 엣지 로케이션 (CDN edge)

AZRegion

컴퓨팅

데이터베이스RDS, DynamoDB,

Redshift, ElastiCache

분석Elastic MapReduce,

Kinesis, Data Pipeline

어플리케이션 서비스AppStream, Cloud Search, SWF, SQS, SES, SNS, Elastic Transcoder

EC2, Auto Scaling, Elastic Load Balancing, Workspaces

Page 4: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

4

AWS 가 제공하는 데이터베이스

관리형 데이터베이스 서비스. 설치, 운영, 확장이매우 쉬운 관계형 데이터베이스를 서비스로 제공

Amazon RDS

Amazon DynamoDB

관리형 NoSQL 데이터베이스. 빠른 성능, 완벽한확장성 및 안정성을 제공

Amazon Redshift

관리형 데이터웨어하우징 서비스. 수백기가바이트부터 페타바이트 규모, 운영 및 확장이편리.

Amazon ElastiCache

운영 및 확장이 편리한 관리형 캐시 서비스

Page 5: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

일반적인 Web 아키텍처 (다른 서비스와 연동)

Tokyo region

AZ-1a AZ-1c

RDS 마스터 RDS 슬레이브

자동 동기화

ELB(로드 밸런서)

Amazon Route 53(도메인 이름 서비스)

컨텐츠 저장

S3

CloudFront

(컨텐츠 전송)

EC2EC2

Page 6: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

6

Amazon RDS

구축

• 클릭 몇번 or API로 DB 를 생성

• EC2와 마찬가지로 초기 비용 없음, 종량 과금

전환

• 4종의 데이터베이스 엔진을 지원

• 기존 응용 프로그램의 변경이 필요 없음

운용

• 고가용성을 위한 기능을 제공

• 모니터링, 장애 감지, 복구, 패치, 확장이 매우 편리

보안

• Security Groups, VPC와 함께 사용가능

https://aws.amazon.com/ko/rds/

Page 7: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

7

직접 구축 vs. RDS

Power, HVAC, net

Rack & stack

Server maintenance

OS patches

DB s/w patches

Database backups

Scaling

High availability

DB s/w installs

OS installation

App optimization

Power, HVAC, net

Rack & stack

Server maintenance

OS patches

DB s/w patches

Database backups

Scaling

High availability

DB s/w installs

OS installation

App optimization

Power, HVAC, net

Rack & stack

Server maintenance

OS patches

DB s/w patches

Database backups

Scaling

High availability

DB s/w installs

OS installation

App optimization

데이터센터 On EC2 RDS

직접수행해야하는작업 AWS가제공하는관리기능

Page 8: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

8

DB 인스턴스 종류와 성능

DB Instance Class 메모리 (GiB) vCPU PIOPS최적화

네트워크성능

db.t1.micro 0.615 1 매우낮음

db.m3.medium 3.75 1 중간

db.m3.large 7.5 2 중간

db.m3.xlarge 15 4 500Mbps 높음

db.m3.2xlarge 30 8 1000Mbps 높음

db.m2.xlarge 17.1 2 중간

db.m2.2xlarge 34.2 4 500Mbps 중간

db.m2.4xlarge 68.4 8 1000Mbps 높음

db.cr1.8xlarge※ 244 32 10Gbit

http://aws.amazon.com/ko/rds/details/

※ MySQL5.6, PostgreSQL만지원, r3 family 가추가됨

Page 9: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

9

DB 엔진현재 4종류의 엔진을 지원

MySQL• 5.1.x、5.5.x、5.6.x 중 선택 가능

PostgreSQL• 9.3.x 선택 가능

Oracle• 11g R2 (11.2.0.x )• BYOL:SE1, SE, EE 를 지원• 라이센스 포함:SE1

SQL Server• 2008 R2, 2012 선택 가능• BYOL: Standard Edition, Enterprise Edition• 라이센스 포함:Express, Web Edition, Standard Edition

Page 10: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

10

Agenda

Amazon RDS의 개요

Amazon RDS의 주요 기능

Amazon RDS의 새로운 기능 소개

과금 모델

Tips (참고자료)

정리

Page 11: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

11

주요 기능

신뢰성 향상

운용

성능

보안

Page 12: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

12

가용성처리량증가

대기시간

Scale up

Multi AZ

읽기복제

Provisioned IOPS

읽기복제 (read replica)Scale up Provisioned IOPS

Region

Multi-AZ

Availability

zone

Availability

zone

손쉽게 고성능 / 고가용성을 구현

Page 13: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

RDS(MySQL) 아키텍처

アベイラビリティゾーンA アベイラビリティゾーンB

自動バックアップ스냅샷(자동/수동)

데이터동기화

비동기복제

자동으로 fail-over

Binlog

(トランザクションログ)

(5分間隔)

Binlog

(트랜잭션로그)

(5분간격)

Binlog

S3 Availability Zone A Availability Zone B

Page 14: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

1414

アベイラビリティゾーンA アベイラビリティゾーンB

自動バックアップ

スナップショット

자동 백업

스냅샷

비동기복제다중 AZ 배포(Multi-AZ)

데이터동기화

자동으로 fail-over

RDS(MySQL) 아키텍처

Page 15: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

15

다중 AZ 배포란 (Multi-AZ)

원클릭으로 고가용성을 구현할 수 있는 솔루션

• 높은 기술력의 DBA 들이 구현하는 구성을 그대로 서비스에적용

동기화 복제와 자동 장애 복원의 복합 구성

• 응용 프로그램에서 별도의 작업 필요없음(엔드포인트가 변하지 않음)

fail-over가 작동 하는 경우

• 패치등 유지 보수 계획

• 인스턴스 또는 하드웨어 오류

• 수동 reboot 수행시 강제 작동 지정

Region

Multi-AZ

Availability

zone

Availability

zone

http://aws.amazon.com/ko/rds/mysql/#Multi-AZ

Page 16: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

16

RDS(MySQL) 아키텍처

アベイラビリティゾーンA アベイラビリティゾーンB

自動バックアップ자동백업

읽기복제노드(read replica)Binlog

(トランザクションログ)

(5分間隔)

Binlog

(트랜젝션로그)

(5분단위)

데이터동기화

자동으로 fail-over

Page 17: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

17

읽기 복제 (RR) ?

읽기 전용의 복제본

• MySQL 고유의 복제 기능 제공

• 각 RR은 별도의 엔드포인트를 가지고 있음

• 기본적으로 최대 5대까지 확장 가능

• Multi-AZ와 함께 사용 가능

Use case

• Read(select)쿼리의 분산, BI등 분석 처리

• Multi-AZ를 대체하는 기능이 아님!!

새로운 기능• 다른 리전(region)에 구성 가능

• 데이터 센터/EC2 와 함께 사용 가능

• 읽기 복제를 마스터로 변경 가능

• 복제의 복제를 구성 가능

Select 분산

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Re

adRepl.html

Page 18: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

アベイラビリティゾーンA アベイラビリティゾーンB

自動バックアップ

スナップショット

자동 백업

스냅샷

비동기복제

자동백업기능

데이터동기화

자동으로 fail-over

RDS(MySQL) 아키텍처

Page 19: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

19

자동 백업 및 복원

RDS 표준 기능

• 자동 스냅샷 + 트랜젝션 로그를 S3에 저장

자동 스냅샷

• 1일 1회 자동 생성 (백업 윈도우에 지정된 시간에 수행)

• 보존 기간은 최대 35일 (0일~35일 사이에 지정 가능)

• (필요할때 검색 가능)

2가지 복원 방법

• 복원:스냅샷을 바탕으로 DB 인스턴스 생성

• Point-In-Time-Recovery:

• 지정된 시간(최근5분)전의 데이터를 가진 DB 인스턴스를 생성

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.BackupRestore.html

Page 20: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

스냅샷 사용

Production.xxx.amazonaws.com

서비스에사용중인인스턴스에문제가발생하여스냅샷을통해새로운 RDS

인스턴스를시작.응용프로그램은새로운RDS 인스턴스에연결

자동 Snapshot서비스인스턴스

Production2.xxx.amazonaws.com

복원 or Point-in-time-recovery

Page 21: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

스냅샷 사용

Production.xxx.amazonaws.com

테이블변경등의대형데이터베이스관련작업전에수동으로스냅샷을생성.문제가발생한경우스냅샷을사용하여작업전상태로원상복구

수동 Snapshot

서비스인스턴스

Production2.xxx.amazonaws.com

복구 or Point-in-time-recovery

Update Ver.Old Ver.

Issue?

Page 22: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

22

스냅샷 사용

스냅샷을 다른 리전(region)으로 복제 가능

• 다른 리전으로 스냅샷을 복사

• 복제된 스냅샷을 기반으로 데이터베이스를 생성

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.

html

Page 23: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

23

데이터베이스 유지보수

RDS 표준 기능• Maintenance Window 에 지정한 시점에 수행

유지보수 내용• 운영체제, 데이터베이스의 패치, 업데이트를 자동으로 적용

• Reboot 이 필요한 경우도 있음

TIPS• 수개월에 한번 정도의 빈도로 발생(매주 발생하는 경우는 거의없음)

• 지정된 시간중 몇분 정도에 걸쳐 진행(작업에 따라 다름)

• 응용 프로그램에서는 DB접근이 안되는 경우에 대비하여 별도의사과 페이지를 준비하는것이 좋음

• 트래픽이 거의 없는 요일 및 시간대를 지정

• Event 통지를 운영/모니터링에 포함

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_TerminologyandKeyConcepts.html#Concepts.DBMaintenance

Page 24: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

24

이벤트 알람 (DB Event Subscriptions)

RDS에서 발생하는 40가지 이상의 이벤트를 SNS를 통해 Push알림• 데이터베이스의 종료, 백업, 시작, 유지보수 시작 및 종료 등

응용 프로그램과 함께 자동화 가능

DB event

Alarm

Queue

Email

Notification

Message

HTTP

Notification

Amazon SNS

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Event

s.html

Page 25: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

25

DB엔진 로그종류 보존기간

MySQL Error, Slow Query※1, General※1 24시간

PostgreSQL - (로그종류의구분이없음) 7일 ※2

Oracle Alert, Trace 7일 ※2

SQL Server Error, Agent, Trace 7일 ※2

로그 확인

각종 로그를 직접 확인 가능

• API 사용하여 다운로드 하거나 관리 콘솔에서도 확인 가능

※1 Parameter Group사용하여설정가능※2 Parameter Group으로조정가능

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html

Page 26: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

26

Rename

Production.xxx.amazonaws.com

Old.xxx.amazonaws.com

EC2에서 RDS를연결하기위해사용하는엔드포인트(FQDN)를변경하는기능

・재해복구 (복원)인스턴스의이름을변경・대형작업을하는경우등에유용

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RenameInstance.html

Page 27: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

27

Rename 사례 1

Production.xxx.amazonaws.com

Old.xxx.amazonaws.com

장애및복구

Snapshot

서비스용인스턴스

prod2.xxx.amazonaws.com

Prodduction.xxx.amazonaws.com

Page 28: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

28

Rename 사례 2

Production.xxx.amazonaws.com

Old.xxx.amazonaws.com

서비스업데이트후문제가발생하여원복이필요할때

서비스인스턴스

rr1.xxx.amazonaws.com

Prodduction.xxx.amazonaws.com

Update Ver.Old Ver.

Issue

Page 29: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

29

Rename 주의 사항

DNS 변경• 순식간에 변경되는 것이 아님에 주의. 기준은 수 분(3분 정도)

• FQDN 이기때문에 동시에 중복되는 이름을 사용하는것은 불가능

Rename 해도 변경되지 않는 부분 (API를 사용하는 경우 특히주의)• CloudWatch의 MetricName• DB Events의 Identifier

Rename 을 하더라도 그대로 유지되는 부분• Master와 RR의 관계• Tag, Snapshot

기타• http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Rena

meInstance.html

Page 30: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

30

CloudWatch

각종 지표를 60초 간격으로 수집, 확인 가능

• 인스턴스 관련 지표 ( CPU, Memory, etc. )

• 스토리지 관련 지표 (IOPS, Queue Depth, etc.)

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Monitoring.html

Page 31: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

31

Parameter Groups

Parameter Groups

• 다수의 DB 인스턴스에 적용 가능한 DB 파라메터 설정

• DB 엔진별로 기본 설정이 존재

사용자 정의

• 새로운 parameter groups 를 생성하고 원하는 항목을 변경,저장하여 사용이 가능

제한 사항

• 일부 설정 사항은 변경이 불가할 수 있음

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html

Page 32: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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

Scale-up 기능

관리 콘솔 또는 API 를 사용하여 확장 가능

• 인스턴스의 reboot이 필요

• 명령줄 도구(AWS CLI) 역시 사용 가능

Scale-down 역시 가능• 필요에 따라 자유롭게 성능을 조정 가능

• 개발용 DB의 경우 주간에는 크게, 야간에는 작게 운용

성능 조정의 범위• 최소: db.t1.micro (1vCPU, 0.615GB 메모리)

• 최대: db.cr1.8xlarge( 32vCPU, 244GB 메모리)

• 신규: db.r3 family 가 추가됨

$ aws rds modify-db-instance \

--db-instance-identifier test-db \

--db-instance-class db.m2.4xlarge \

--apply-immediately

Scale-up

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeInstan

ce.html

Page 33: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

33

스토리지

EBS 볼륨 기반의 스토리지에 DB 데이터 저장

• 데이터베이스 및 로그의 저장에 이용

• Stripe 된 다수의 EBS 볼륨으로 구성

• 볼륨의 크기를 증가하면 볼륨의 숫자가 증가하여 IOPS 성능향상

• 스토리지의 크기를 동적으로 (온라인) 추가 가능

DB 엔진 스토리지크기 동적증설

MySQL 5GB-3TB

PostgreSQL 5GB-3TB

Oracle 10GB-3TB

SQL Server( Web , Ex) 20GB-1TB

SQL Server (SE, EE) 200GB-1TB

Page 34: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

34

Provisioned IOPS (PIOPS) 스토리지

고성능 스토리지 옵션

• 스토리지의 성능을(IOPS) 지정 가능

• 낮은 지연 시간, 높은 처리량을 제공

• 표준 스토리지에서 온라인으로 PIOPS 변경가능

• 장애 조치시 복구 시간 단축에도 유용하게 사용 가능

DB엔진 IOPS 크기 동적증설

MySQL 1000-30,000 100GB-3TB

PostgreSQL 1000-30,000 100GB-3TB

Oracle 1000-30,000 100GB-3TB

SQL Server( Web , Ex) 1000-10,000 100GB-1TB

SQL Server (SE, EE) 1000-10,000 200GB-1TB

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.html

Page 35: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

35

Provisioned IOPS 스토리지(계속)IOPS 사용시 주의 사항

• 각 DB엔진 사양, Page Size 및 가상화 기술의 차이로 실제IOPS 는 아래의 표와 같은 성능을 보인다.

• 보다 큰 PIOPS 에서는 보다 낮은 지연시간과 보다 높은 처리량

• 인스턴스의 크기가 작은 경우 스토리지로의 Network 성능한계로 인해 설정한 IOPS에 도달하지 못할 수 있다(m3.xlarge이상 권장)

DB엔진(최대설정가능 IOPS)

Page Size Max IOPS

MySQL(3TB, 30,000) 16KB 20,000

PostgreSQL(3TB, 30,000) 8KB 25,000

Oracle(3TB, 30,000) 8KB 25,000

SQL Server(1TB, 10,000) 8KB 10,000

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.ProvisionedIOPS.html#US

ER_PIOPS.Realized※ Read 50%, Write 50%일경우

Page 36: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

36

GP2 (General Purpose Storage) 추가

SSD를 기본으로 사용하는 GP2를 RDS 에서도!

• 기존의 Standard volume 은 Magnetic volume 으로,

• SSD 기반의 신규 스토리지인 GP2 volume 사용 가능

• Provisioned IOPS volume 역시 그대로 사용 가능

• GP2 volume 에 대한 자세한 설명은 다음의 링크를 참조

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSV

olumeTypes_gp2

Page 37: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

37

VPC 연동

VPC 내부의 특정 서브넷에 RDS 인스턴스 사용 가능

• 반드시 DB Subnet Group을 사전에 지정해야 함

• Default VPC 환경에서는 기본적으로 정의되어 있음

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html

Page 38: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

38

접근 제어

Security Group 사용• EC2 인스턴스에서 DB 인스턴스에 대한 접근 제어

주의 사항• VPC Default 환경에서는 DB Security Group 대신 Security

Group을 사용

• DB Security Group은 Security Group에 access source 로만지정 가능

시작위치 설정대상

EC2 Classic DB Security Group

EC2 VPC VPC Security Group

VPC Default VPC Security Group

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.

html

Page 39: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

39

DB엔진 별 주요 기능 정리

MySQL PostgreSQ

L

Oracle SQL Server

Multi-AZ

읽기복제

Cross region 읽기복제

Point-In-Time-

Recovery

VPC

Max Storage

Provisioned IOPS

Page 40: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

40

Agenda

Amazon RDS의 개요

Amazon RDS의 주요 기능

Amazon RDS의 새로운 기능 소개

과금 모델

Tips (참고자료)

정리

Page 41: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

41

RDS 일반 (엔진 공통)

인스턴스• CR1 추가

• M3 추가

• R3 추가

가용성• 리전 (region)간 스냅샷 복사 가능

• GA (SLA 존재)

운용• 모바일 버전 AWS 콘솔 사용가능

• 태그 지원

보안• 리소스 레벨의 권한 지정

Page 42: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

42

DB엔진 – MySQL-

지원되는 버전

• 5.6 지원

• 5.1 에서 5.5로 메이저 버전 업그레이드 가능

가용성

• Cross-region 복제 기능

• 다계층 복제구성 (읽기 복제를 원본으로 읽기 복제 생성 가능)

• 다수의 읽기 복제 생성 가능

Page 43: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

43

DB엔진 – Oracle -

표준 기능• 11.2.0.4 지원• Character Set ( JA16SJISTILDE, AL32UTF8, etc. ) 선택 가능• Oracle GoldenGate 사용가능

사용 가능 옵션• Oracle Statspack• Oracle Advanced Security(Native Network Encryption, Transparent Data Encryption)• Oracle Time Zone• Oracle Enterprise Manager Database Control• Oracle XML DB• Oracle Application Express (APEX, APEX-DEV)

Enterprise Option ( BYOL라이센스)• Partitioning• Management Packs (Diagnostic, Tuning)• Advanced Compression• Total Recall

추가 정보• https://aws.amazon.com/ko/rds/oracle/

Page 44: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

44

Oracle Statspack

Oracle Statspack을 사용하여 DB성능 분석이 가능!• Oracle Statspack

• 원하는 기간 동안의 성능 통계 데이터 출력 도구

• 쿼리의 튜닝에 유용한 정보를 찾을 수 있음

• RDS 에서의 사용

• RDS for Oracle 모든 버전, 에디션에서 사용 가능

• Option Group 에서 활성

• 추가 정보

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html#Appendix.Oracle.Options.Statspack

Page 45: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

45

Oracle GoldenGate

Oracle GoldenGate를 사용한 복제가 가능!• Oracle GoldenGate

• DB 간 데이터 연동을 제공하는 도구

• 로그에서 데이터를 추출, 원격 DB로 전송

• RDS 에서 사용 방법

• RDS for Oracle 의 모든 버전, 모든 에디션에서 사용 가능

• EC2 를 통해 GoldenGate hub 구성

• 다음의 링크를 참조

• 사용 시나리오의 예

• 데이터 센터의 DB 데이터를 RDS로

• EC2의 DB 데이터를 RDS로

• RDS의 DB 데이터를 RDS로 (다른 region 에도 가능)

• RDS의 DB 데이터를 사내의 DB로

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleGoldenGate.html

Page 46: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

46

DB 엔진 – SQL Server -

표준 기능• SQL Server Migration Assistant

• Database Engine Tuning Advisor (SE, EE, Web)

• SQL Server Agent

• SSL 연결

RDS 옵션• Transparent Data Encryption

버전 업그레이드

• 2008 R2에서 2012로 메이저 버전업 가능

상세 정보• https://aws.amazon.com/ko/rds/sqlserver/

Page 47: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

47

DB 엔진 – PostgreSQL -

버전• 9.3.1 - 9.3.5

표준 기능• SSL 연결이 기본적으로 활성화

• 다양한 확장 모듈 설치 가능• 확장 모듈을 설치하여 사용할 수 있는 기능의 예

– Procedure

– Data encryption

– 외부 DB 데이터 검색

• PostGIS를 RDS 확장 모듈로 제공

RDS 기능• Multi-AZ, Read Replica, Provisioned IOPS 등 주요 RDS 기능을 지원

상세 정보• https://aws.amazon.com/ko/rds/postgresql/

Page 48: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

48

확장 모듈 (contrib)

btree_gin earthdistance pgrowlocks sslinfo

btree_gist fuzzystrmatch pg_trgm tablefunc

chkpass hstore plperl tsearch2

citext intagg plpgsql unaccent

cube intarray pltcl uuid-ossp

dblink isn postgis

dict_int ltree postgis_tiger_geocoder

dict_xsyn pgcrypto postgis_topology

=> SHOW rds.extensions;

Page 49: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

49

확장 모듈 (contrib)

btree_gin earthdistance pgrowlocks sslinfo

btree_gist fuzzystrmatch pg_trgm tablefunc

chkpass hstore plperl tsearch2

citext intagg plpgsql unaccent

cube intarray pltcl uuid-ossp

dblink isn postgis

dict_int ltree postgis_tiger_geocoder

dict_xsyn pgcrypto postgis_topology

절차형 언어(procedure) 사용가능

GIS (지리정보시스템)

데이터 암호화/복호화

Key-Value 형태의데이터 저장 가능

외부의PostgreSQL에접근 가능

• 기타 확장모듈은 다음을 참조.http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#SQLServer.Concepts.General.FeatureSupport

=> SHOW rds.extensions;

Page 50: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

50

확장 모듈 설치 방법

SQL을 사용

=> CREATE EXTENSION [확장 모듈 이름];

=> CREATE EXTENSION dblink;CREATE EXTENSION

(예)

Page 51: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

51

주의 사항

로케일 설정

• RDS for PostgreSQL 의 기본 로케일 :「en_US」

→ 한국어의 경우 인덱스 사용등의 문제가 발생할 수 있으므로데이터베이스 Launch 후 로케일 설정을 한 데이터베이스를 새로 만들필요가 있다

=> CREATE DATABASE newdb WITH template template0 encoding 'utf8' lc_collate 'C' lc_ctype 'C’;

Page 52: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

52

주의 사항

클라이언트 인증 설정• pg_hba.conf 대신 Security Group에서 제어

→ 접근 소스를 Security Group에 적용.

각 데이터베이스 별로 각각 접근 제어를 수행해야 하는 경우,

EC2에 PostgreSQL를 설치하는 방법을 사용해야 한다.

Page 53: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

53

Agenda

Amazon RDS의 개요

Amazon RDS의 주요 기능

Amazon RDS의 새로운 기능 소개

과금 모델

Tips (참고자료)

정리

Page 54: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

54

RDS 과금 모델

DB 인스턴스 사용 시간 ($/시간)• Single or Multi-AZ

• BYOL or 라이센스 포함 ( Oracle, SQL Server )

스토리지

• 스토리지 용량 ($/GB/월) I/O 비용

• Magnetic / GP2 or PIOPS

• Single or Multi-AZ

• 백업 스토리지 용량($/GB/월)

• I/O 요청 수 (Magnetic) or PIOPS

네트워크

• RDS에서 인터넷으로 데이터를 전송한 바이트 수 ($/GB)

http://aws.amazon.com/ko/rds/pricing/

Page 55: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

55

2가지 가격모델

On demand DB 인스턴스

• 시간 단위 종량 과금

Amazon RDS 예약 인스턴스 (RI)

• 사전 비용을 지불하면 시간당 가격 할인 (최대 70%절감)

• 모든 엔진에서 선택 가능

• RI 구입시 다음의 항목을 지정해야 함

• 리전(region), DB엔진, DB 인스턴스 클래스, 배포 유형(Single AZ or Multi-AZ), 기간(1년 or 3년)

• Oracle, SQL Server 라이센스 포함 또는 BYOL

http://aws.amazon.com/ko/rds/reserved-instances/

Page 56: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

56

Multi-AZ 가격 인하

2013년 6월 최대 28% 가격 인하

2014년 4월 평균 28% 가격 인하

http://aws.amazon.com/ko/rds/pricing/

Page 57: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

57

Simple Monthly Calculator

Web을 사용하여 대략적인 비용 산정 http://calculator.s3.amazonaws.com/index.html?lng=ko_KR#

Page 58: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

58

AWS 무료 사용 (Free tier)

AWS는 무료 사용 방법 (Free Tier)을 제공• http://aws.amazon.com/ko/free/

RDS 에서 무료 적용 조건• MySQL, Oracle (BYOL), SQL Server Express, PostgreSQL

• Single-AZ db.t1.micro 750시간/월

• Magnetic / GP2 스토리지 20GB (스냅샷 20GB포함)

• 1,000만 I/O

• https://aws.amazon.com/ko/rds/free/

Page 59: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

59

Agenda

Amazon RDS의 개요

Amazon RDS의 주요 기능

Amazon RDS의 새로운 기능 소개

과금 모델

Tips (참고자료)

정리

Page 60: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

60

DB엔진 별 주요 기능 정리

MySQL PostgreSQ

L

Oracle SQL Server

Multi-AZ

읽기복제

Cross region 읽기복제

Point-In-Time-

Recovery

VPC

Max Storage

Provisioned IOPS

Page 61: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

61

각종 제한

기본 제한이 존재• http://docs.aws.amazon.com/general/latest/gr/aws_servi

ce_limits.html#limits_rds

• (예)

• RDS 인스턴스 수 : 40

• 읽기 복제 : 5

• 수동 스냅샷 수 : 50

• 총 스토리지량 : 100TB

필요에 따라 제한을 변경하는 것이 가능 (요청이 필요)• https://aws.amazon.com/ko/contact-us/

Page 62: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

62

참고 자료

Amazon RDS

• http://aws.amazon.com/jp/rds/

Amazon RDS 문서• http://aws.amazon.com/jp/documentation/rds/

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

관련 포럼• https://forums.aws.amazon.com/forum.jspa?forumID=60

블로그• Amazon Web Services Japan blog

• http://aws.typepad.com/

Page 63: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

63

24시간・365 지원 (Support)24시간 지원을 제공 중 입니다.http://aws.amazon.com/ko/premiumsupport/

기본 개발자 비지니스 엔터프라이즈

접수 가능 시간 24시간 / 365일(연중무휴)

초기 응답 시간 셀프 서비스 12시간 1시간 15분

연락처 N/A 1인 5인 무제한

채팅 불가 불가 가능 가능

TEL 불가 불가 가능 가능

전담 인력 없음 없음 없음 있음

요금(월)무료(AWS사용요금에 포함)

$49/월

AWS 사용 요금의10%~

※기본:$100/월

AWS 사용 요금의10%~

※기본 $15,000/월

Page 64: 20150125 AWS BlackBelt - Amazon RDS (Korean)

© 2014 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.

64

Q&A