38

Î Ð È ÈÄ Ï Ê ÉÇ Ä É À · 2020-04-27 · Register Register User Service Service Service Request Request Register Register Register Query AWS Cloud Map Service Registry

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

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

디자인패턴과고객사례로살펴보는현대적어플리케이션개발

배영부

애플리케이션 아키텍트

AWS Korea

강성일

애플리케이션 아키텍트

AWS Korea

Agenda

현대적 애플리케이션 개발

현대적 애플리케이션의 디자인 패턴

디자인 패턴 별 고객 사례

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

빠른혁신은비즈니스를진화시킵니다

새로운 시장

새로운 고객 성과New economics

새로운 디지털 상품 & 서비스

경청반복

실험

Innovation

Flywheel

실험은빠른혁신엔진의동력입니다

빠른혁신의중심은디지털기술입니다.

Strategy

Culture

Technology

Talent

빠른혁신을가능하게하는모범사례

• 애플리케이션 구조화 - 마이크로서비스

• 전체 애플리케이션 생애주기에 보안 적용 - 자동화된 보안 체계

• 인프라 관리 단순화 - 서버리스 기술

• 잦은 빈도의 실험 수행 - 작고 독립적인 팀 구성

• 애플리케이션과 인프라를 빠르게 변경 - 자동화된 CI/CD

• 운영 표준화 – 코드를 사용한 애플리케이션과 인프라의 모델링

• 애플리케이션 성능 향상 - 향상된 모니터링

현대적인애플리케이션개발로빠른혁신을달성하십시오

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

• API Gateway

• Service Discovery and Service Registries

• Circuit Breaker

• Command-Query Responsibility Segregation

• Event Sourcing

• Choreography

• Log Aggregation

현대적애플리케이션구현을위한일반적인패턴

Web

Client

Mobile

Client

Service Service Service Service

Amazon API Gateway

API Gateway

Service Discovery and Service Registries

User

AWS Cloud Map

Service Service

Service Discovery and Service Registries

클라이언트의 서비스 연결에 프록시 필요

서비스 디스커버리 추상화

서비스 가용성 및 용량에 영향 받음

추가적인 지연

Server-side service discovery pattern

Request

Elastic Load Balancing

+

Service

Registry

Register

Register

User Service

Service

Service

Request Request

Register

Register

Register

Query

AWS Cloud Map

Service Registry

User Service

Service

Service

클라이언트가 서비스를 바로 연결

시스템 내 더 적은 컴포넌트 필요

클라이언트가 서비스 등록을 감지

클라이언트 사이드 로드 밸런싱

Client-side service discovery pattern

User Service BService A Circuit Breaker User Service BService A Circuit Breaker

Circuit Breaker

CQRS (Command-Query Responsibility Segregation)

처리량, 대기 시간, 일관성 요구 사항이 다른 경우

User

Service A

Data

Transfer

ObjectUpdate Query

Data

Domain

Model

ORM ORM

User

Command Service

Data

Transfer

Object

Update Query

Domain

Model

Query Service

Amazon AuroraAmazon DynamoDB AWS Lambda

Data

Transfer

Object

Data

Event Sourcing

업데이트

Amazon Kinesis AWS Lambda AWS Lambda AWS LambdaUser

State

Event

Choreography

User

AWS Lambda

Amazon Simple

Notification Service

Amazon Simple Queue

Service

Request

Service

Request

Queue

Log Aggregation

User

Service A

Service B

Service C

Service D

Service E

Amazon CloudWatch

AWS X-Ray

Aggregation Log Data

Web

ClientUser

Trace

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

AfterShipCircuit Breaker Pattern

AfterShip

SaaS 플렛폼, 이커머스 배송 추적 솔루션 제공

17개국 666개 배송 회사를 지원

Mission

99.95% SLA Up time

20,000 ~ 30,000 req/sec (성수기 기준)

