SlideShare a Scribd company logo
1 of 45
Download to read offline
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

Similar to Akka Fault Tolerance

Spring Cloud Workshop
Spring Cloud WorkshopSpring Cloud Workshop
Spring Cloud WorkshopYongSung Yoon
 
모바일 앱(App) 개발 테스트 솔루션 v20160415
모바일 앱(App) 개발 테스트 솔루션 v20160415모바일 앱(App) 개발 테스트 솔루션 v20160415
모바일 앱(App) 개발 테스트 솔루션 v20160415SeungBeom Ha
 
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장Osc Osc
 
Oracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker OverviewOracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker OverviewTaewan Kim
 
sap Error Report
sap Error Report sap Error Report
sap Error Report jung_se_hun
 
Service Worker 를 이용한 
Offline Web Application 구현
Service Worker 를 이용한 
Offline Web Application 구현Service Worker 를 이용한 
Offline Web Application 구현
Service Worker 를 이용한 
Offline Web Application 구현병태 정
 
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여Kwangsung Ha
 
10만 라인, 26280시간의 이야기
10만 라인, 26280시간의 이야기10만 라인, 26280시간의 이야기
10만 라인, 26280시간의 이야기Minyoung Jeong
 
Vert.x 세미나 이지원_배포용
Vert.x 세미나 이지원_배포용Vert.x 세미나 이지원_배포용
Vert.x 세미나 이지원_배포용지원 이
 
Lossless Stream Processing SKT
Lossless Stream Processing  SKTLossless Stream Processing  SKT
Lossless Stream Processing SKTTaewook Eom
 
웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우IMQA
 
실전 서버 부하테스트 노하우
실전 서버 부하테스트 노하우 실전 서버 부하테스트 노하우
실전 서버 부하테스트 노하우 YoungSu Son
 
Node.js 시작하기
Node.js 시작하기Node.js 시작하기
Node.js 시작하기Huey Park
 
구글앱엔진 스터디
구글앱엔진 스터디구글앱엔진 스터디
구글앱엔진 스터디소라 정
 
Talk it zerto_청담정보기술(20160706)
Talk it zerto_청담정보기술(20160706)Talk it zerto_청담정보기술(20160706)
Talk it zerto_청담정보기술(20160706)영철 현
 
행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스도형 임
 
[H3 2012] 행복한 개발을 위한 테스트 케이스
[H3 2012] 행복한 개발을 위한 테스트 케이스[H3 2012] 행복한 개발을 위한 테스트 케이스
[H3 2012] 행복한 개발을 위한 테스트 케이스KTH, 케이티하이텔
 
ecdevday3 효율적인 유지보수를 위한 개발 및 관리
ecdevday3 효율적인 유지보수를 위한 개발 및 관리ecdevday3 효율적인 유지보수를 위한 개발 및 관리
ecdevday3 효율적인 유지보수를 위한 개발 및 관리Kenu, GwangNam Heo
 

Similar to Akka Fault Tolerance (20)

Spring Cloud Workshop
Spring Cloud WorkshopSpring Cloud Workshop
Spring Cloud Workshop
 
모바일 앱(App) 개발 테스트 솔루션 v20160415
모바일 앱(App) 개발 테스트 솔루션 v20160415모바일 앱(App) 개발 테스트 솔루션 v20160415
모바일 앱(App) 개발 테스트 솔루션 v20160415
 
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장
 
Oracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker OverviewOracle Container Cloud Service & Docker Overview
Oracle Container Cloud Service & Docker Overview
 
201702-Oracle Container Cloud Service
201702-Oracle Container Cloud Service201702-Oracle Container Cloud Service
201702-Oracle Container Cloud Service
 
sap Error Report
sap Error Report sap Error Report
sap Error Report
 
Service Worker 를 이용한 
Offline Web Application 구현
Service Worker 를 이용한 
Offline Web Application 구현Service Worker 를 이용한 
Offline Web Application 구현
Service Worker 를 이용한 
Offline Web Application 구현
 
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
[강연] 학생에서 현업 개발자로의 성공적인 변신을 위하여
 
10만 라인, 26280시간의 이야기
10만 라인, 26280시간의 이야기10만 라인, 26280시간의 이야기
10만 라인, 26280시간의 이야기
 
okspring3x
okspring3xokspring3x
okspring3x
 
Vert.x 세미나 이지원_배포용
Vert.x 세미나 이지원_배포용Vert.x 세미나 이지원_배포용
Vert.x 세미나 이지원_배포용
 
Lossless Stream Processing SKT
Lossless Stream Processing  SKTLossless Stream Processing  SKT
Lossless Stream Processing SKT
 
웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우
 
실전 서버 부하테스트 노하우
실전 서버 부하테스트 노하우 실전 서버 부하테스트 노하우
실전 서버 부하테스트 노하우
 
Node.js 시작하기
Node.js 시작하기Node.js 시작하기
Node.js 시작하기
 
구글앱엔진 스터디
구글앱엔진 스터디구글앱엔진 스터디
구글앱엔진 스터디
 
Talk it zerto_청담정보기술(20160706)
Talk it zerto_청담정보기술(20160706)Talk it zerto_청담정보기술(20160706)
Talk it zerto_청담정보기술(20160706)
 
행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스
 
[H3 2012] 행복한 개발을 위한 테스트 케이스
[H3 2012] 행복한 개발을 위한 테스트 케이스[H3 2012] 행복한 개발을 위한 테스트 케이스
[H3 2012] 행복한 개발을 위한 테스트 케이스
 
ecdevday3 효율적인 유지보수를 위한 개발 및 관리
ecdevday3 효율적인 유지보수를 위한 개발 및 관리ecdevday3 효율적인 유지보수를 위한 개발 및 관리
ecdevday3 효율적인 유지보수를 위한 개발 및 관리
 

Akka Fault Tolerance