ef2011 sf

80
Erlang Factory 2011 SF 기술전략팀 김대현 [email protected]

Upload: daehyun-kim

Post on 16-May-2015

289 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ef2011 sf

Erlang Factory

2011 SF

기술전략팀����������� ������������������  김대현[email protected]

Page 2: Ef2011 sf

발표내용‣컨퍼런스 소개‣ Erlang 소개 & 예제‣ OTP 소개 ‣기타 관련 기술 소개

Page 3: Ef2011 sf

EF2011SF 컨퍼런스 소개‣ 170명 규모‣ 교육코스 4가지 (각반 10~15명 규모)‣ Erlang 기초‣ OTP 속성 ‣ XMPP‣ Test Driven Development

‣컨퍼런스 Days

Page 4: Ef2011 sf
Page 5: Ef2011 sf
Page 6: Ef2011 sf
Page 7: Ef2011 sf
Page 8: Ef2011 sf

Erlang 소개

Page 9: Ef2011 sf
Page 10: Ef2011 sf
Page 11: Ef2011 sf
Page 12: Ef2011 sf
Page 13: Ef2011 sf
Page 14: Ef2011 sf
Page 15: Ef2011 sf
Page 16: Ef2011 sf
Page 17: Ef2011 sf
Page 18: Ef2011 sf
Page 19: Ef2011 sf
Page 20: Ef2011 sf
Page 21: Ef2011 sf

Erlang의 세계관‣ The world is concurrent‣ Things in the world don’t share data‣ Things communicate with messages‣ Things fail

Page 22: Ef2011 sf

이제와서...‣멀티코어 시스템‣ 쓰레드 모델의 한계‣ 개발하기 어려움‣ 확장성 저하

Page 23: Ef2011 sf

예제 #1

Page 24: Ef2011 sf
Page 25: Ef2011 sf
Page 26: Ef2011 sf
Page 27: Ef2011 sf
Page 28: Ef2011 sf
Page 29: Ef2011 sf
Page 30: Ef2011 sf
Page 31: Ef2011 sf
Page 32: Ef2011 sf
Page 33: Ef2011 sf
Page 34: Ef2011 sf

예제 #2

Page 35: Ef2011 sf
Page 36: Ef2011 sf
Page 37: Ef2011 sf

OTP

Page 38: Ef2011 sf

OTP‣ Open Telecom Platform‣탄탄한 시스템을 만들기 위한 ‣애플리케이션‣라이브러리‣ 도구

Page 39: Ef2011 sf

Design Principles: Behaviours‣ The idea is to split the code in two parts‣ The generic part is called the generic behaviour‣ They are provided by OTP as library modules

‣ The specific part is called the callback module‣ They are implemented by the programmer

Page 40: Ef2011 sf

Behaviours: client-server

Generic Specific

‣Spawning����������� ������������������  the����������� ������������������  server‣Storing����������� ������������������  the����������� ������������������  loop����������� ������������������  data‣Sending����������� ������������������  requests����������� ������������������  to����������� ������������������  the����������� ������������������  server‣Sending����������� ������������������  replies����������� ������������������  to����������� ������������������  the����������� ������������������  client‣Receiving����������� ������������������  server����������� ������������������  replies‣Stopping����������� ������������������  the����������� ������������������  server

‣Initializing����������� ������������������  the����������� ������������������  server����������� ������������������  state‣The����������� ������������������  loop����������� ������������������  data‣The����������� ������������������  client����������� ������������������  requests‣Handling����������� ������������������  client����������� ������������������  requests‣Contents����������� ������������������  of����������� ������������������  server����������� ������������������  reply‣Cleaning����������� ������������������  up

Page 41: Ef2011 sf

Behaviours 장단점

장점 단점

