Running in Production
Running in Production
Nick Janetakis - Full stack developer
Serving Medical University Employees, Health Officials and Students
50 minutes Posted Nov 10, 2019 at 5:00 am.
– Motivation for using Elixir and Phoenix
– Would you use Phoenix again if you rewrote your app today?
– Replacing Excel sheets and paper with a medical app that accesses an Oracle database
– Building an extensive security and permission system
– Supporting terminal browsers with server side templates and progressive JavaScript
– Employees, health officials and students use the app, it gets ~80 concurrent users
– Progressive enhancements with Drab (an Elixir library that competes with Live View)
– Using the BEAM and Cachex for caching data without using Redis
– Average page response times are in micro-seconds
– Docker is being used in development and production without Kubernetes or Swarm
– Using nginx as a reverse proxy, mainly for handling SSL certificates
– Assets are bundled with npm itself but Gabriel recommends using Webpack today
– Handling email transactions, error reporting, logging and metrics
– Everything is hosted on premises mainly for security reasons
– Running RedHat since it was installed before he got hired, but recommends Debian
– The Phoenix app runs on a VM with 40GB of storage, 8GB of memory and 6 CPU cores
– The primary server has 12TB of storage, 128GB of memory and 128 CPU cores
– The Phoenix app has 17,500+ lines of Elixir code spread across 150+ files
– It’s a pleasure to navigate, maintain and update the code base
– Configuration management is done with a VMware vSphere related tool
– Walking through a code deploy with Docker, Distillery and custom shell scripts
– 2 seconds of down time per deploy without a complex load balancer or orchestrator
– Handling disaster recovery by backing up the code and data every day
– Gabriel tried to bring down the app with a massive spike of traffic but it stayed up
– Best tips and advice? Love / learn Docker and use static typing when you can
– Separate your concerns and keep your functions short and simple
– You can find Gabriel on his site, GitHub, Twitter and on IRC at freenode #elixir-lang
0:00
50:55
Download MP3
Show notes
In this episode of Running in Production, Gabriel Robertson talks about how he
uses Phoenix and Elixir to build and deploy an ever changing internal web
application that medical University employees, health officials and students
use to access various systems and resources.
The application has a number of interesting security, up-time and browser
compatibility requirements. It’s been running in production since 2017.
Topics Include
49:42 – You can find Gabriel on his site, GitHub, Twitter and on IRC at freenode #elixir-lang
Links
πŸ“„ References
http://yaws.hyber.org/
http://nitrogenproject.com/
https://lynx.browser.org/
https://elixirforum.com/t/potentially-removing-brunch-from-the-phoenix-new-template-generator/2454
https://soundcloud.com/elixirtalk/episode-157-feat-chris-mccord-liveviewphoenix-part-deux
https://elixirforum.com/t/pidfile-create-and-manage-a-pid-file-from-the-beam-process/7620
https://concourse-ci.org/
https://drone.io/
https://github.com/wg/wrk
https://github.com/JoeDog/siege
βš™οΈ Tech Stack
phoenix →
elixir →
docker →
lets-encrypt →
nginx →
oracle →
postgres →
redhat →
systemd →
vsphere →
πŸ›  Libraries Used
https://github.com/josefs/Gradualizer
https://github.com/OvermindDL1/gradualixir
https://github.com/jeremyjh/dialyxir
https://github.com/grych/drab
https://github.com/philss/floki
https://github.com/whitfin/cachex
https://github.com/bitwalker/distillery
Support the Show
This episode does not have a sponsor and this podcast is a labor of love. If
you want to support the show, the best way to do it is to purchase one of my
courses or suggest one to a friend.
Dive into Docker is a video course that takes you from not knowing what Docker is
to being able to confidently use Docker and Docker Compose for your own apps.
Long gone are the days of "but it works on my machine!". A bunch of follow
along labs are included.
Build a SAAS App with Flask is a video course where we build a real
world SAAS app that accepts payments, has a custom admin, includes high test
coverage and goes over how to implement and apply 50+ common web app features.
There's over 20+ hours of video.