Systems | Development | Analytics | API | Testing

Elixir

A Guide to Event-Driven Architecture in Elixir

In this post, we will explore how event-driven architecture can make your app more responsive for users and decouple your modules for a better developer experience. We will also look at several methods of implementing event-driven architecture with Elixir. Elixir is particularly good for this because of the advanced and concise message-passing APIs that it offers and BEAM's outstanding support for concurrency. But first: what is event-driven architecture, exactly?

Using Profiling in Elixir to Improve Performance

Elixir is all about performance. Say you have an app up and running with Elixir, but some parts aren't working as fast as you would like them to. That is where profiling comes in. Profiling tools usually walk you through the frequency and duration of function calls and where they spend their time. Erlang has impressive profile tooling available at its disposal. In this post, we will look into three profiling tools in Elixir: cprof, eprof, and fprof.

Phoenix LiveView Under The Hood: The Form Function Component

Thanks to HEEx and function components, LiveView provides developers with a sleek, ergonomic syntax for building and maintaining sophisticated interactive UIs. LiveView's form/1 function component is a great example of this, making it easier than ever before to render complex forms within LiveView. However, the form/1 function component can feel a little mysterious to anyone unfamiliar with LiveView's function components.

A Guide to Secure Elixir Package Updates

Keeping your dependencies up-to-date is essential to ensure that your applications stay healthy, secure, and performant. Thankfully, the BEAM ecosystem has its own package manager, Hex, which is fast, mature, and simple to use. This article explores the available tools and commands to manage Hex dependencies and some tips to make the process more enjoyable. Let's dive in!

Functional Programming in Elixir with Witchcraft

While Elixir is a functional programming language, it is different from most of the other popular functional languages like Haskell, Scala, OCaml, and F#. Elixir pragmatically handles concurrent systems with high fault tolerance. In other words, Elixir is an FP language because this naturally fits it, and not for its own sake. So, porting idioms blindly from Haskell to Elixir can lead to undesired results.

Securing Your Phoenix LiveView Apps

LiveView is a compelling choice for building modern web apps. Built on top of Elixir's OTP tooling, and leveraging WebSockets, it offers super fast real-time, interactive features alongside impressive developer productivity. In this post, we'll show you how to secure your live view routes with function plugs and group live routes in a secure live session. Let's dive straight in!

Build Interactive Phoenix LiveView UIs with Components

LiveView empowers developers to build interactive, single-page web apps with ease by providing a framework that eliminates the need for guesswork. In this post, we'll take a look at how you can layer simple, single-purpose functional components to wrap up shared presentation logic. We'll also use more sophisticated live components to craft easy-to-maintain single-page flows that handle complex user interactions.

8 Common Causes of Flaky Tests in Elixir

Flaky tests are like meme stocks — many people have them, but no one knows what to do with them. Today, we will change that by diving into some common causes and, more importantly, solutions for flickering tests in Elixir. Elixir has many great primitives that let us run tests asynchronously, including immutable data, lightweight processes, and the Ecto SQL sandbox. Running tests asynchronously can greatly speed up your test suite, but can also increase the chance of flaky tests.

Three Ways to Debug Code in Elixir

Elixir provides a very powerful suite of tools that devs can use to observe the behavior of their code and debug errors. There are several different strategies you can use to debug code in Elixir. While it is hard to produce a comprehensive list of all possible debugging methods, we will cover some of the most common methods in today’s post.