SlideShare a Scribd company logo
Akka.NET 을 이용한
더 단순한 Fault Tolerance 소프트웨어
고형호
hyungho.ko@gmail.com
12/05/2015
http://www.slideshare.net/HyungHoKo/
1. 장애 허용 시스템
2. 아키텍처 방향
3. 예외 처리 방향
4. 장애 돌파 기대효과
5. 사례
6. 참고 자료
https://en.wikipedia.org/wiki/Actor_model
We believe that writing
correct concurrent & distributed,
resilient and
elastic applications
is too hard.
Most of the time
it's because we are using
the wrong tools and
the wrong level of abstraction.
https://github.com/akka/akka
유연성(Resilient)
고장이 일어나도 시스템 전체는 계속 반응하는 것
1. 장애 허용 시스템
로그
시스템을 구성하는 부품의 일부에서
1 + 6 = 7
소프트웨어
결함(Fault) 또는 고장(Failure)이 발생하여도
정상적 혹은 부분적으로 기능을 수행할 수 있는 시스템이다.
장애
https://ko.wikipedia.org/wiki/장애 _허용_시스템
객체
1 + 6 = 7
로그
1 + 6 = 2015
원인 파악 불가
1 + 6 = 7
10분
1 + 6 = 7
랜덤
1 + 6 = 2015
1 + 6 = 7
소스 불 일지
int float
1 + 6 =
DLL 불 일지 미적용
호출 안됨
1 + 6 =
?분
null + 6 =
처리하지 않은 예외
1 + 6 =
메모리 예외
프로그램 종료
프로그램 종료
프로그램 종료
원하는
종료
원하지 않는
종료
…
…
예외
예외
…
장애
http://www.flaticon.com/
장애
(프로그램 종료)
…
http://www.flaticon.com/
2. 아키텍처 방향
How Higher level of Abstraction
To make a shortened form of a thing by separating out what is important.
중요한 부분만을 분리하여 간결하게 만드는 것.
제거
(Eliminating)
단순
(Simple)
...
Vs.
...
입력 출력프로세스
Vs.
입력 출력프로세스
Garbage in Garbage out
장애
개선A
...
개선B
개선C
돌파
시간
속도
쉬운
쉬움을 단순한 것으로 착각한다.
Why?
훈련  친숙함(Familiarity)
단순한
(Simple)
그 안에 여러 가지를 분리해 내서 하나의 것으로 다룰 수 있게 하는 것
반대말
복잡한
(Complex)
그 안에 여러 가지가 섞여 있는 것(여러 가지를 같이 엮는 것)
어려운
(Difficult)
그것을 얻는데 에너지가 많이 드는 것
쉬운
(Easy)
그것을 얻는데 에너지가 덜 드는 것(가까이에 놓인 것)
반대말
쉬움은
복잡성을 가리고 진실을 덮는다.
단순한
생산성
(Productivity)
복잡성
(Complexity)
시간
강도
http://www.techsuda.com/archives/2362
최대한 단순하게 만들되,
(그 물체나 현상이 가지고 있는 실제의 본질이나 원리보다는)
더 단순하게 만들지 말라.
문제
프로그램
종료
추상화
돌파
방향 ?
시간
동시 부분
순차 부분
C=1 C=2 C=4 C=8
코어 개수
성능 개선
동시 부분
…
C=∞
직접 간접
동기
비동기
순차
동시
Vs.
문제
비동기
동시
간접
프로그램
종료
추상화
돌파
방향
3. 예외 처리 방향
Customer
Coffee
Machine
Insert coins
Gets coffee
Add more coins
http://www.slideshare.net/jboner/go-reactive-42084559
Customer
Coffee
Machine
Insert coins
Out of coffee beans error
Wrong
http://www.slideshare.net/jboner/go-reactive-42084559
Service
Guy
Customer
Coffee
Machine
Insert coins
Gets coffee
Adds
more beans
Add more coins
Out of
coffee beans
error
책임
http://www.slideshare.net/jboner/go-reactive-42084559
Client Service
Request
Response
Manages
Failure
Validation Error
Supervisor
트리
http://www.slideshare.net/jboner/go-reactive-42084559
Application
Error
책임
문제
간접
비동기
동시
책임
트리
프로그램
종료
추상화
해결
적용
돌파
방향
입력 출력프로세스
Garbage in Garbage out
One for One All for One
parent
child1 child2
Exception
Stop
Exception
Message
parent
child1 child2
Stop
Exception
Exception
Message
Stop
Restart
Resume
Escalate
예외 복구
= Crash Safely
= Recover Fast
4. 장애 돌파 기대효과
…
장애
(프로그램 종료)
http://www.flaticon.com/
…
Akka장애
(프로그램 종료)
http://www.flaticon.com/
Akka장애
(프로그램 종료)
http://www.flaticon.com/
Akka장애
(프로그램 종료)
http://www.flaticon.com/
Akka장애
(프로그램 종료)
http://www.flaticon.com/
Garbage in Garbage out
Let it crash!
5. 사례
UnhandledExcepCalc
UnhandledExcepCalcWithPersist
OutOfMemoryExcepCalc
OutOfMemoryExcepCalcWithGC
NotRespondingCalcWithTimeout
NotRespondingCalc
UnhandledExcepCalc OutOfMemoryExcepCalc NotRespondingCalc
Calc
Exception
Exception
Message
Stop
UnhandledExcepCalc OutOfMemoryExcepCalc NotRespondingCalc
Calc
Exception
Exception
Message
Stop
Actor
Children
SupervisorStrategy
State
Behavior
Mailbox 1 2 3 4 5
비동기
IActorRefTransportTransport
간접
동시
1. 살아 있니?
(다른 스레드)
2. 예외/예외 복구
3. 아직도 살아 있니?
Restart
3. 예외/예외 복구
5. 아직도 살아 있니?
2. Count / (1 or 0)1. 살아 있니?
(다른 스레드)
4. 복원6. 복원된 메시지 확인
Restart
Stop, Shutdown, PoisonPill, Kill
ActorPath
Empty path
Actor
Instance
Actor incarnation
ActorOf( … )
Resume
New
Instance
 new instance replaces old
