micro service architecture(msa) 탐방기

58

Upload: jbugkorea

Post on 18-Jul-2015

210 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Micro Service Architecture(MSA) 탐방기
Page 2: Micro Service Architecture(MSA) 탐방기
Page 3: Micro Service Architecture(MSA) 탐방기

Micro Service Architecture적용하고 고생해 보니 이런 것들이 중요하더라

Page 4: Micro Service Architecture(MSA) 탐방기

Agenda

MSA

Page 5: Micro Service Architecture(MSA) 탐방기

왜? MSA에관심을가지시나요?

Page 6: Micro Service Architecture(MSA) 탐방기

Micro Services ArchitectureGoogle Trend

혹시뒤쳐질까두려워서?

고민하던문제를해결할수있지않을까?

Page 7: Micro Service Architecture(MSA) 탐방기

Micro Service Architecture?

빨리개발하고, 빨리적용하여Time to Market 을달성하게할수있도록소프트웨어의구조를단순하게하는방법중하나

Page 8: Micro Service Architecture(MSA) 탐방기

Micro Service Architecture?

작은기능요소들을서비스단위로묶어서배포

Page 9: Micro Service Architecture(MSA) 탐방기

MSA 의 9가지 특징

• Componentization via Services

• Organized around Business Capabilities

• Products not Projects

• Smart endpoints and dumb pipes

• Decentralized Governance

• Decentralized Data Management

• Infrastructure Automation

• Design for failure

• Evolutionary Design

Page 10: Micro Service Architecture(MSA) 탐방기

MSA 의 9가지 특징

• Componentization via Services

• Organized around Business Capabilities

• Products not Projects

• Smart endpoints and dumb pipes

• Decentralized Governance

• Decentralized Data Management

• Infrastructure Automation

• Design for failure

• Evolutionary Design

대형시스템을개발할때기술적계층에따라조직을구성하는

것에비해,

MSA에서의접근방식은“비즈니스수행능력”에따라구분된

서비스단위로조직을구성함

Page 11: Micro Service Architecture(MSA) 탐방기

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy

of the organization's communication structure.

-- Melvyn Conway, 1967

Page 12: Micro Service Architecture(MSA) 탐방기

분업화를통한전문화

재사용을통한생산성향상

기업의본원적인2대활동원칙!

Page 13: Micro Service Architecture(MSA) 탐방기

비즈니스환경변화에능동적으로대응하기위해

Page 14: Micro Service Architecture(MSA) 탐방기
Page 15: Micro Service Architecture(MSA) 탐방기

진짜 귀한 몸

OracleDBA님들

Page 16: Micro Service Architecture(MSA) 탐방기
Page 17: Micro Service Architecture(MSA) 탐방기

각서비스팀에기술구조를선택하고결정할수있는

권한이있어야함

Page 18: Micro Service Architecture(MSA) 탐방기

MSA 의 9가지 특징

• Componentization via Services

• Organized around Business Capabilities

• Products not Projects

• Smart endpoints and dumb pipes

• Decentralized Governance

• Decentralized Data Management

• Infrastructure Automation

• Design for failure

• Evolutionary Design

단일플랫폼에의한표준화를통한중앙통제모델이아닌,

각서비스팀에서독자적인거버넌스를수행하도록함

Page 19: Micro Service Architecture(MSA) 탐방기

단일플랫폼에의한표준화를통해전문성을확보하고

“사람"에의의존성을제거

Monolithic Architecture 의장점

모니터링이쉽다

SPOF

Page 20: Micro Service Architecture(MSA) 탐방기

Polyglot or Multilingual

각서비스파트에서제공하는서비스와제일잘어울리는언어를선택해서사용

Page 21: Micro Service Architecture(MSA) 탐방기

다른언어도자바만큼잘할수있는사람

Page 22: Micro Service Architecture(MSA) 탐방기

SI 환경에서고객님으로부터이모든권한을부여받을수있을까?

Page 23: Micro Service Architecture(MSA) 탐방기
Page 24: Micro Service Architecture(MSA) 탐방기
Page 25: Micro Service Architecture(MSA) 탐방기

http://deanwampler.github.io/polyglotprogramming/papers/PolyglotPolyParadigm.pdf

Page 26: Micro Service Architecture(MSA) 탐방기

Any JVM language can be supported so each team can use the

language best suited to them.

The Groovy JVM language was chosen as our first supported

language. The existence of first-class functions (closures),

list/dictionary syntax, performance and debugability were all aspects

of our decision. Moreover, Groovy provides syntax comfortable to a

wide range of developers, which helps to reduce the learning curve for

the first language on the platform.

Page 27: Micro Service Architecture(MSA) 탐방기

MSA 의 9가지 특징

• Componentization via Services

• Organized around Business Capabilities

• Products not Projects

• Smart endpoints and dumb pipes

• Decentralized Governance

• Decentralized Data Management

• Infrastructure Automation

• Design for failure

