Category

Fastify

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.