https://www.youtube.com/watch?v=M-G8VdOGyzw&list=PLhr1KZpdzukdeX8mQ2qO73bg6UKQHYsHb&index=8&did=ta_card&trk=ta_card

AfterShipCircuit Breaker Pattern

APIGateway를 통한 사용자의 요청을 받아

외부 시스템과 연계한 배송정보를 제공

두 개의 AWS Lambda function과 Amazon SQS 쌍을 사용

앞의 쌍은 높은 SLA를 달성, 뒤는 3rd 파티, 외부 연계 수행

실패를 해도 재시작 할 수 있으며 서비스에는 지장 없는구조

https://www.youtube.com/watch?v=M-G8VdOGyzw&list=PLhr1KZpdzukdeX8mQ2qO73bg6UKQHYsHb&index=8&did=ta_card&trk=ta_card

AWS Cloud

API Gateway 1st Lambda

2nd Lambda

1st SQS

2nd SQS

Extern Services

Users

AfterShipCircuit Breaker Pattern

APIGateway를 통한 사용자의 요청을 받아

외부 시스템과 연계한 배송정보를 제공

두 개의 AWS Lambda function과 Amazon SQS 쌍을 사용

앞의 쌍은 높은 SLA를 달성, 뒤는 3rd 파티, 외부 연계 수행

실패를 해도 재시작 할 수 있으며 서비스에는 지장 없는구조

https://www.youtube.com/watch?v=M-G8VdOGyzw&list=PLhr1KZpdzukdeX8mQ2qO73bg6UKQHYsHb&index=8&did=ta_card&trk=ta_card

AWS Cloud

API Gateway 1st Lambda

2nd Lambda

1st SQS

2nd SQS

Extern Services

Users

ZalandoEvent Sourcing

Zalando

리테일 패션 플렛폼으로 파트너,브랜드, 고객을 연결

패션과 라이프스타일을 유럽의 17개 국가에 제공

Mission

High Scalable data processing pipeline

9명의 직원으로 모든 것을 개발/구축/운영

https://www.youtube.com/watch?v=RxAmb57NCPM&feature=youtu.be&did=ta_card&trk=ta_card

ZalandoEvent Sourcing

수 많은 내부 Micro Service로부터 이벤트를 받아

데이터 레이크를 구성

각 단계마다 Amazon S3 bucket을 구성

단계별 이벤트처리는 두 개의 SQS와 연결된 AWS Lambda function을 사용

SQS #1 : 이벤트 buffer Queue

SQS #2 : Dead Letter Queue

이벤트 처리 단계마다 Event Sourcing 을 사용,

각 단계마다 적절한 이벤트 처리에 효과적

https://www.youtube.com/watch?v=RxAmb57NCPM&feature=youtu.be&did=ta_card&trk=ta_card

NAKADI

Amazon Simple

Notification Service

AWS Lambda Amazon S3

AWS Lambda

AWS Lambda

Amazon S3

Amazon S3

Raw

Main

Internal

Micro Services

Amazon Simple Queue Service

ZalandoEvent Sourcing

수 많은 내부 Micro Service로부터 이벤트를 받아

데이터 레이크를 구성

각 단계마다 Amazon S3 bucket을 구성

단계별 이벤트처리는 두 개의 SQS와 연결된 AWS Lambda function을 사용

SQS #1 : 이벤트 buffer Queue

SQS #2 : Dead Letter Queue

이벤트 처리 단계마다 Event Sourcing 을 사용,

각 단계마다 적절한 이벤트 처리에 효과적

https://www.youtube.com/watch?v=RxAmb57NCPM&feature=youtu.be&did=ta_card&trk=ta_card

NAKADI

Amazon Simple

Notification Service

AWS Lambda Amazon S3

AWS Lambda

AWS Lambda

Amazon S3

Amazon S3

Raw

Main

Internal

Micro Services

Amazon Simple Queue Service

Healthdirect AustraliaCQRS (Command Query Request Responsibility Segregation)

