Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Simplifying systems with Elixir - Belgrade
Search
Saša Jurić
October 25, 2018
Programming
490
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Simplifying systems with Elixir - Belgrade
Saša Jurić
October 25, 2018
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
210
Simplifying systems with Elixir
sasajuric
2
630
Metagrokking Elixir
sasajuric
4
340
Solid Ground
sasajuric
15
1.3k
Solid Ground
sasajuric
3
940
Elixir - valentine edition
sasajuric
0
160
What's the fuss about Phoenix?
sasajuric
2
1.2k
Phoenix
sasajuric
1
290
Phoenix
sasajuric
0
170
Other Decks in Programming
See All in Programming
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
120
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
410
Security issues being discussed on Web Platforms
petamoriken
0
810
高専キャリア LT 発表内容
crysta1221
6
5.7k
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
410
自分的「カンファレンスの楽しみ方」
syumai
0
200
Jetpack Compose メカニズム
skydoves
0
140
ALB ログから Trace を気合で繋げる技術
fohte
7
890
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
180
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
220
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
A better future with KSS
kneath
240
18k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
GraphQLとの向き合い方2022年版
quramy
50
15k
Transcript
Simplifying systems with Elixir @sasajuric aircloak.com
Elixir functional concurrent
process ... foo(...) bar(...) ...
functional Elixir modules and functions immutable data first-class functions
... spawn(fn -> ... end) ...
process A ... foo(...) bar(...) ... process B ... baz(...)
qux(...) ...
send( process_b, some_message ) receive do message -> handle(message) end
process a process b
BEAM (Erlang VM)
BEAM (Erlang VM)
scheduler scheduler scheduler scheduler BEAM (Erlang VM) CPU CPU CPU
CPU
concurrent functional
activities incoming requests background jobs in-memory state load control …
managing activities multiple OS processes 3rd party products service managers
None
None
uniformity simpler development simpler testing simpler deployment simpler maintenance improved
collaboration
None
theerlangelist.com
git clone https://github.com/sasa1977/erlangelist.git mix deps.get && pushd assets && npm
install && popd iex -S mix phx.server
None
serving requests
http listener https listener
http listener https listener handler 1 handler 2 handler n
…
usage stats
stats collector handler handler handler
stats collector disk writer
def store(path, data) do File.write!( path, :erlang.term_to_binary(data) ) end
def read(path, default) do path |> File.read!() |> :erlang.binary_to_term() rescue
ArgumentError -> default end
cleanup
scheduler cleanup job periodically starts
HTTPS
our system CA server certificate request challenge info challenge
certifier http server usage stats
dev CA server
service management
defmodule StatsCollector do def start_link() do # ... end #
... end
Supervisor.start_link( [ StatsCollector, Cleanup ], # .. )
supervisor stats collector cleanup
supervisor worker
1
1 2
1 2 3 4 5
1 2 6 9 7 8 3 4 5
erlangelist usage stats web
usage stats stats collector cleanup
web ACME server main site certifier
None
technical feature built-in options services GenServer, Task service manager Supervisor
service registry Registry k-v ets, mnesia web server phoenix, plug, cowboy periodical jobs :timer, quantum, periodic load regulation jobs, safetyvalve, sbroker concurrent flows Flow, GenStage
Elixir in a nutshell start simple go far
Elixir guides Phoenix guides Learning resources Elixir forum
40% off using code ctwelixirbg18 at manning.com slides available at
bit.ly/elixirbg102018