3. Some things we use to get it done:
- scala (back end apps)
- ruby (chef, rails, proxymachine, lots)
- java (jenkins and plugins)
- erlang (“agents” and lots more..)
16. Process isolation
- it works so well
- nothing shared
- has worked so well for so long with OSes
- in erlang - each ‘process’ is like a process !
17. nginx Example: My Host OS
haproxy Erlang process
supervisor
...
p1 p999
Each: own heap, garbage collector
18. Erlang is:
- A vm based runtime (light !)
- language with prolog heritage (!)
- compiler
- interpreter
- debug tools - batteries included
- OTP - an application (server?) platform
19. Erlang is:
- Not OO
- no shared state **
- state kept in “term stores” - mini DBs
- processes easy to hot swap
- Quasi functional programming
(immutable variables, higher order)
- distributed (if you want)
20.
21.
22.
23. OTP
- Open Telecommunications Platform
- not about telco !
- network stacks/apis, supervisor trees
- toolkit for reliable servers (middleware)
- behaviours
24.
25.
26.
27. State in erlang
files
Host + real kernel
Erlang process
DETS supervisor
...
ETS p1 p999
Send Receive
28. Erlang processes, like OS processes
- Can only send messages to each other
- Can fail independently
- Can be restarted, safely, independently
- Easy to write apps for - Old School !
29. Better
- Tiny overhead (can have 100K+ of them !)
- perfect for supervisory agents
- distribute: run on every box if you like !
- lots of processes == lots of concurrency
- if you need to block, block !
30. Have used erlang for
- Supervisory agents - controllers
- Autoscaling services (realtime data analytics)
- misc backend systems
- fun command line tools !
- is “lite” VM (startup, footprint)
31. Supervisor configuration
- Declare rules for restarting, failure
- So you don’t have to intervene !
- can hot reload changes
- can have dependent processes
35. Anyway, that is why we use Erlang, also...
- RabbitMQ
- Riak (nosql DB)
- CouchDB (nosql DB)
- Probably your telephone exchange
36. Alternative approaches:
- Use “native” with daemontools/monit etc
- Akka (Scala) has similar supervisor
- library for your favourite language
- ephemeral “state less” apps
- Write software without bugs
- Or just restart everything 400 times a day
37. What is not awesome:
- OTP boiler plate
- VM not as fast as some
- No one seems to like the language
- tools? IDEs?