Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
ra
A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
What are the issues?
For running directly on Windows you can simply run the Elixir installer, which will install Erlang and Elixir. After that, I highly recommend using the ElixirLS extension for Visual Studio Code. Note that on Windows, you need to use `iex.bat` and `mix.bat` instead of just `iex` and `mix` when running the commands. For example, `iex.bat -S mix.bat`. (I have it setup where I can leave off `.bat` for `mix`, but I can't remember what I did off the top of my head, if anything, to get that. `iex` conflicts with a PowerShell thing, so `iex.bat` is required.)
The other option is to install WSL2, install Erlang and Elixir there (I recommend using the asdf package manager (https://asdf-vm.com/). Once installed, use the Remote - SSH extension in Visual Studio Code on the Windows side to remote into the WSL2 instance. You could also download an official Elixir Docker container and again use Visual Studio Code (https://code.visualstudio.com/docs/devcontainers/containers).
You may find these interesting...
- "The Onion Layer Theory" https://learnyousomeerlang.com/building-applications-with-ot...
- "On Erlang, State and Crashes" http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-...
- "Why Restarting Works" https://ferd.ca/the-zen-of-erlang.html (search for "Heisenbug")
> you should store the state in the external system
Disk works too, but if you're multi-node this means you now have a distributed database embedded in your system, which may or may not be your goal :)
RabbitMQ does this, they developed a library for "persistent, fault-tolerant and replicated state machines" based on Raft: https://github.com/rabbitmq/ra.
Agreed, sounds like Orleans. See https://github.com/erleans/erleans :)
Also for general writing on erlang and k8s: https://adoptingerlang.org/docs/production/ -- I try to explain why the two work at different levels so complement each other.