AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

75
CloudFront와 Route53을 활용한 효율적 인 웹 서비스 구축 가이드 GS네오텍 클라우드사업팀

Transcript of AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Page 1: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront와 Route53을 활용한 효율적인 웹 서비스 구축 가이드

GS네오텍 클라우드사업팀

Page 2: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSNeotek : WiseN 소개

•  이미지캐시/스트리밍/미디어/라이브 부가 서비스, 자체 전송 플랫폼, 1TBps 백본, 24x7 NOC •  국내 최다 CDN고객 레퍼런스 확보 : 포탈, 게임, 교육, 방송, 쇼핑몰 등

CDN 전문 사업자 AWS Cloud 전문 사업자 Cloud 전문 솔루션 제공

Page 3: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

소개 순서

•  AWS 주요 서비스 Overview

•  AWS CloudFront 및 Route53 Overview

•  인프라는 어떻게 확장되는가?

•  왜 클라우드 프론트를 사용하는가?

•  CloudFront 활용 사례

•  CloudFront를 활용한 라이브 서비스

Page 4: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

AWS 주요 서비스 Overview

Page 5: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Amazon EC2 Amazon EBS

EC2 블록 스토리지 볼륨 클라우드의 가상 서버

Elastic Load Balancing

EC2 로드 분산 서비스 Amazon RDS

관계형 데이터베이스 서비스

Page 6: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

VPC

Amazon VPC

격리형 클라우드 리소스

고객이 정의하는 가상 네트워크에서 AWS 리소스를 시작할 수 있도록 Amazon Web Services(AWS) 클라우드에서 논리적이고도 격리된 공간을 프로비저닝합니다

Page 7: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

S3

Amazon S3

개발자와 IT 팀에 안전하고 내구성과 확장성이 뛰어난 객체 스토리지를 제공합니다. 

클라우드의 확장 가능한 오브젝트 스토리지

Page 8: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudWatch

AWS CloudWatch

AWS 클라우드 리소스와 AWS에서 실행되는 애플리케이션을 위한 모니터링 서비스입니다.

리소스 및 어플리케이션 모니터링

Page 9: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudTrail

AWS CloudTrail

계정에 대한 AWS API 호출을 기록하고 로그 파일을 사용자에게 전달하는 웹 서비스입니다.

사용자 활동 및 변경 사항 추적

Page 10: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

AWS CloudFront 및 Route53 Overview

Page 11: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront

CloudFront

다른 Amazon Web Services 제품과 통합하여 사용하면 개발자와 기업에서 최소 사용 약정 없이도 짧은 지연 시간 내에 빠른 데이터 전송 속도로 최종 사용자에게 쉽게 콘텐츠를 배포할 수 있습니다.

글로벌 컨텐츠 전송 네트워크 (CDN)

Page 12: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CDN

CloudFront

Route 53

Contents Delivery Network (CDN)

컨텐츠 사용자는 글로벌하게 배포된 지리적으로 가장 가까운 Edge 서버로부터 컨텐츠를 전송받습니다.

Page 13: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CDN : CloudFront

CloudFront

Amazon EC2

Amazon EC2

100ms

10ms

•  자주 쓰는 데이터를 저장 •  통신 경로 최적화

Page 14: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CDN : CloudFront : 편의점

Page 15: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CDN : CloudFront

CloudFront Amazon EC2

•  사용자가 많이 드나드는 입지에, •  자주 오는 사용자의 기호에 맞춰, •  인기 좋은 물건을, •  신속하고 편리하게 제공합니다

Page 16: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront – Global Edge Location

Page 17: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 엣지 서버

Seoul : 2 Edges Global : 53 Edges

Page 18: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : WiseN Multi-Cross CDN

53(Seoul 2) CloudFront Edges +

10 WiseN Edges

+

Page 19: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront

•  정적/동적 컨텐츠 가속 서비스 •  HTTP/HTTPS 서비스, Custom SSL 지원 •  커스텀 오류 응답 •  쿠키/헤더 오리진 서버 전달 •  다양한 통계 보고서 •  컨텐츠 보안 : Signed URL, Signed Cookie •  API 호출 감사 : CloudTrail 연계 •  업로드 가속

CloudFront

Page 20: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53

Amazon Route 53

가용성과 확장성이 우수한 클라우드 DNS(도메인 이름 시스템) 웹 서비스입니다.

글로벌 DNS

Page 21: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSLB

Amazon Route 53

서버와 네트워크 장비들의 상태 및 성능 정보를 체크하며 동적으로 사용자에게 노출될 DNS 레코드 타입과 값을 조정합니다.

Global Server Load Balancer(GSLB)