https://www.youtube.com/watch?v=dy-drIboyNA&feature=youtu.be

Healthdirect Australia

호주의 국가 공공 의료 정보 서비스 제공

Mission

대량의 읽기 요청에 대한 실시간 스케일링 필요

쓰기는 대량의 읽기에 영향을 받으면 안됨.

각종 보안 규제로 25년간 데이터 보관 필요

Healthdirect AustraliaCQRS (Command Query Request Responsibility Segregation)

https://www.youtube.com/watch?v=dy-drIboyNA&feature=youtu.be

대량의 데이터 쓰기와 읽기가 동시에 수행되는

의료 정보 서비스를 제공하기 위해

읽기와 쓰기가 아키텍처적으로 완벽히 분리

APIGateway와 Static 웹서비스로 데이터 수집

EMR로 데이터를 검증/정제 후 S3에 자정

읽기를 위해 DynamoDB, 엘라스틱서치 사용

외부 서비스에서 읽이 위한 APIGatway 사용

대량의 쓰기와 읽이가 서로 영향을 주지않으면서

각 목적에 충실한 최적화된 아키텍처 구현

Amazon EMR

Amazon Kinesis

AWS Lambda

Amazon API Gateway Amazon DynamoDB

Amazon Elasticsearch

Amazon Athena

Amazon S3

Amazon S3

Amazon Kinesis

Amazon API Gateway

AWS Lambda

Write Read

Healthdirect AustraliaCQRS (Command Query Request Responsibility Segregation)

https://www.youtube.com/watch?v=dy-drIboyNA&feature=youtu.be

대량의 데이터 쓰기와 읽기가 동시에 수행되는

의료 정보 서비스를 제공하기 위해

읽기와 쓰기가 아키텍처적으로 완벽히 분리

APIGateway와 Static 웹서비스로 데이터 수집

EMR로 데이터를 검증/정제 후 S3에 자정

읽기를 위해 DynamoDB, 엘라스틱서치 사용

외부 서비스에서 읽이 위한 APIGatway 사용

대량의 쓰기와 읽이가 서로 영향을 주지않으면서

각 목적에 충실한 최적화된 아키텍처 구현

Amazon EMR

Amazon Kinesis

AWS Lambda

Amazon API Gateway Amazon DynamoDB

Amazon Elasticsearch

Amazon Athena

Amazon S3

Amazon S3

Amazon Kinesis

Amazon API Gateway

AWS Lambda

Write Read

KlapSaga / Orchestration

Klap

자동화된 비디오 편집과 스포츠용 비디오 처리서비스를 제공(프랑스) : 스포츠 베팅과 모든종류의 이벤트에 사용.

Mission

시간당 25GByte 비디오 처리

신뢰성 높은 비디오 관리에만 집중

https://www.youtube.com/watch?v=lTSZT10JMQA&feature=youtu.be&did=ta_card&trk=ta_card

KlapSaga / Orchestration

AWS Step Function을 이용한 오케이스트레이션

비디오 처리과정마다 분리된 Lambda Function

Event Sourcing Pattern 적용

ECS 클러스터를 이용한 슬로우모션 생성

EC2에서 비디오 생성 엔진 구현

최종 비디오는 스트리밍 서비스로 전송

하루 백만~5백만장의 이미지처리

저렴한 비용으로 높은 처리랑과 확장성, 가용성 확보

https://www.youtube.com/watch?v=lTSZT10JMQA&feature=youtu.be&did=ta_card&trk=ta_card

AWS Lambda

AWS Lambda

AWS LambdaAmazon S3

AWS Step Functions AWS Lambda * n

Amazon Elastic Container

ServiceAmazon EC2

Streaming

Platform

KlapSaga / Orchestration

AWS Step Function을 이용한 오케이스트레이션

비디오 처리과정마다 분리된 Lambda Function

Event Sourcing Pattern 적용

