scalable system design patterns

13
Scalable System Design Patterns 2010.12. DM 본본 본본본본본본 1

Upload: steve-min

Post on 24-May-2015

1.130 views

Category:

Technology


4 download

DESCRIPTION

Scalable system design patterns

TRANSCRIPT

Page 1: Scalable system design patterns

Scalable System Design Patterns

2010.12.DM 본부

기술개발담당

1

Page 2: Scalable system design patterns

index

1.General Principles

2.Common Techniques

3.Scalable System Design Pat-

terns

2

Page 3: Scalable system design patterns

General Principles

"Scalability" is not equivalent to "Raw Per-

formance"

Understand environmental workload condi-

tions

Understand who is your priority customers

Scale out and Not scale up

Keep your code modular and simple

Don't guess the bottleneck, Measure it

Plan for growth

3

Page 4: Scalable system design patterns

Common Techniques

Server Farm (real time access)Data PartitioningMap / Reduce (Batch Parallel Process-ing)Content Delivery Network (Static Cache)Cache Engine (Dynamic Cache)Resources PoolCalculate an approximate resultFiltering at the sourceAsynchronous ProcessingImplementation design considerations

4

Page 5: Scalable system design patterns

Scalable System Design Patterns

Load Balancer

Scatter and Gather

Result Cache

Shared Space

Pipe and Filter

Map Reduce

Bulk Synchronous Parallel

Execution Orchestrator

5

Page 6: Scalable system design patterns

Load Balancer

설명 디스패처가 매 요청마다 리퀘스트를 처리할 워커를 선택함 다른 정책에 기반한 요청을 처리할 수 있음

어플리케이션은 어떤 워커도 요청을 처리할 수 있도록 “ stateless“ 가 권장됨대부분의 대용량 웹사이트에서 사용되는 패턴메시징에서는 Point to Point 방식에 해당

6출처 : http://architects.dzone.com/news/scalable-system-design

Page 7: Scalable system design patterns

Scatter and Gather

설명 이 모델은 디스패처가 풀의 모든 워커에 요청을 multicast 함 각 워커는 로컬결과를 계산하고 디스패처로 결과를 전송함 디스패처는 클라이언트에 각 워커의 결과를 조립해서 전송함

대부분의 검색엔진에서 사용됨 ( 구글 , 야후 등 )메시징에서는 Pub-Sub 방식에 해당됨

7출처 : http://architects.dzone.com/news/scalable-system-design

Page 8: Scalable system design patterns

Result Cache

8

설명 이 모델은 디스패처가 처음에 요청이 저장됐는지 lookup 함 만약에 결과가 있는 경우에는 이전 결과를 돌려줌

캐싱 중에서는 sideline cache 에 해당함

출처 : http://architects.dzone.com/news/scalable-system-design

Page 9: Scalable system design patterns

Shared Space

이 모델은 “ Blackboard” 로 알려짐모든 워커는 shared space 에서 정보를 모니터하고 , 부분지식을 blackboard 에 돌려줌정보는 솔루션이 도착할때까지 지속적으로 풍푸해짐

이 패턴은 JavaSpace 와 GigaSpace 에서 사용됨

9출처 : http://architects.dzone.com/news/scalable-system-design

Page 10: Scalable system design patterns

Pipe and Filter

이 모델은 "Data Flow Programming“ 으로 알려져 있음모든 워커는 데이터 플로우가 흐르도록 파이프를 통해 연결되어있다 .이 패턴은 일반적인 EAI pattern 이다 .

10출처 : http://architects.dzone.com/news/scalable-system-design

Page 11: Scalable system design patterns

Map Reduce

이 모델은 디스크 IO 가 큰 병목인 경우에 사용되는 배치작업이다 .분산파일시스템에서 디스크 IO 가 병렬로 실행될 수 있다 .이 패턴은 많은 구글의 내부 어플리케이션에서 사용되고 , 하둡 프레임웍에서도 채택됨

11출처 : http://architects.dzone.com/news/scalable-system-design

Page 12: Scalable system design patterns

Bulk Synchronous Parallel

이 모델은 모든 워커에 걸쳐 lock-step 실행에 기반을 두고 마스터에 의해 조작된다 .각 워커는 종료조건에 도달할 때까지 다음 스텝을 반복한다 .

각 워커는 인풋큐로부터 데이터를 읽는다 . 각 워커는 읽은 데이터로부터 로컬 프로세싱을 수행한다 . 각 워커는 로컬 결과를 직접 연결된 곳에 푸시한다 .

구글 Pregel graph processing model 에서 사용되었고 , 아파치 하마 프로젝트에서도 사용됨

12출처 : http://architects.dzone.com/news/scalable-system-design

Page 13: Scalable system design patterns

Execution Orchestrator

설명 dependency 에 기반한 태스크 실행 각 태스크에서 워커를 호출함 오케스트레이터는 워커의 실행결과를 받아 다음 태스크를 실행함

이 모델은 intelligent scheduler 에서 사용됨 Job Scheduler BPM ESB

13출처 : http://architects.dzone.com/news/scalable-system-design