Are there any detailed walkthroughs of complicated Elixir apps?

Try to migrate your small back-end project to elixir, it will give you some kind of idea about performance and development processing. Especially if you used functional programing like python or ruby, it will be much more easy.

2 Likes

Oh yeah, I’ll echo this. My first Elixir project was rewriting part of a huge Rails app, to a crushing success. It was super eye-opening to have covered the basics and immediately jump into trying to make useful code that replaces other useful (but already very slow to run and hard to maintain) code.

3 Likes

I decided that I’m going to create this resource. I’ll try to cover as many aspects as possible of creating and deploying a production quality Elixir app. I have experience deploying Elixir apps in Azure, but not ones that I would consider ready for production. So, it’ll take me a long time as I’m going to have to learn a lot of it from trial and error, research, and plain old questioning the experts.

If anyone has anything, they will want to include in something like this let me know.

So far I have the following planned:

  • Dev Environment

    • Setting up VS Code with a Docker Dev environment to match production resources. This includes the host OS container, dependencies such as a database and telemetry observability applications, basic VS Code plugins
  • Elixir toolchain

    • mix
    • releases
    • iex, etc.
  • Continuous Integration

    • Tests
    • Builds in Github or Azure DevOps
    • Automated Deployments
      • Infrstructure as Code
  • Application configuration

    • Application starting with different configurations depending on deployment environment.
    • Using third party or cloud provided tools like Azure Key Vault, AWS’s Key Management System, or something like Hashicorp’s Vault
  • Error handling

    • When to use Supervision trees and/or try/rescue
      • Let it crash is sometimes an option, but not always.
  • Telemetry

    • Logging
    • What type of Telemetry to collect (depending on the example application)
    • How and where to push
    • Setting up alerts for incident management and on-call (depending on the Telemetry Observability application provider)
  • Sending email as part of confirming pertinent user changes and information

  • Api Security

  • Unit tests and Integration tests

    • Also part of CI/CD
  • Data Persistence

    • Choosing the correct database type for our application
    • Using Ecto
    • Database Migrations
      • Including production

I’ve gotten permission from Luca (zero2prod.com) to create the domain zero2deploy.com. I probably didn’t need permission but felt that the name is so similar that it would be shameful not to run it by him first.

9 Likes

I would love to share as I am developing on MS Windows - but not deploying on Windows.

I think one of the main selling points is that Elixir is a rare programming language which runtime works natively on Windows. It takes a bit of effort to set up though like some libraries will need the Visual C++ Build tools.

Thoroughly approve of the chapters though here are some suggestions:

a. Explore :observer in extra depth and explain the metrics would be a definite gamechanger as many arent 100% familiar with BEAM. There are quite a number of books out of there - but a Cliff’s notes will be really useful especially when Elixir is a very hard sell.

b. Explore alternative tools like :observer_cli and explain how to make Erlang nodes and use observer to monitor them remotely. Took a while for it to click for me mentally.

c. Performance expectations. Yes load tests. There isnt a whole lot of effort spent on benchmarking Elixir - yes because it simply is different. But surely, there is a way to guide people how to do good load tests and gain enough confidence that their coding skills pass muster.

3 Likes

I learned Python at home but at work Python was not embraced. At some day I just started to write Python scripts to support my daily job. Then I was hired by a department of a big dutch energy company and the automation there was a disaster. I wrote Python scripts with a big extra focus on error-handling&reporting and then I convinced my manager to launch a dedicated Linux server in their Azure cloud as a home for my Python scripts. Well, it now runs for more then 2 years.


Just have trust and go for it. And don’t forget to document your scripts in an text document. They will mention you in their prays later.

I know you wanted non-Phoenix specific resources, but I still recommend checking out LiveBeats. It is a really cool project and I personally learned a lot from it.

GitHub: GitHub - fly-apps/live_beats

Blog post: LiveBeats: Building a social music app with Phoenix LiveView · Fly

LiveBeats: https://livebeats.fly.dev

1 Like