ECS 클러스터를 이용한 슬로우모션 생성

EC2에서 비디오 생성 엔진 구현

최종 비디오는 스트리밍 서비스로 전송

하루 백만~5백만장의 이미지처리

저렴한 비용으로 높은 처리랑과 확장성, 가용성 확보

https://www.youtube.com/watch?v=lTSZT10JMQA&feature=youtu.be&did=ta_card&trk=ta_card

AWS Lambda

AWS Lambda

AWS LambdaAmazon S3

AWS Step Functions AWS Lambda * n

Amazon Elastic Container

ServiceAmazon EC2

Streaming

Platform

AncestryLog Aggregation

Ancestry

DNA 검사와 가족의 족보,계보,

연결 관계 추적 서비스 제공

Mission

DNA와 연결 관계 분석을 위한

대량의 데이터 수집,저장, 분석

실시간, On-demand logging

다양한 보안 규제(Sox,PCI,HIPPA)

https://www.youtube.com/watch?v=igcnes0PI10&did=ta_card&trk=ta_card

AncestryLog Aggregation

수 천개의 EC2와 Fargate 에서 로그 생성

대량의 로그를 온-디맨드로 엘라스틱서치에 저장

클라우드와치에 저장 후 키네시스로 가져옴

Amazon S3 버킷에 순서조정, 카테고리 지정, 메타데이터를 추가해 저장, 데이터 소스 역할

각종 규제를 충족할 수 있도록 지원

Lambda로 실시간 로그, Historical Loader로시간기반 로그 로딩하여 엘라스틱서치에 저장

비용에 효과적이며 확장성이 뛰어난 아키텍처 구현https://www.youtube.com/watch?v=igcnes0PI10&did=ta_card&trk=ta_card

Historical

Loader

AWS Lambda

Amazon S3Amazon Kinesis

Amazon API

Gateway

Developers

Amazon EC2

AWS Fargate

Amazon CloudWatch Amazon Kinesis Amazon Elasticsearch

Service

AncestryLog Aggregation

수 천개의 EC2와 Fargate 에서 로그 생성

대량의 로그를 온-디맨드로 엘라스틱서치에 저장

클라우드와치에 저장 후 키네시스로 가져옴

Amazon S3 버킷에 순서조정, 카테고리 지정, 메타데이터를 추가해 저장, 데이터 소스 역할

각종 규제를 충족할 수 있도록 지원

Lambda로 실시간 로그, Historical Loader로시간기반 로그 로딩하여 엘라스틱서치에 저장

비용에 효과적이며 확장성이 뛰어난 아키텍처 구현https://www.youtube.com/watch?v=igcnes0PI10&did=ta_card&trk=ta_card

Historical

Loader

AWS Lambda

Amazon S3Amazon Kinesis

Amazon API

Gateway

Developers

Amazon EC2

AWS Fargate

Amazon CloudWatch Amazon Kinesis Amazon Elasticsearch

Service

AncestryLog Aggregation

수 천개의 EC2와 Fargate 에서 로그 생성

대량의 로그를 온-디맨드로 엘라스틱서치에 저장

클라우드와치에 저장 후 키네시스로 가져옴

Amazon S3 버킷에 순서조정, 카테고리 지정, 메타데이터를 추가해 저장, 데이터 소스 역할

각종 규제를 충족할 수 있도록 지원

Lambda로 실시간 로그, Historical Loader로시간기반 로그 로딩하여 엘라스틱서치에 저장

비용에 효과적이며 확장성이 뛰어난 아키텍처 구현https://www.youtube.com/watch?v=igcnes0PI10&did=ta_card&trk=ta_card

Historical

Loader

AWS Lambda

Amazon S3Amazon Kinesis

Amazon API

Gateway

Developers

Amazon EC2

AWS Fargate

Amazon CloudWatch Amazon Kinesis Amazon Elasticsearch

Service

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

감사합니다

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