21st November 2019
There is nothing I love more than to see an open source project growing from a personal passion to one that captures the interest of thousands of others and has the potential to make a big difference. Yesterday’s announcement about Fastify joining the Open JS Foundation’s incubator program is a major step in one such project. This is a tremendous accolade for everyone who has contributed to the project that started 3 years ago.
Fastify is fully made in Italy, between Udine and Forlì, where co-creator Tomas Della Vedova and I live respectively. Fastify was born out of a desire to create a general-purpose web framework that would provide a great developer experience without compromising on throughput and performance, something anyone could build extremely fast HTTP APIs with low overhead. The ultimate intent was that Fastify would improve the throughput of many web and mobile applications in commercial use. In doing so, not only could we make happy users but also happy developers!
Today, Fastify continues to be sponsored by us at NearForm and already has 12.5K GitHub stars and 804 GitHub forks. It is being used by many NearForm clients, large global brands and – in some cases – supporting noble humanitarian cases such as the Hospitalrun application that we recently covered in our Tech Stack Talks with lead maintainer Maksim Sinik.
What is driving this rapid adoption?
The main benefits proven and quoted by users are the increased speed and the reduction in overhead, the plug-in system and developer satisfaction. You can read more about these below but they make the project a perfect candidate for the Open JS incubator program. Not only will this program provide the project with the focus it needs, raising awareness to attract more contributors and maintainers, but it will allow the project to achieve the scale we believe it deserves to allow it to flourish and open new opportunities for the world of software development.
Reduction in Overhead & Increase in Speed
Fastify uses fast-json-stringify to double the throughput of the rendering of JSON, and find-my-way to reduce the routing by a factor of 10 compared to alternatives. A Fastify server adds no overhead to Node.js core, and it could halve your cloud server bill compared to other frameworks. A good chunk of the speed increase in Fastify comes from the findings described in my ‘Reaching Ludicrous Speed’ talk
Fully encapsulated plug-ins
Fastify offers a plug-in system that adds full-encapsulation so that each plug-in can use its own dependencies and hooks if it wants to. This enables greater software reuse and decoupling. Furthermore, the plug-in model is based on reentrant locks and graph-based, it perfectly handles asynchronous code and it guarantees the load order and the close order of the plug-ins.
Fastify has a wide range of plug-ins already developed, including those for template rendering, React integration, GraphQL support, serving static files, and database drivers.
The third key benefit – but by no means the least important – is the developer experience. The framework is stable and powerful and has a clear vision – one that doesn’t stop here and one that I am excited about with the added support of the OpenJS Foundation.
Fastify is a perfect example of open source building on open source thanks to the proven governance model that oversees collaboration between individuals in the community. Just as with Node.js, the sheer power of numbers in Open Source communities means that the framework can continue to grow and evolve to meet enterprise and developer needs.
As a Technical Director at NearForm, Matteo Collina consults for some of the top brands of the world. Matteo is a member of the Node.js Technical Steering Committee focusing on streams, diagnostics and http. He is also the author of Node.js MQTT Broker, Mosca, the fast logger Pino and of the Fastify web framework.