Restart
IActorRef
ActorSelection
 Constructor
 PreStart()
 PostRestart()
 PreRestart() 1
 PostStop() 2
6
3
5
4
Keep going!
Stop
생애
1. 살아 있니?
(다른 스레드)
2. 예외/예외 복구
3. 아직도 살아 있니?
Restart
OutOfMemoryException
1. 살아 있니?
(다른 스레드)
2. 예외/예외 복구
3. 아직도 살아 있니?
GC
Restart
OutOfMemoryException
PostRestart 메소드에서 GC 호출
Start
Supervisor
Ready
상태
Child
Parent
Exception
사용자
정의
Cancel
Finished
Timeout
…
Working
상태
1. 살아 있니?
(다른 스레드)
2. 시작 메시지 3. 작업 중
4. 취소 메시지
5. 아직도 살아 있니?
1. 살아 있니?
(다른 스레드)
2. 시작 메시지 3. 작업 중
4. Timeout 예외/예외 복구 5. 아직도 살아 있니?
Restart
6. 참고 자료
http://getakka.net/http://akka.io/
http://letitcrash.com/ https://petabridge.com/blog/
Akka.NETAkka
https://www.youtube.com/playlist?list=PLVsNizTWUw7EH7R0gP6qyc4p-vOc6jvJq
임백준의 Akka 시작하기 동영상
임백준의 Akka 시작하기 eBook
http://www.hanbit.co.kr/ebook/look.html?isbn=9788968487897
http://www.slideshare.net/jboner
Jonas Bonér SlideShare
Akka
Akka Blog
Akka.NET
Akka.NET Blog
https://www.youtube.com/channel/UC6sEBl_3Enes2k0FZKzFkoA
Akka.NET Youtube
https://www.youtube.com/watch?v=DeiKrdbNl68
SpringCamp2013 이장원 - Akka 소개 및 Redis를 활용한 Pub/Sub 시스템 구현 동영상

More Related Content

PPTX
잘 알려지지 않은 이클립스 팁
PDF
Pure Function and Rx
PDF
Pure Function and Honest Design
PDF
[D2 오픈세미나]3.web view hybridapp
PPTX
N02 app engineseminar
PPTX
Spring boot DI
PDF
deview2014
PDF
[1A4]자바스크립트 라이브러리 개발 운영 경험기
잘 알려지지 않은 이클립스 팁
Pure Function and Rx
Pure Function and Honest Design
[D2 오픈세미나]3.web view hybridapp
N02 app engineseminar
Spring boot DI
deview2014
[1A4]자바스크립트 라이브러리 개발 운영 경험기

Similar to Akka Fault Tolerance (20)

PDF
Spring Cloud Workshop
PDF
모바일 앱(App) 개발 테스트 솔루션 v20160415
PPTX
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
PDF
201702-Oracle Container Cloud Service
PDF
Oracle Container Cloud Service & Docker Overview
PPT
sap Error Report
PDF
Service Worker 를 이용한 
Offline Web Application 구현
PDF
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
PDF
10만 라인, 26280시간의 이야기
PDF
okspring3x
PPTX
Vert.x 세미나 이지원_배포용
PPTX
[코세나, kosena] API 통합 워크 플로우 자동화 도구인 n8n.io 제품 소개 자료입니다.
PDF
Lossless Stream Processing SKT
PDF
웹서버 부하테스트 실전 노하우
PDF
실전 서버 부하테스트 노하우
PDF
Node.js 시작하기
PPTX
구글앱엔진 스터디
PDF
Talk it zerto_청담정보기술(20160706)
PPTX
[H3 2012] 행복한 개발을 위한 테스트 케이스
PPTX
행복한 개발을 위한_테스트_케이스
Spring Cloud Workshop
모바일 앱(App) 개발 테스트 솔루션 v20160415
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
201702-Oracle Container Cloud Service
Oracle Container Cloud Service & Docker Overview
sap Error Report
Service Worker 를 이용한 
Offline Web Application 구현
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
10만 라인, 26280시간의 이야기
okspring3x
Vert.x 세미나 이지원_배포용
[코세나, kosena] API 통합 워크 플로우 자동화 도구인 n8n.io 제품 소개 자료입니다.
Lossless Stream Processing SKT
웹서버 부하테스트 실전 노하우
실전 서버 부하테스트 노하우
Node.js 시작하기
구글앱엔진 스터디
Talk it zerto_청담정보기술(20160706)
[H3 2012] 행복한 개발을 위한 테스트 케이스
행복한 개발을 위한_테스트_케이스
Ad

Akka Fault Tolerance