React 18+ introduced renderToPipeableStream, a powerful API for streaming server-rendered HTML to the browser. Instead of waiting for the entire page to render before sending it to the client, you can start sending HTML as soon as it's ready. In this article, we'll build a minimal Fastify server...
The hardest part of my job is thinking like a malicious user... or like an AI in its early stages of writing HTTP servers!This exercise is not easy because I love my clients' HTTP requests, and I'm sure they love my server!But that is not always the case... for this reason, we must be prepared to...
I was looking at the Fastify plugin list and found myself asking, "What is this @fastify/request-context plugin?"So, I checked it out, and here I am, writing a post about it to share what it is and how it can be useful for you! What is AsyncLocalStorage? Managing state across asynchronous...
Dear Backend.cafe readers, I have something special for you! If you've ever wanted to master Fastify, the lightning-fast Node.js framework, you're in for a treat. Today, I’m launching Fastify Mini Course—a free resource designed to help you build high-performance APIs efficiently. 🚀 Why Fastify?...
We are excited to announce that the Node.js Cookbook, 5th Edition is set to be released on November 15th, 2024! This latest edition, authored by Bethany Griggs, is the ultimate guide for developers who want to master the Node.js v22 API and build scalable, high-performance applications. The...
In April 2021, I tweeted about a quick experiment where I streamed a large GoPro video using Fastify. That initial experiment sparked some interest, and just a few months ago, a user reached out with an intriguing question: how could they modify the code to support stream segmentation?...
In today's digital landscape, chatbots have become a ubiquitous part of our online interactions. These versatile and intelligent programs help automate tasks, answer queries, and provide a seamless conversational experience. One popular platform for developing chatbots is Telegram, known for its...
Fastify v4.23.0 has just been released, featuring a brand-new onListen Application hook. In this article, we'll explore what it is and how you can leverage it in your Fastify applications. Understanding Fastify hooks Fastify's hooks are a fundamental aspect of its design. Hooks are functions that...
In recent years, we have been surrounded by cool, interactive data visualizations. These visualizations are powered by datasets stored in databases and made available through APIs. Clients can then query the API and get the data they need to render the visualization. But what happens when the...
Are you a mid/expert back-end engineer looking to build highly scalable and maintainable API servers? Are you already familiar with Node.js and other back-end frameworks? If so, then "Accelerating Server-Side Development with Fastify" is the book you've been waiting for! About the Authors: Meet...
If you are an hapi developer, you may know the joi library. It is a powerful validation library that allows you to define programmatic schemas for your data and validate them with ease. One of the hardest things about migrating from hapi to fastify is the complexity that’s involved for you to be...
As a backend developer, logging is essential to monitoring and debugging applications. Traditionally, changing an application's log level required restarting it or modifying the configuration and redeploying it. However, there are scenarios where changing the log level at runtime becomes necessary...
Me (Manuel Spigolon), Maksim Sinik and Matteo Collina are thrilled to share some exciting news with the Fastify community! After two years of hard work and dedication, we are delighted to announce the official release date of our book! 'Accelerating Server-Side Development with Fastify' will be...
If you're using Fastify with Mercurius as your GraphQL adapter, you may be looking for some advanced usages. In this article, we'll explore a real world example with Dynamic GQL queries with Mercurius. The example we will discuss is only one scenario that you may encounter as Software Engineer at...