Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
High Availability
Search
Saša Jurić
April 23, 2015
Programming
5
390
High Availability
ElixirConf Europe
Saša Jurić
April 23, 2015
Tweet
Share
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
150
Simplifying systems with Elixir - Belgrade
sasajuric
3
400
Simplifying systems with Elixir
sasajuric
2
540
Metagrokking Elixir
sasajuric
4
270
Solid Ground
sasajuric
15
1.1k
Solid Ground
sasajuric
3
750
Elixir - valentine edition
sasajuric
0
120
What's the fuss about Phoenix?
sasajuric
2
970
Phoenix
sasajuric
1
200
Other Decks in Programming
See All in Programming
軽率にVue 3で リアルタイム3Dアプリを作れる ライブラリを作ってみた/vue-with-3d-app
drumath2237
3
1.2k
見せ算をScalaで実装してみた / Scalaわいわい勉強会 #2
arthur1
0
1.1k
マイ隙間家具OSSたちのご紹介
karupanerura
2
130
Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
860
「プログラマーのためのCPU入門」は入り口として丁度よい!
forrep
25
22k
PHPerライフをChrome拡張開発でちょっと便利に / PR TIMES x DMM.com
meihei3
0
200
Static Analysis Automation for Hunting Vulnerable Kernel Drivers
takahiro_haruyama
1
1.4k
CSC308B Lecture 12
javiergs
PRO
0
110
Kotlinを用いたDSL的な設計手法と使用上の注意
kohii00
2
490
WasmOS: Wasmを実行する自作Microkernel
riru
0
360
PHP で読む楽しいコアダンプ
sji
0
220
before_rails_girls_after_rails_girls
maimux2x
0
300
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.5k
The Language of Interfaces
destraynor
150
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Designing for Performance
lara
601
67k
Adopting Sorbet at Scale
ufuk
66
8.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
355
22k
Raft: Consensus for Rubyists
vanstee
130
6.2k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Pencils Down: Stop Designing & Start Developing
hursman
115
11k
Debugging Ruby Performance
tmm1
68
11k
Transcript
iex(1)> high_availability @sasajuric aircloak.com
Erlang (the language) Elixir LFE Erlang VM (BEAM)
highly_available ≈ works_almost_always
optional?(highly_available) # false
easy?(highly_available) # false
None
highly_available do # the code here magically works end #doesntworklikethat
fault-tolerance scalability + responsiveness = high availability
A B D E F C
send(pid, message) A B message = receive ...
def loop(state) do receive do message -> new_state = handle(state,
message) loop(new_state) end end
bank account balance {:deposit, amount} {:withdraw, amount} :balance amount
OS process or thread Erlang process
db connection background job request handler state request handler request
handler request handler request handler request handler state state state background job background job background job db connection db connection db connection
A B C D E F
A exit message B C D E F
supervisor worker worker
S S S W W S W W W S
W W
scheduler scheduler scheduler scheduler CPU CPU CPU CPU VM
VM VM VM VM VM
VM send(pid, message) VM 1 send(pid, message) VM 2
shared-nothing concurrency process crash propagation + some VM magic =
fault tolerance scalability responsiveness
None
3rd party data source transform data push server browsers bets
validation
Data transformation 1.Receive TCP stream" 2.Assemble XML messages" 3.Update the
model" 4.Store to database" 5.Serialize the model" 6.Dispatch
receive stream assemble messages update model store to database serialize
data dispatch
receive stream assemble messages update model store to database serialize
data dispatch message 6 message 5 message 4 message 3 message 2 message 1
receive stream assemble messages update model store to database serialize
data dispatch
storing to database queuing bet odds storing bet odds
match 1 match 3 match 2
update model serialize data dispatch match 1 match 3 match
2
None
None
None
None
None