jbug 발표 msa탐방기_공유자료

59
Micro Service Architecture 탐방기 이용희 https ://www.facebook.com/yonghee.lee.90

Upload: jbugkorea

Post on 18-Jul-2015

78 views

Category:

Documents


0 download

TRANSCRIPT

Micro Service Architecture 탐방기이용희

https://www.facebook.com/yonghee.lee.90

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

Agenda

MSA

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

Micro Services ArchitectureGoogle Trend

혹시뒤쳐질까두려워서?

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

Micro Service Architecture?

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

Micro Service Architecture?

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

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 의 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에서의접근방식은“비즈니스수행능력”에따라구분된

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

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

분업화를통한전문화

재사용을통한생산성향상

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

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

진짜 귀한 몸

OracleDBA님들

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

권한이있어야함

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

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

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

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

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

Monolithic Architecture 의장점

모니터링이쉽다

SPOF

Polyglot or Multilingual

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

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

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

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

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.

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를선택함(물리적분리)

Domain Driven Design – Bounded Context

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

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

회원 주소 배송

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

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

회원 주소 배송

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

상품 주문배송

- 재고 - 결제

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

서비스간트랜잭션처리

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

• XA를 사용한다

• compensation transaction 을 사용한다

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

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

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

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

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

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

서비스간트랜잭션처리

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

• XA를 사용한다

• compensation transaction 을 사용

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

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

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

성능

SPOF

복잡성증가

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

Trade off

모니터링

Governing

추상화성능

복잡도증가

SPOF

Scale코드중복방지

Fault Tolerance Layer

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

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

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

장애없는시스템은없다!

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

Email Notifiyer

SMS Notifiyer

참고한자료

• 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

질문은받지않으렵니다.

굳이하신다면…..