‣Less����������� ������������������  code����������� ������������������  to����������� ������������������  develop‣Less����������� ������������������  bugs‣Solid����������� ������������������  well����������� ������������������  tested����������� ������������������  base‣Free����������� ������������������  built-in����������� ������������������  functionality‣Log,����������� ������������������  Trace,����������� ������������������  Statistics,����������� ������������������  Extensible‣Common����������� ������������������  Programming����������� ������������������  Style‣Component-based����������� ������������������  Terminology

‣Steep����������� ������������������  learning����������� ������������������  curve‣Affects����������� ������������������  performance

Page 42: Ef2011 sf

Behaviours‣ Generic Servers‣ Generic Finite-State Machines‣ Generic Event Handler/Manager‣ Supervisors‣ Application

Page 43: Ef2011 sf

Behaviour: Generic Server‣ client-server model

‣ a central server‣ an arbitrary number of clients

‣ generally used for resource management operations‣ where several different clients want to share a common resource

‣ The Server is responsible for managing this resource.

query

reply

Page 44: Ef2011 sf
Page 45: Ef2011 sf

Supervision Trees‣ Basic concept in Erlang/OTP‣ Process structuring model based on the idea of workers and supervisors

Page 46: Ef2011 sf

Supervision Trees

1

1 a

a 1

Page 47: Ef2011 sf

Supervisor‣ responsible for starting, stopping, monitoring its child processes

‣ it should keep its child processes alive by restarting them when necessary

Page 48: Ef2011 sf

Supervisor‣ Restart Strategy‣ one_for_one‣ one_for_all‣ rest_for_one

‣Maximum Restart Frequency‣ to limit the number of restarts which occur in a given time interval

Page 49: Ef2011 sf

one for one

1

Page 50: Ef2011 sf

one for one

1

Page 51: Ef2011 sf

one for one

1

Page 52: Ef2011 sf

one for one

1

Page 53: Ef2011 sf

one for all

a

Page 54: Ef2011 sf

one for all

a

Page 55: Ef2011 sf

one for all

a

Page 56: Ef2011 sf

one for all

a

Page 57: Ef2011 sf

one for all

a

Page 58: Ef2011 sf

rest for one

R

Page 59: Ef2011 sf

rest for one

R

Page 60: Ef2011 sf

rest for one

R

Page 61: Ef2011 sf

rest for one

R

Page 62: Ef2011 sf

rest for one

R

Page 63: Ef2011 sf

그 외 기술/도구 소개

Page 64: Ef2011 sf
Page 65: Ef2011 sf

Riak‣ scalable ‣ highly available‣ networked‣ key/value store

Page 66: Ef2011 sf

Riak‣ Inspired by Amazon’s Dynamo ‣ Key/Value store + Metadata‣ Riak chooses Availability and Partition tolerance over Consistency

‣ Instead provides eventual consistency

Page 67: Ef2011 sf
Page 68: Ef2011 sf
Page 69: Ef2011 sf

QuickCheck‣ a Set theory...‣ X ∪ Y = Y ∪ X

Page 70: Ef2011 sf
Page 71: Ef2011 sf
Page 72: Ef2011 sf
Page 73: Ef2011 sf

GPGPU programming‣ Using the graphics processor for non- graphical programming

‣ NVidia CUDA‣ GPGPU framework for NVIDIA GPUs‣ Thrust‣ C++ framework for GPU computing

‣ OpenCL

Page 74: Ef2011 sf
Page 75: Ef2011 sf

pteracuda‣ Experiment to integrate CUDA & Erlang

‣ Accelerate slow Erlang operations‣ Built on CUDA 4.0 RC1

Page 76: Ef2011 sf
Page 77: Ef2011 sf
Page 78: Ef2011 sf

정리‣컨퍼런스 소개‣ Erlang 소개 & 예제‣ OTP 소개‣ 그 외 기술/도구 소개

Page 79: Ef2011 sf

감사합니다

Page 80: Ef2011 sf

스터디 모집‣ Erlang/OTP 걸음마‣매주 수요일 점심 12:00 ~ 13:00‣나는 얼랭개발자다: 7명‣가장 중요한 것은 참여 의지!‣메신저 연락 바람!