Digests » 193

this week's favorite

To use or not to use the ++ operator in Elixir

In this article, performance implications of using the ++ operator with lists in Elixir are discussed. People starting to use the language could find this post interesting, since we start by reading the official documentation advice about this operator but also try different approaches for a given problem, benchmarking each case and attempting to make sense of the results.

Encrypted Secrets

EncryptedSecrets allows you to store your application's secrets inside your VCS to ease distribution and updating, à la Rails 5.2 Encrypted Credentials.

Easy Concurrency Locking in Erlang/Elixir

Out of the box, Elixir and Erlang offer a very powerful tool for serializing access to a resource via the GenServer included in OTP and surfaced in the Elixir standard library. As a GenServer processes messages it receives both in order and synchronously, it becomes a great tool for simulating a lock pattern from other languages. If you wanted to serialize writes to a database, you could simply roll all of your database interaction into a GenServer implementation and you're done!

Achieving 100k connections per second with Elixir

Both HTTP 1.x and HTTP/2 rely on lower level connection-oriented protocols, namely TCP/IP and TLS. These protocols provide reliable delivery and correct order when data is chunked into multiple packets. TLS also includes encryption and authentication.

Spawning processes in Elixir, a gentle introduction to concurrency

One of the coolest things in Erlang and Elixir is their concurrency implementation based on Actor model. In this article I introduce concurrency and show how we can start making our code concurrent in Elixir, using processes.