Page 22: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSLB : Route53

Amazon Route 53

ISP DNS

Amazon EC2

Amazon EC2

1

2 1 1

Page 23: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53 : 서버 상태 체크기반

Amazon Route 53

Amazon EC2 Amazon EC2

OK FAIL

Page 24: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53 : 레이턴시 기반

Amazon Route 53

Amazon EC2 Amazon EC2

100ms 10ms

Page 25: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53 : 가중치 기반

Amazon Route 53

Amazon EC2 Amazon EC2

99% 1%

Page 26: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53 : 지역 기반

Amazon Route 53

Amazon EC2 Amazon EC2

미국 한국

Page 27: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

Route53 : Region, ELB

Amazon Route 53

Elastic Load Balancing

Elastic Load Balancing

Tokyo Singapore

Page 28: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

WiseN 브로슈어

Page 29: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

서비스 인프라는 어떻게 확장되는가?

Page 30: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

첫 단계

WEB/WAS/DB

www.example.com

Page 31: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

첫 단계 : On-Premise vs. AWS

•  On premise •  AWS

EIP

WEB/DB

Route53

WEB/DB

EC2

Page 32: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

두번째 단계

WEB WEB

DB

Round-Robin, Fail-Over 불가

Page 33: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

두번째 단계 : On-Premise vs. AWS

•  On premise •  AWS

Route53

WEB WEB

DB AZ-a

DB(S) Multi-AZ

WEB WEB

DB(M) Multi-AZ

AZ-b

EC2 EC2

Weight, Auto Fail-over

Page 34: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

세번째 단계

L4

WEB WEB

DB DB

Page 35: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

세번째 단계 : On-Premise vs. AWS

•  On premise •  AWS

Route53

L4

WEB WEB

DB

ELB

AZ-a

DRDS(S) Multi-AZ

WEB WEB

RDS(M) Multi-AZ

AZ-b

EC2 EC2

Page 36: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

•  컨텐츠 전송은? •  글로벌 배포는? •  Disk확장은? •  Storage는? •  L4 확장은? •  장애복구는? •  재해복구는? •  시스템 구매는? •  (……)

인프라 구성이 점점 복잡해지는 단계

Page 37: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

네번째-1 단계 : AWS

AZ-a

WEB/WAS

Route53

ELB

S3 EC2 EC2

WEB/WAS

AZ-b

Static Contents

Page 38: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

네번째-2 단계 : AWS

AZ-a

WEB/WAS

Route53

ELB

S3 EC2 EC2

WEB/WAS

AZ-b

Static Contents

CloudFront

Page 39: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

네번째-3 단계 : AWS

AZ-a

WEB/WAS

Route53

ELB

S3 EC2 EC2

WEB/WAS

AZ-b

Static Contents

CloudFront

Dynamic Contents

Page 40: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

네번째-4 단계 : AWS

Route53

ELB ELB

Tokyo Singapore

Global Users

CloudFront

Page 41: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

왜 클라우드프론트인가?

Page 42: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

성능 비용 편의성

Page 43: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 성능

도메인 룩업 서버 커넥션 첫 바이트 전송 데이터 전송

도메인 룩업

서버 커넥션

첫 바이트 전송 데이터 전송

파일 다운로드

Page 44: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 비용

CloudFront

Amazon EC2

과금 0$ 사용자 트래픽/리퀘스트만 과금

Page 45: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 편의성

CloudFront

원본 서버 설정

캐시 정책 설정

Page 46: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront/Route53 활용 사례

Page 47: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront/Route53 : Best Practice

AZ-a AZ-b

WEB

Route53

ELB : HTTP

S3

DB(M) Multi-AZ

DB(S) Multi-AZ

WEB

(Static, CSS/JS/PNG/…) (Dynamic, JSP/ASP/…)

Cloudfront : SSL Termination + Signed URL

EC2 EC2

AZ-a

ELB : HTTP

DB(S) Multi-AZ

EC2 EC2

(Dynamic, 썸네일/이미지 리사이징/…)

DR, 해외 Region

TTL=0 TTL=1+ TTL=1+

Page 48: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 3법칙

•  이미지와 같은 정적 컨텐츠는 클라우드 프론트에 오래도록 캐시를 합니다.

•  웹페이지와 같은 동적 컨텐츠는 클라우드 프론트의 전송 최적화 기능을 활용합니다.

•  썸네일 이미지같은 재사용 가능한 동적 컨텐츠는 클라우드 프론트의 캐시 기능을 활용하여 원본 부하를 절감합니다.

Page 49: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 정적 및 동적 컨텐츠 가속

CloudFront 정적 가속 = 동적 가속 = 동일 비용

