Systems | Development | Analytics | API | Testing

AppSignal

Calling Ruby Methods in C: Avoid Memory Leaks

Memory leaks are a pain for gem users. They are hard to track and can lead to expensive infrastructure costs. Memory leaks within a C extension are even worse. You'll see a lot of tools and articles about finding leaks in Ruby. However, you don't have the same access to internals in C. A naive usage of rb_funcall can cause memory leaks: it's much better to use rb_protect instead. So, if you are a C extension writer, please read on for the sake of developers who will use your gem. Let's get started!

How To Instrument Your Elixir Application with AppSignal

Instrumentation is an essential part of monitoring and operating an application, especially for apps heavily used in production. Even in today's everchanging technology landscape, visibility and observability still challenge developers and system administrators. Metrics and logging are essential for monitoring and operating an application. Metrics measure an application's performance and system health, while logging records system health and application state.

Secure Your AWS Lambdas with TypeScript

In the previous part of this series, we optimized our Lambda function. However, our API is open to the public — anyone with the URL can use it and get a response. In this take, we are going to secure our API using a tool called Amazon Cognito. This will only allow authenticated users access to our endpoints. Ready? Let’s go!

How to Parse Arguments in Your Ruby C Extension

Ruby is a wonderful language, made for humans first and machines second. It is easy to read and write. There are plenty of ways to write anything, and you can often guess its standard library by typing the name of the method you would have chosen yourself. Because of this, Ruby's arguments are very flexible, which lets us express our APIs very clearly. But this comes with a drawback: Ruby is quite hard to parse for C extension developers!

Create a Business Language for a Rails Application

As web developers, we tend to approach problems with traditional low-risk solutions. When all you have is a hammer, everything looks like a nail. When you need complex input from the user, you use a form and JSON representation (even if, in retrospect, it is not the most efficient solution). In this post, we'll take a different approach. We'll leverage some tooling to create a business language that extends the functionality of a Rails application. Let's get started!

Debugging and Tracing in Erlang

In part one of this series, the debugging tools we used — Elixir's IO.inspect/2, IEx.pry, and dbg/2 — required us to insert changes into code directly. Outside the development environment, you probably won't (and shouldn't) have access to your code. Erlang has a few tools to debug code at runtime: :debugger, :dbg.tracer, and :observer. First, let's look at the:debugger, a graphical debugging tool. Let's get going!

A Guide to Memoization in Ruby

Memoization is a caching technique to make your Ruby application run more efficiently and faster. In this post, we'll look at the benefits of memoization and when to use it in your Ruby application. We'll also look at some memoization mistakes to avoid. Let's first start by looking at code optimization — what it is and some of the different optimization techniques available.

How to Cache Locally in Elixir with Nebulex

In an Elixir application, you might need to access certain data frequently, which can be costly. The access time involved in retrieving data at every step can cause high latency, or even make the application crash (due to an increased workload on the database). Caching is the best technique to store the most frequently accessed data and minimize database data retrieval, improving the overall performance of the application.

Database Performance Optimization and Scaling in Rails

Web applications usually rely heavily on databases, for the most part. And as applications grow, databases grow too. We keep scaling web servers and background workers to keep up with the heavy load. But eventually, the database needs to keep up with all the new connections from these processes. One way to tackle this is to grow a database with an app using vertical scaling. This means adding more CPU power and memory to the database server. But this is usually slow.