Skip to main content
Category

Fastify

Insights from the 2022 Fastify Survey

By Blog, Fastify, Project Updates

Survey finds web framework for Node.js is fast and performant

After the challenges that so many have faced the last few years, we really appreciate that so many Fastify users found the time to complete this survey. Fastify is a web framework for Node.js to help increase web performance, and is hosted by the OpenJS Foundation. Our community is everything, and getting feedback like this helps us to maintain and improve Fastify.

We had 108 respondents participate in this year’s survey, and surprising to no one,  the majority work in software or development, or are studying in those areas.

Most respondents found Fastify through GitHub, where Fastify’s repos reside. It is encouraging to see that Fastify is also being discovered through other mediums, which indicates a growing awareness of Fastify that will hopefully lead to more adoption and activity around the framework!

Where Fastify Excels

As the name of the framework implies, Fastify is fast and performant. Respondents overwhelmingly cited this as the reason why they enjoy using Fastify in their projects. Other positives included:

  • Active development and community
  • Documentation
  • Ease-of-use and simplicity
  • Growing plugin ecosystem
  • Support for modern JavaScript features
  • TypeScript support
  • Matteo Collina’s involvement as lead maintainer

These helpful features and benefits have been the result of years of work by maintainers and contributors alike, so we’d like to extend a big thank you to everyone who has been involved with Fastify! Also, thanks to Matteo Collina (Twitter: @matteocollina) for being so charming that he brings all the users to the yard.

Respondents also indicated a high level of satisfaction with Fastify across the board:

Where Fastify Can Improve

We know that “perfection isn’t attainable but if we pursue it we can attain excellence.”  So we asked what improvements users would like to see in future releases.

Requests for additional TypeScript support far outweighed any other, with requests for more examples and clarity in documentation ranking second in priority. 75% of respondents stated they use TypeScript, so this is not surprising!

V4 of Fastify resolves some of these grievances, with new automatic types for query strings and bodies, fixes for missing types, typed decorators, and more. One of the responses requested support for hot reloading, which is currently being explored through tooling like restartable!

The overall sentiment of this feedback has been positive. As Fastify progresses into V4 and beyond we hope that we can remove pain points in Fastify that users have highlighted in their responses, whilst continuing to provide the high-performance users have come to expect!

Many thanks to Alix Robinson and Matteo Collina for preparing the survey. This article was brought to you by Frazer Smith.

OpenJS World: A “Fast” Introduction to Fastify

By Blog, Event, Fastify, OpenJS World

During OpenJS World, which was held virtually in June 2021, we heard from many inspiring people involved in all areas of technology, including Matteo Collina from Fastify. We hope to highlight speakers in a way that allows for people to hone in on the part of the talk that interests them the most.

Open source projects are as good as their communities. Matteo Collina from NearForm provided the OpenJS World audience a great explainer on Fastify. Fastify is a web framework for Node.js. It is open governance, community-first, and shared ownership. They want their users to share, contribute to the project. There is a shared effort to spread the effort among the companies using it, which is key. They have good and lofty technical principles. They have a similar speed to Node.js core, and faster than other methods.

Fastify runs through two different types of plugins, Core and ecosystem. Core is supported by organizations and ecosystem is supported by members of the community. The key difference is that Core plugins work on everything, while ecosystem plugins work on individual problems. They improve performance so much because they implement a horizontal model, where you segregate the complexity into smaller parts. The system is a step towards microservices, as well as a move away from monolith systems.

Matteo goes into the internal parts, and how plugins allow for reusability and encapsulation. This is the part that increases speed. He also talks about a predefined lifecycle, so that only the parts that need to be executed are. These plugins also allow for separation and allow for better organization. There is also out-of-the-box serialization as well as validation through Avj and internal testing.

Full Video here

Broken down by section

Twitter handle 0:30

Importance of community 1:36

What is fastify? 2:45

Core Values 3:40

Why a shared effot? 5:05

Techincal principles of Fastify 6:17

How fast is Fastify? 7:58

Mercurius graphql adapter 9:28

Core vs Exosystem plugins 9:39

Target architecture 10:50

Internals 13:02

Plugin explained 14:06

Request lifecycle and recommended project structure 15:35

Plugin separation visualized 16:35

Serilaization 17:57

Validation and testing 18:24

Live coding 19:42

Dressed to Impress: NET-A-PORTER, Mr Porter and JavaScript Frameworks

By Blog, Case Study, Fastify, OpenJS In Action

