Systems | Development | Analytics | API | Testing

AppSignal

5 Tips to Design Ruby on Rails Transactions the Right Way

Data integrity problems are among the most common database issues Rails developers face. Besides allowing for proper validation, correctly designed transaction blocks ensure that your data isn't partially created or updated. However, transactions can also harm your application — or even take down your whole database — when not properly designed. This article offers a set of good practices for working with transactions.

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.

Build Serverless APIs with Node.js and AWS Lambda

AWS Lambda has been around for a few years now, and it remains the most popular way to experiment with serverless technology. If you're not familiar with serverless, it's a model of development in which managing, provisioning, and scaling servers is abstracted away from application development. Servers do exist in a serverless world, but they are completely managed by the cloud provider, allowing developers to focus on packaging their code for deployment.

The Perils of Parallel Testing in Ruby on Rails

Have you ever heard someone complain about their tests being too fast? Me neither. Fast tests mean fast feedback. Whether you run them locally or in a continuous integration pipeline, the earlier your tests finish, the earlier you can react to failures and improve your code. Besides the productivity gains, it is well known that slow tests make developers grumpy. Nobody likes their developers grumpy. With all that said, creating a lightning-fast test suite isn't always as easy as you'd hope.

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!

Import Maps Under the Hood in Rails 7

Import maps is the new feature in Rails 7 that allows us to say goodbye to Node.js and tools like Webpack. There's no need for bundling anymore. With this new mechanism, you can still manage your JavaScript libraries with a specific version. Instead of one big file, though, your application serves many small JavaScript files. It’s essential you know how import maps work to benefit from the newest version of Rails (but don’t worry, you can still use tools like Webpack instead).

Patterns and Anti-patterns in Node.js

Node.js is a backend JavaScript runtime built on Chrome's V8 engine that's asynchronous and event-driven by nature. It's relatively simple to create a REST API with Node.js and use frameworks like Express.js. With this simplicity comes a lot of flexibility. However, you can get side-tracked on what patterns to follow when building scalable network-driven applications. This article focuses on some of the patterns and best practices to follow when building Node.js applications.

Dependency Injection in JavaScript: Write Testable Code Easily

I struggled with two aspects of software development as a junior engineer: structuring large codebases and writing testable code. Test-driven development is such a common technique that is often taken for granted, but it's not always clear how code can be made fully testable. I remember reading examples where an author would cleanly unit test a function, and in principle, it made sense. But real code doesn't look like those examples.

Delayed Job vs. Sidekiq: Which Is Better?

Most applications need background jobs for mailers, regular clean-ups, or any other time-consuming operation that doesn't require a user to be present. Several gems support job queues and background processing in the Rails world — Delayed Job and Sidekiq being the two most popular ones. In this post, we will take a detailed look at Delayed Job and Sidekiq, including how they fare against each other. Let's go!

An Introduction to Deno: Is It Better than Node.js?

Deno is a JavaScript and TypeScript runtime similar to Node.js, built on Rust and the V8 JavaScript engine. It was created by Ryan Dahl, the original inventor of Node.js, to counter mistakes he made when he originally designed and released Node.js back in 2009. Ryan's regrets about Node.js are well documented in his famous'10 Things I Regret About Node.js' talk at JSConf EU in 2018.