Systems | Development | Analytics | API | Testing

AppSignal

Predictable Code in Elixir: Expressions as Reducers and Macros

In the first part of this series on maintainable Elixir code, we started by applying rules for code predictability in our code design. We immediately saw an emerging pattern: a series of transformations on state. In this part, we'll explore this pattern further. We'll first learn how to write expressions as reducers. Then we'll use metaprogramming to make use of reducers and enforce code style seamlessly. Finishing up, we'll see an example where all the pieces fit together. Let's get going!

Build a CRUD App with Node.js and MongoDB

Choosing the right tool for a web application can be tricky. But if you do, it will make things a lot easier for you. Depending on your application, combining Node.js and MongoDB works well most of the time — especially if you use a front-end framework like React (MERN), Angular (MEAN), or Vue (MEVN). In this tutorial, you will learn how to create a CRUD application using Node.js and MongoDB and write some basic tests for your Node.js API.

A Deep Dive into Memory Leaks in Ruby

In the first part of this two-part series on memory leaks, we looked at how Ruby manages memory and how Garbage Collection (GC) works. You might be able to afford powerful machines with more memory, and your app might restart often enough that your users don't notice, but memory usage matters. Allocation and Garbage Collection aren't free. If you have a leak, you spend more and more time on Garbage Collection instead of doing what you built your app to do.

Write a Standalone CLI Application in Elixir

While Elixir is frequently associated with web development, this is not where its capabilities end. As a general-purpose language, it can be used for virtually anything. You don't have to take my word for it — projects such as Nerves, Nx, Scenic, or LiveBook speak for themselves. But today, we will focus on something different: writing a command-line application in Elixir and preparing it for distribution.

Connect a Ruby on Rails App with React in a Monolith

More and more people are using Ruby on Rails to create a back-end API application for a front-end app. But what if you want to create a rich and functional interface with JavaScript and use Rails for the back-end, without having them in separate repositories? You can create a monolithic Rails application. This article will show you how to connect a Rails application with a front-end developed in React (without splitting the code into two separate applications).

All You Need to Know about EdgeDB

Today, non-relational, schemaless data models dominate the domain of databases. Non-relational databases are more developer-friendly and scale better than the relational databases of the past. However, it is harder for them to do complex tasks. Now we have a new player in the game to address this issue: EdgeDB. EdgeDB is built on top of PostgreSQL and introduces a new conceptual model for representing data.

How to Track Down Memory Leaks in Ruby

A memory leak is an unintentional, uncontrolled, and unending increase in memory usage. No matter how small, eventually, a leak will cause your process to run out of memory and crash. Even if you periodically restart your app to avoid this crash (no judgment, I've done that!), you still suffer the performance implications of a memory leak.

How to Write a Functor in Elixir

There’s a function called Enum.map in Elixir that works on multiple collection types, but it's not without its issues. In this post, I will introduce you to a concept from functional programming called a functor. We’ll make a Functor protocol with a function called fmap that will aspire to be a better version of Enum.map. Note: The article is inspired by the Witchcraft library, which we covered in one of our previous posts. But first: what's the problem with Enum.map exactly?

An Introduction to Multithreading in Node.js

Computers are becoming more powerful, thanks to GPUs and multi-core CPUs. Equally, applications are getting more complex as they leverage threads (independent execution units in a process) for maximum application performance and responsiveness. In this article, we will explain what multithreading is, and how Node.js handles asynchronous operations using the event loop and worker pools. We'll also discuss how to use the Node.js worker-threads module to create and manage threads. Let's get started!

Writing Predictable Elixir Code with Reducers

This is the first part of a two-part series about maintainable code in Elixir. In this part, we will show how code predictability plays a crucial role in a project's short and long-term health. We will use Elixir's built-in features for this, like the pipe operator, tuples, and with blocks. First, we'll explain what predictability is and why it is so important. Then we will go through some tools that Elixir already has and how you can use them to write better code.