5. Erlang/BEAM
✤ Created in 1986 for Ericsson
✤ Joe Armstrong, Robert Virding and Mike Williams
✤ Powers majority of telephone networks
✤ Designed to be very reliable and fault-tolerant
✤ Functional language with a funny syntax
8. My Ideal Stack (the Lazy Ops)
✤ Something I don’t have to care about (performance,
etc)
✤ Deploy it
✤ Done
9. My Ideal Stack
✤ But if something does go wrong
✤ System goes to a degraded but still up state
✤ Good observability (metrics, logs, real-time
analysis)
13. BEAM - Features
✤ Can scale horizontally very easily to many instances
✤ Multiple instances and cluster together automatically
to form a mesh
✤ Is extremely fault tolerant (nine ‘9’s *)
✤ “Releases” are built in concepts
✤ Hot Deployable
14. BEAM - Case Studies
✤ WhatsApp - Erlang - 50 Engineers to manage 900
million users in 2015
✤ Bleacher Report - Elixir - Reduced number of servers
from 150 to 5
✤ Discord - Elixir - Handles 5 million concurrent users
15. BEAM -Why I like it
✤ It reminds me a lot of how OS’s is designed and how
we build good reliable platforms
✤ Gives me the same feeling as working with Linux
16. BEAM - How?
✤ Everything is a process
✤ BEAM can support millions of processes and spawn
processes very quickly and cheaply
✤ Processes can only communicate through messages
(even across networks)
✤ All* Data/Variables are immutable - local state
17. BEAM - How?
✤ Processes are supervised and will be restarted (Monit,
Systemd)
✤ “Let it crash” - Erlang coding philosophy
✤ Humans make mistakes
✤ Let it crash vs Defensive coding
18. BEAM and Kubernetes
✤ Similar functionality
✤ Not mutually exclusive or even related
✤ Can be easily dockerized and deployed with
Kubernetes
19. BEAM vs Kubernetes
BEAM Kubernetes
Monitor Tasks ✅ ✅
Distributed across multiple nodes ✅ ✅
Service Discovery ✅ ✅
Hot Upgrades ✅ ❌
Language Agnostic ❌ ✅
Platform Components (networks) ❌ ✅
20. My deployment experience
✤ Deployed as docker container or tarball on different
platforms (AWS/GCP/Azure/Kubernetes)
✤ Never had to restart “Just Because”™
✤ Have never needed to deal with memory issues
✤ All issues in production were due to logic errors
✤ Literally deploy and forget
21. Observability when things fail
✤ BEAM has a ton of metrics built in
✤ Built in observer to inspect the live state of production
✤ Support for common tools like Prometheus/Datadog
is available
✤ Logs are just logs
27. Hot Deployments
✤ Most applications we run do not need this
✤ Nothing wrong with ye-olde fashioned deployments
✤ Very high technical and cognitive overheads to get
right
28. Drawbacks
✤ Not as supported as other languages by common tools
and services
✤ Functional concepts are more foreign to developers/
Ops than other languages
✤ Erlang documentation is a tyre fire
✤ Can be harder to find engineers with knowledge
29. Conclusion
✤ Elixir/BEAM is amazing to manage from the Ops
perspective
✤ Deploy and forget
✤ When that fails, good observability
✤ Not as supported as other languages and harder to
find engineers
30. References
✤ Demo Repo - https://github.com/jgmchan/elixir-hot-deploy-demo
✤ Elixir Website - https://elixir-lang.org/
✤ Erlang Website - https://www.erlang.org/
✤ Elixir vs Ruby - https://foxbox.com/blog/elixir-vs-ruby/
✤ Why WhatsApp only needs 50 Engineers for its 900M users - https://www.wired.com/
2015/09/whatsapp-serves-900-million-users-50-engineers/
✤ Benefits of Elixir: How Elixir helped Bleacher Report handle 8x more traffic - https://
www.techworld.com/apps-wearables/how-elixir-helped-bleacher-report-handle-8x-more-
traffic-3653957/=
✤ How Discord Scaled Elixir to 5,000,000 Concurrent Users - https://blog.discordapp.com/
scaling-elixir-f9b8e1e7c29b