For this OpenJS In Action, Robin Glen, Principal Developer for YNAP joined the OpenJS Foundation Director Robin Ginn to discuss their use of JavaScript in building a global brand. YNAP is the parent company of luxury retailer NET-A-PORTER. Glen works within the Luxury division team at NET-A-PORTER (NAP), working on NET-A PORTER and Mr Porter. He has been with NAP for over 10 years. In addition to his work with NAP, Glen is also a member of the Chrome Advisory board.

Glen has been leading the developer team at YNAP for almost a decade, and continues to test, iterate and implement cutting edge open source technologies. For example, he was an early adopter of the Fastify web framework for Node.js to help increase web performance, particularly with the demand spikes his company experiences during holidays and sales.

Topics ranged from ways to make the user experience feel more pleasant and secure, to issues around Javascript bloat. Questions focused on the history of NAP, how NAP chose their current framework, and how that framework allows them to best service customers in their e-commerce site. 

The full interview is available here: OpenJS In Action: NET-A-PORTER, Mr Porter and JavaScript Frameworks 

Timestamps

0:00 Brief Introduction

2:09 Technology and NET-A-PORTER 

3:11 Defining Architectural Moment

4:50 Where YNAP is Today

6:50 Factors in Choosing Technologies? 

10:30 Fastify

14:00 YNAP and JS Foundation

15:10 Looking Forward: Engineering Roadmap  

18:58 What’s a “Good Day At Work” for you?

20:00 Wrap-Up

Fastify: Graduation, performance and the future

By Blog, Fastify, Project Update

Fastify is moving from Incubation stage to a Growth Project! Within the OpenJS Foundation, this is a major step forward.

New projects at OpenJS start as incubation projects while maintainers complete the on-boarding checklist to join the Foundation. This includes documenting its infrastructure, transferring the IP, and adopting the OpenJS Code of Conduct. When a project graduates, they’ve readied their project for Foundation support. At OpenJS, we share best practices and reduce redundant administrative work across projects, such as non-technical governance, to help projects grow.

The Cross Project Council (CPC) centralizes coordination among projects as well as certain technical governance and moderation processes, and oversees the progression of projects between stages of their life cycles. Fastify has passed all of its requirements and we are happy to welcome them as a Growth Project!

To find out more about Fastify and what’s next, we talked with Matteo Collina, one of the Lead Maintainers of the Fastify team, Technical Director at NearForm, Node.js Technical Steering Committee member and OpenJS Foundation Cross Project Council member.

Are there any benchmarks that people should pay attention to regarding web performance?

I often say that “performance does not matter, until it absolutely does.” Most websites and applications do not need to be fast or scale to thousands of servers. Most developers at small and big companies alike will not (and should not) care about performance at all. Their bigger concerns are maintainability and speed of delivery. As a result, applications become bigger and slower.

As an example, a lot of developers care only about the latency of a single request when the server is idle, completely avoiding the latency and load introduced by server-side processing. Providing a snappy user experience requires both the front end and the backend to work in concert and play to each other strengths.

What are the most important metrics people should pay attention to with regard to web performance (faster networks, run time)?

The most important metric for Node.js applications is event loop latency. We define this as the time needed to process some part of an incoming http request. The higher the throughput of our application, the smaller this needs to be. Let’s make a quick example. Let’s imagine a Node.js server that can process an http request in 10 milliseconds of CPU time. Do you think this server is fast? Given that most deployments have 1 CPU per container (or even less), we can say that a single container can process around 100 requests per second.

However, we cannot say if our server is fast or slow, as it depends on the load. If our server will receive less than 100 req/sec it would appear snappy and “fast.” But if it’s over 100 req/sec, the service will now “lag behind” and the latency of every request will start increasing.

Fastify helps deploy Node.js applications at scale by applying some load-shedding techniques in the under-pressure plugin. Essentially if the server is busy it will start rejecting requests: the load balancer will try to serve them from another instance.

Now that Fastify has graduated incubation, what’s next for the project in terms of big milestones?

We’ll rest and recover! The last few months has been a race to ship Fastify v3, and now we are graduating!

It’s time to start planning Fastify v4 for 2021.

Project News: Fastify ships v3

By Blog, Fastify, Project Update

Fastify, an incubation project at the OpenJS Foundation, has just released it’s latest version, Fastify v3. 

Fastify is the fast, open source Node.js web framework that focuses on low-performance overhead, an excellent developer experience, and a flexible plugin architecture.

Key updates include:

1. Better support for Typescript

2. Ability to embed Express (for reusing custom modules/libraries)

3. Simplified validation support with schema references

Read about all the details on the Fastify Blog, and hear it directly from Matteo Collina,  one of the Lead Maintainers of the Fastify team, Technical Director at NearForm, Node.js Technical Steering Committee member and OpenJS Foundation Cross Project Council member.