Page 50: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : SSL 사용 사례

CloudFront

Amazon CloudFront

S3 Bucket HTTP

HTTPS EC2

Origin

https://ssl.mydomain.com

커스텀 SSL 인증서

Amazon IAM

손쉬운 SSL 적용 = 손쉽게 보안 강화

Page 51: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : Signed URL (+Signed Cookies)

CloudFront

Amazon CloudFront

S3 Bucket HTTP

EC2

Origin

Signed URL

URL 인증

•  Restrict Bucket Access : Yes •  Restrict Viewer Access : Yes •  Trusted Signers : Accounts

•  Policy •  Signature •  Key-Pair-Id

컨텐츠 보호

Page 52: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : GZIP 압축

CloudFront

Amazon CloudFront

S3 Bucket HTTP

EC2

Content-Encoding : gzip

Accept-Encoding : gzip

Header 포워딩

압축 = 트래픽 절감 = 비용 절감

Page 53: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 에러코드 커스터마이징

CloudFront

Amazon CloudFront

S3 Bucket HTTP

EC2

Origin

200 : OK

에러코드 커스터마이징

403 : Forbidden

HTTP Error Code TTL Path Response Code 403: Forbidden 300 /login.php 200: OK 404: Not Found 300 /404.html 404: Not Found

404 : Not Found 404 : 404.html

사용자 경험성 확대

Page 54: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : 업로드 가속

CloudFront

Amazon CloudFront

S3 Bucket HTTP

EC2

Origin

PUT/POST Method

업로드 가속

쓰기

서비스 효율 개선

Page 55: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront : CORS (Cross-Origin Resource Sharing)

CloudFront

Amazon CloudFront

S3 Bucket HTTP

EC2

Origin

www.example.com/ex1

원본 리소스 쉐어링

www.example.com/ex2

www.example1.com

www.example2.com

인프라 구조 개선 = 효율적 서비스 운영

Page 56: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront/Route53 고객 사례

Page 57: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

User

External App

domain.com : ALIAS

CloudFront

웹서버

사용자 데이터 가공

사용자 정보 DB 메인 DB 앱 정보 DB

WAS 앱 데이터 가공

API CALL

CloudFront : WEB/API 통합 서비스 플랫폼 SSL

Route53

ELB

ELB

ELB

Page 58: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

인코딩 운영실

방송 소스

Live Media Encoder

미디어 컨텐츠 원본

GSCLIP 업로드 가속 Gateway

SQS Elastic Encoder

Glacier (장기보관)

GSCLIP Media Gateway

CloudFront : HLS 스트리밍 서비스

CloudFront

CloudFront

SQS S3 S3

Route53

+ Signed URL : URL 보안 + Signed Cookie : 컨텐츠 보안

Page 59: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)
Page 60: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : 빌링 포탈

Page 61: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

빌링 포탈 : 클라우드 프론트 사용량

Page 62: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : 모니터링 포탈

Page 63: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : 클라우드 프론트 로그 분석

Page 64: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : CloudTrail 분석

Page 65: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : CloudFront 로그 분석 구성도 AMI 제공

csv

geoip

mutate

date

CloudFront Amazon S3

users

필터

input output :9200,9300

:5601 :80

Logstash 1.4.2 + ElasticSearch 1.5.1 + Kibana 4.0.2

Page 66: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

API Action Scheduler : GIFT

GIFT

SQS

… …

③ Event

② Polling

3rd

① Schedule

Page 67: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : 현황 대시보드

Page 68: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

GSCLIP : 현황 대시보드 : 클라우드프론트

Page 69: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

WiseN CDN 부가 상품

•  인코딩 서비스 •  트랜스코딩 서비스 •  미디어 게이트웨이 서비스 •  플레이어 •  대용량 게임 다운로더 •  컨텐츠 관리 서비스 •  인증 및 DRM

•  레포팅 서비스

•  현황 관리 서비스

Page 70: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

CloudFront와 Route53을 활용한 라이브 시연 (GSNeotek WiseN Booth)

Page 71: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

라이브 시연 구성도 : AWS Hackathon 참여 DRONE

Amazon EC2 (GS CLIP Media Gateway)

CloudFront Player

PC

Wifi

Public망

Public Internet망 Global Internet망

Encoder Drone (Camera)

GS CLIP Media Gateway : Live 및 VOD 컨텐츠 실시간 HLS Packetizer

Page 72: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

아키텍쳐 : Service

Page 73: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

아키텍쳐 : Media

Page 74: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)
Page 75: AWS Summit Seoul 2015 -CloudFront와 Route53 기반 콘텐츠 배포 전략 (GS네오텍-박정수)

SEOUL