• Evolutionary Design

각서비스영역에서자신이제공하는서비스의 context에

따라도메인영역을분리(논리적분리)하고,

데이터의성격에맞는적정한 DB를선택함(물리적분리)

Page 28: Micro Service Architecture(MSA) 탐방기
Page 29: Micro Service Architecture(MSA) 탐방기

Domain Driven Design – Bounded Context

Page 30: Micro Service Architecture(MSA) 탐방기
Page 31: Micro Service Architecture(MSA) 탐방기

회원은주소를여러개가질수있고,

주소가같은다른회원이존재할수있으므로주소는회원의부가정보다.(도메인핵심정보가

회원 주소 배송

Page 32: Micro Service Architecture(MSA) 탐방기

하나의배송정보는반드시하나의주소를가져야배송한건에여러개의주소를가질수없음.

배송은주소로식별이가능한도메인핵심정보

회원 주소 배송

Page 33: Micro Service Architecture(MSA) 탐방기

회원의주소가변경된다면회원정보는즉시반영(FK)되어야하지만과거배송이력정보가변경이되면안됨

Page 34: Micro Service Architecture(MSA) 탐방기
Page 35: Micro Service Architecture(MSA) 탐방기

상품 주문배송

- 재고 - 결제

결제가실패하면재고가하나줄어들었던 transaction을 rollback 해야하는데

Page 36: Micro Service Architecture(MSA) 탐방기

서비스간트랜잭션처리

• 서비스 context 의 영역을 아주 잘 정의 해서 사용한다

• XA를 사용한다

• compensation transaction 을 사용한다

Page 37: Micro Service Architecture(MSA) 탐방기

문을열고, 코끼리를넣고, 문을닫는다

코끼리보다큰냉장고를만들어서코끼리를넣는다

코끼리를미분해서냉장고에넣고, 냉장고속에서적분한다

Page 38: Micro Service Architecture(MSA) 탐방기
Page 39: Micro Service Architecture(MSA) 탐방기

실패를통해서경험을축적해나가야하는데,

어느정도의사소한장애를감수하더라도,

지속적으로시스템을개선해나갈수있는권한을보장받는것이사실상불가능

Page 40: Micro Service Architecture(MSA) 탐방기

서비스간트랜잭션처리

• 서비스 context 의 영역을 아주 잘 정의 해서 사용한다

• XA를 사용한다

• compensation transaction 을 사용

API 를조합하는주체는어디?

Page 41: Micro Service Architecture(MSA) 탐방기

MSA 는서비스간의협조를중요하게생각합니다.

M.F 는여러개의간단한기능(function)이모여하나의서비스를구성한다고여러개의기능을모으는녀석을따로모아추상화를할수있다면밖에서보이는그림은아주깔끔한모습이될수있습니다.

성능

SPOF

복잡성증가

Page 42: Micro Service Architecture(MSA) 탐방기

복잡함을해결하기위해시작했는데, 왠지더복잡해지는것같다!!

Page 43: Micro Service Architecture(MSA) 탐방기
Page 44: Micro Service Architecture(MSA) 탐방기

Trade off

Page 45: Micro Service Architecture(MSA) 탐방기

모니터링

Governing

추상화성능

복잡도증가

SPOF

Scale코드중복방지

Fault Tolerance Layer

Page 46: Micro Service Architecture(MSA) 탐방기

https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance

API 의버전관리, 로드밸런싱, 서비스 repository에대한고민은Netflix의 Eureka 가좋은해답이될수있습니다.

Page 47: Micro Service Architecture(MSA) 탐방기

MSA 의 9가지 특징

• Componentization via Services

• Organized around Business Capabilities

• Products not Projects

• Smart endpoints and dumb pipes

• Decentralized Governance

• Decentralized Data Management

• Infrastructure Automation

• Design for failure

• Evolutionary Design

장애없는시스템은없다!

Page 48: Micro Service Architecture(MSA) 탐방기
Page 49: Micro Service Architecture(MSA) 탐방기
Page 50: Micro Service Architecture(MSA) 탐방기
Page 51: Micro Service Architecture(MSA) 탐방기
Page 52: Micro Service Architecture(MSA) 탐방기
Page 53: Micro Service Architecture(MSA) 탐방기
Page 54: Micro Service Architecture(MSA) 탐방기

http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html

Page 55: Micro Service Architecture(MSA) 탐방기

Email Notifiyer

SMS Notifiyer

Page 56: Micro Service Architecture(MSA) 탐방기
Page 57: Micro Service Architecture(MSA) 탐방기

참고한자료

• http://martinfowler.com/articles/microservices.html

• http://techblog.netflix.com/

• https://github.com/Netflix/Hystrix/wiki

• https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance

• http://deanwampler.github.io/

• http://bcho.tistory.com/

• Domain Driven Design

Page 58: Micro Service Architecture(MSA) 탐방기

질문은받지않으렵니다.

굳이하신다면…..