SlideShare une entreprise Scribd logo
1  sur  16
AKKA라이브러리
를 이용해 구현하는
결함 내성 FAULT TOLERANCE
ON AKKA
발렌타인 발표자료
AGENDA
Reactive Architecture
Thread model VS Actor model
Master–Worker pattern
What is Future
All For One Strategy
Fault torlen
REACTIVE ARCHITECTURE
Reactive Programming ≒ Functional Programming
Functional Programming
• 데이터 뿐만이 아니라 행위도 인자값으로 전달하는 프로그래밍 패러다임
4 Reactive Principles
• 1. Event-Driven
• 2. Scalable
• 3. Resilient (Fault Tolerance)
• 4. Responsive
부작용 없는 동시성 프로그래밍
ACTOR란?
액터는 메시지를 수신하고 그에 대한 행위를 함께
전달하는 에이전트이다. 행위의 종류에는 다음과 같은
것이있다.
• 메시지를 자신 또는 다른 액터에 전송한다.
• 액터를 생성한다.
• 다음의 행동 (replacement behavior)을 규정한다.
액터는 메시지를 수신하기 위해 하나의 사서함을
가진다. 메시지는 액터에 직접 전달되지 않고 사서함에
간접적으로 전달된다. 사서함은 버퍼링 기능이 있으나,
메시지는 FIFO로 처리되는 것은 아니다.
액터가 메시지를 받으면 일단 잠금상태가 된다. 잠기면
메시지는 처리되지 않는다. 다음 액터가 become이
되면 새로운 후계 액터가 동일한 사서함에서 메시지를
읽고 처리를 계속한다.
THE BALANCING DISPATCHER
http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2
THE SMALLEST MAILBOX ROUTER
THE MASTER AND ITS WORKERS
MASTER AND WORKERS
THE MASTER
FUTURE?
FUTURE
A Future is an object holding a value which may become available at some point.
This value is usually the result of some other computation:
1. If the computation has not yet completed, we say that the Future is not
completed.
2. If the computation has completed with a value or with an exception, we say
that the Future is completed.
Completion can take one of two forms:
1. When a Future is completed with a value, we say that the future was
successfully completed with that value.
2. When a Future is completed with an exception thrown by the computation, we
say that the Future was failed with that exception.
http://docs.scala-lang.org/overviews/core/futures.html
ONE FOR ONE AND
ALL FOR ONE STRATEGY
NORMAL FLOW http://doc.akka.io/docs/akka/snapshot/java/f
ault-tolerance-sample.html
FAILURE FLOW
SAMPLE CODE
• Master Worker model overview (Scala)
http://www.codeshare.io/MLmTt
• AllForOneStrategy (Scala)
http://www.codeshare.io/90b8v
• AKKA Fault Tolerance Sample
http://www.codeshare.io/Kzx1s(Java)

Contenu connexe

En vedette

SOSCON2015 SI이노베이션
SOSCON2015 SI이노베이션SOSCON2015 SI이노베이션
SOSCON2015 SI이노베이션DoHyun Jung
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDBMongoDB
 
Pure Function and Rx
Pure Function and RxPure Function and Rx
Pure Function and RxHyungho Ko
 
Getting started with Azure Services Platform
Getting started with Azure Services PlatformGetting started with Azure Services Platform
Getting started with Azure Services PlatformTedAhn
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습DoHyun Jung
 
Akka cluster overview at 010dev
Akka cluster overview at 010devAkka cluster overview at 010dev
Akka cluster overview at 010devRoland Kuhn
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to AkkaJohan Andrén
 
자바 전문가를 위한 스칼라 프로그래밍 언어
자바 전문가를 위한 스칼라 프로그래밍 언어자바 전문가를 위한 스칼라 프로그래밍 언어
자바 전문가를 위한 스칼라 프로그래밍 언어Jong Wook Kim
 
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다동수 장
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketKonrad Malawski
 
Scala로의 산책
Scala로의 산책Scala로의 산책
Scala로의 산책Youmi Bae
 
Microsoft azure service 소개자료
Microsoft azure service 소개자료Microsoft azure service 소개자료
Microsoft azure service 소개자료Alvin You
 
[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?NAVER D2
 
함수형 프로그래밍 언어 스칼라(Scala) 소개
함수형 프로그래밍 언어 스칼라(Scala) 소개함수형 프로그래밍 언어 스칼라(Scala) 소개
함수형 프로그래밍 언어 스칼라(Scala) 소개DongHee Kim
 
Spring Scala : 스프링이 스칼라를 만났을 때
Spring Scala : 스프링이 스칼라를 만났을 때Spring Scala : 스프링이 스칼라를 만났을 때
Spring Scala : 스프링이 스칼라를 만났을 때JeongHun Byeon
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsKonrad Malawski
 
Apache kafka intro_20150313_springloops
Apache kafka intro_20150313_springloopsApache kafka intro_20150313_springloops
Apache kafka intro_20150313_springloopsSungMin OH
 

En vedette (20)

SOSCON2015 SI이노베이션
SOSCON2015 SI이노베이션SOSCON2015 SI이노베이션
SOSCON2015 SI이노베이션
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDB
 
Pure Function and Rx
Pure Function and RxPure Function and Rx
Pure Function and Rx
 
Scala for play
Scala for playScala for play
Scala for play
 
Getting started with Azure Services Platform
Getting started with Azure Services PlatformGetting started with Azure Services Platform
Getting started with Azure Services Platform
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
Akka cluster overview at 010dev
Akka cluster overview at 010devAkka cluster overview at 010dev
Akka cluster overview at 010dev
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
Akka - A Brief Intro
Akka - A Brief IntroAkka - A Brief Intro
Akka - A Brief Intro
 
자바 전문가를 위한 스칼라 프로그래밍 언어
자바 전문가를 위한 스칼라 프로그래밍 언어자바 전문가를 위한 스칼라 프로그래밍 언어
자바 전문가를 위한 스칼라 프로그래밍 언어
 
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다
웹 애플리케이션 프레임웍의 과거,현재 그리고 미래 - 봄날은 간다
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to Socket
 
Scala로의 산책
Scala로의 산책Scala로의 산책
Scala로의 산책
 
Microsoft azure service 소개자료
Microsoft azure service 소개자료Microsoft azure service 소개자료
Microsoft azure service 소개자료
 
[H3 2012] 꽃보다 Scala
[H3 2012] 꽃보다 Scala[H3 2012] 꽃보다 Scala
[H3 2012] 꽃보다 Scala
 
[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?[2A6]web & health 2.0. 회사에서의 data science란?
[2A6]web & health 2.0. 회사에서의 data science란?
 
함수형 프로그래밍 언어 스칼라(Scala) 소개
함수형 프로그래밍 언어 스칼라(Scala) 소개함수형 프로그래밍 언어 스칼라(Scala) 소개
함수형 프로그래밍 언어 스칼라(Scala) 소개
 
Spring Scala : 스프링이 스칼라를 만났을 때
Spring Scala : 스프링이 스칼라를 만났을 때Spring Scala : 스프링이 스칼라를 만났을 때
Spring Scala : 스프링이 스칼라를 만났을 때
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka Streams
 
Apache kafka intro_20150313_springloops
Apache kafka intro_20150313_springloopsApache kafka intro_20150313_springloops
Apache kafka intro_20150313_springloops
 

Akka라이브러리를 이용해 구현하는 결함 내성 (발렌타인 발표자료)