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
400
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
160
Simplifying systems with Elixir - Belgrade
sasajuric
3
440
Simplifying systems with Elixir
sasajuric
2
560
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.2k
Solid Ground
sasajuric
3
850
Elixir - valentine edition
sasajuric
0
120
What's the fuss about Phoenix?
sasajuric
2
1.1k
Phoenix
sasajuric
1
210
Other Decks in Programming
See All in Programming
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
150
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.1k
ML.NETで始める機械学習
ymd65536
0
220
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Angular Meetup Berlin
danielsogl
0
100
未経験でSRE、はじめました! 組織を支える役割と軌跡
curekoshimizu
0
110
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
110
Open source software: how to live long and go far
gaelvaroquaux
0
650
AI Agent系IDEを使って 開発生産性を爆アゲする
ouchi2501
1
100
GAEログのコスト削減
mot_techtalk
0
120
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
140
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
110
もう僕は OpenAPI を書きたくない
sgash708
5
1.8k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
360
A Tale of Four Properties
chriscoyier
158
23k
It's Worth the Effort
3n
184
28k
A Philosophy of Restraint
colly
203
16k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
250
Embracing the Ebb and Flow
colly
84
4.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Thoughts on Productivity
jonyablonski
69
4.5k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
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