Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
replikativ
Building services without network API
(CRDT와 OTP를 중심으로)
re-frame
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
re-frame
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
Server
re-frame
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
Server
● send/receive
● serialization/deser...
re-frame
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
Server
● send/receive
● serialization/deser...
re-frame
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
Server
● send/receive
● serialization/deser...
wanted
app-db components Hiccup Reagent VDOM React DOM
f1 f2 f3
eventhandler
Server
Reactive
Simple
wanted
app-dbServer
● 내가 데이타를 app-db에 쓰면 저절로 Server에 전달되었으면…
● Server에서 필요한 데이타가 저절로 app-db로 전달되어 있으면…
the problem is the networking
ClientServer
reactive c/s programming
ClientServer
Server
ServerServer
Server
Server
Client
Client
Client
Client
the reactivity of the distributed system
the pr...
Hard Disk
Sector
File
Memory
Data,Time
Data FlowConceptial Layer
Implementation Layer
Physical Layer
Reactive
Programming
...
Leslie Lamport,
2013 Turing
Award Winner
● 논문 : Time, Clocks, and the Ordering of Events in a
Distributed System, 1978
● “...
● handled by mathematics
○ game
○ AI
○ Algorithms
○ CSP
● how does the network problem be handled by math?
the problem is ...
Marc Shapiro
● 논문 : Conflict-Free Replicated Data Types, 2011
● a data structure which can be updated independently
and co...
The messages is
● Delayed
● Dropped
● Delivered out-of-order
● Duplicated
이것은 프로그래밍 기술로 풀 문제가 아니다.
CRDT
The messages is
● Delayed ⇒ Associative
● Dropped
● Delivered out-of-order ⇒ Commutative
● Duplicated ⇒ Idempotent
CRDT
● Associative
(A ● B) ● C = A ● (B ● C)
메세지를 어떻게 묶든 결과는 같다.
● Commutative
A ● B = B ● A
메세지가 순서가 바뀌어도 결과는 같다.
● Idempoent
...
● 수학의 한 분과인 순서론(Order Theory)중
부분순서집합인 Semilattice를 이용하여 CRDT의 존재를
증명.
● 메세지가 전달되는 순서에 관한 문제를 하나의 추상적
물리현상으로 보고 수학적으로 분석.
...
● Counter
○ G-Counter
○ PN-Counter
● Register
○ LWW-Register
○ MV-Register
● Set
○ G-Set
○ 2P-Set
○ LWW-Set
○ PN-Set
○ OR-...
● OTP(Open Telecom Platform)
○ written in Erlang
○ used by Erlang
○ 미들웨어
● Erlang
○ nine-nineth의 고가용성의 concurrent, functio...
● Erlang’s Let It Crash Philosophy
● No Defensive Programming
○ Using exceptions and 'error handling'
adds complexity
● Su...
Hard Disk
Sector
File
Memory
Data,Time
Data FlowConceptial Layer
Implementation Layer
Physical Layer
Reactive
Programming
...
● an open, scalable and distributive infrastructure for a
data-driven community of applications
● written in clojure.
● CR...
replikativ
Demo
Replikativ
Replikativ
Upcoming SlideShare
Loading in …5
×

Replikativ

287 views

Published on

pt used at korean clojure seminar on 2017.11.11

Published in: Software
  • Login to see the comments

  • Be the first to like this

Replikativ

  1. 1. replikativ Building services without network API (CRDT와 OTP를 중심으로)
  2. 2. re-frame app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler
  3. 3. re-frame app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler Server
  4. 4. re-frame app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler Server ● send/receive ● serialization/deserialization ● packing/unpacking ● error/exception handling ● routing
  5. 5. re-frame app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler Server ● send/receive ● serialization/deserialization ● packing/unpacking ● error/exception handling ● routing Compelexity!
  6. 6. re-frame app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler Server ● send/receive ● serialization/deserialization ● packing/unpacking ● error/exception handling ● routing Compelexity!Not Reactive
  7. 7. wanted app-db components Hiccup Reagent VDOM React DOM f1 f2 f3 eventhandler Server Reactive Simple
  8. 8. wanted app-dbServer ● 내가 데이타를 app-db에 쓰면 저절로 Server에 전달되었으면… ● Server에서 필요한 데이타가 저절로 app-db로 전달되어 있으면…
  9. 9. the problem is the networking ClientServer reactive c/s programming
  10. 10. ClientServer Server ServerServer Server Server Client Client Client Client the reactivity of the distributed system the problem is the networking
  11. 11. Hard Disk Sector File Memory Data,Time Data FlowConceptial Layer Implementation Layer Physical Layer Reactive Programming Imperative Programming Abstraction Message, Network API ??? One Machine Distributed System Lan Electronic Wiring the problem is the networking
  12. 12. Leslie Lamport, 2013 Turing Award Winner ● 논문 : Time, Clocks, and the Ordering of Events in a Distributed System, 1978 ● “Most people view concurrency as a programming problem or a language problem. I regard it as a physics problem” - Interviewed by Erik Meijer ● Yes, the problem is the networking. ● But it is not a programming or a language problem but a physics problem. the problem is the networking the transition of problem domain
  13. 13. ● handled by mathematics ○ game ○ AI ○ Algorithms ○ CSP ● how does the network problem be handled by math? the problem is the networking the physics problems
  14. 14. Marc Shapiro ● 논문 : Conflict-Free Replicated Data Types, 2011 ● a data structure which can be updated independently and concurrently without coordination between the replicas ● use ○ Riak : NoSQL ○ Roshi : SoundCloud ○ Game : Angry Birds, Leage of Legends ○ TomTom : navigation data sync ○ akka distributed data CRDT
  15. 15. The messages is ● Delayed ● Dropped ● Delivered out-of-order ● Duplicated 이것은 프로그래밍 기술로 풀 문제가 아니다. CRDT
  16. 16. The messages is ● Delayed ⇒ Associative ● Dropped ● Delivered out-of-order ⇒ Commutative ● Duplicated ⇒ Idempotent CRDT
  17. 17. ● Associative (A ● B) ● C = A ● (B ● C) 메세지를 어떻게 묶든 결과는 같다. ● Commutative A ● B = B ● A 메세지가 순서가 바뀌어도 결과는 같다. ● Idempoent A ● A = A 메세지가 중복되어도 결과는 같다. CRDT
  18. 18. ● 수학의 한 분과인 순서론(Order Theory)중 부분순서집합인 Semilattice를 이용하여 CRDT의 존재를 증명. ● 메세지가 전달되는 순서에 관한 문제를 하나의 추상적 물리현상으로 보고 수학적으로 분석. ● 위상학(Topology)와 범주론(Category Theory)과 관련 CRDT
  19. 19. ● Counter ○ G-Counter ○ PN-Counter ● Register ○ LWW-Register ○ MV-Register ● Set ○ G-Set ○ 2P-Set ○ LWW-Set ○ PN-Set ○ OR-Set ● Map ○ ORMap ● Graph ○ DAG ● Array ○ RGA CRDTs
  20. 20. ● OTP(Open Telecom Platform) ○ written in Erlang ○ used by Erlang ○ 미들웨어 ● Erlang ○ nine-nineth의 고가용성의 concurrent, functional, dynamically typed, and immutable language ○ Fault-tolerent ● Lightweight Process ○ 얼랭 프로그램을 구성하는 단위. ○ 프로그램은 얼랭 VM에서 관리 ○ OS process도 thread도 아님 ○ 어떤 자원도 서로 공유하지 않음. ○ 다만 메세지만 주고 받음. ○ Actor Model OTP
  21. 21. ● Erlang’s Let It Crash Philosophy ● No Defensive Programming ○ Using exceptions and 'error handling' adds complexity ● Supervisor/Worker ● 에러 발생하면 해당 process를 죽이고 재시작. ● Robust System OTP Supervisor Worker
  22. 22. Hard Disk Sector File Memory Data,Time Data FlowConceptial Layer Implementation Layer Physical Layer Reactive Programming Imperative Programming Abstraction Message, Network API CRDT, OTP One Machine Distributed System Lan Electronic Wiring the problem is the networking
  23. 23. ● an open, scalable and distributive infrastructure for a data-driven community of applications ● written in clojure. ● CRDT based. ● subprojects ○ kabel ■ pluggable, asynchronous nerwork IO ■ pub/sub architecture ○ konserve ■ pluggable, asynchronous storage IO ■ backend : CouchDB, Riak, LevelDB ○ superv.async ■ expand core.async ■ Erlang/OTP supervisor ■ Let It Crash ● 단 2명이 5년에 걸쳐 만듦 ○ 완성도는 좋으나 아직은 실험적인 듯... replikativ
  24. 24. replikativ
  25. 25. Demo

×