Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
November 15, 2021

GraphQL Caching and other Adventures in Nodeland - Issue #35

Hi Everyone! Another week in this “impossible” November has passed - my current workload is very high at the minute.. I hope the content you’ll find this week is quite interesting.

Mercurius

I have been preparing a new talk on GraphQL caching and I assembled some benchmarks on the impact a “simple” solution like the one in mercurius-cache implement can make a difference in your GraphQL deployment. The “easy” improvement you can get is 4x, which is pretty impressive:

Here is the PR adding the benchmark. Note that the PR had a bug / the time was incorrectly represented as milliseconds while it was seconds instead.

Added benchmarks by mcollina · Pull Request #34 · mercurius-js/cache · GitHub
Added benchmarks by mcollina · Pull Request #34 · mercurius-js/cache · GitHub
4x more throughput with 1 ms TTL. Pretty great.
github.com

Last week I shipped a new release of Mercurius: v8.9.0 and then v8.9.1.

Release v8.9.0 · mercurius-js/mercurius · GitHub
Release v8.9.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.9.0 · mercurius-js/mercurius
github.com
Release v8.9.0 · mercurius-js/mercurius · GitHub
Release v8.9.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.9.0 · mercurius-js/mercurius
github.com
Release v8.9.1 · mercurius-js/mercurius · GitHub
Release v8.9.1 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.9.1 · mercurius-js/mercurius
github.com
Release v8.9.1 · mercurius-js/mercurius · GitHub
Release v8.9.1 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.9.1 · mercurius-js/mercurius
github.com

Fastify

Release v3.24.0 · fastify/fastify · GitHub
Release v3.24.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com
Release v3.24.0 · fastify/fastify · GitHub
Release v3.24.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com

We release v3.24.0 today that ships with a nice improvement on reply.getResponseTime() which makes it deterministic after the response has been sent.

Node

Release v4.10.0 · nodejs/undici · GitHub
Release v4.10.0 · nodejs/undici · GitHub
An HTTP/1.1 client, written from scratch for Node.js - Release v4.10.0 · nodejs/undici
github.com
Release v4.10.0 · nodejs/undici · GitHub
Release v4.10.0 · nodejs/undici · GitHub
An HTTP/1.1 client, written from scratch for Node.js - Release v4.10.0 · nodejs/undici
github.com

Events

On November 25th I’m going to present Fastify at the “JavaScript Congress”!

Join me at WeAreDevelopers JavaScript Congress! I will demo @fastifyjs and provide a sneak-peak to some of the most advanced features!

Useful modules

Have you got a favorite module that migrated to ESM and you cannot migrate to ESM just yet? This module is for you:

fix-esm
fix-esm
If you’re here, you’ve probably run into this kind of error: internal/modules/cjs/loader.js:1015 throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
www.npmjs.com

News

Read up this article on the impact of the drop of storage cost vs CPU. We live in a brave new world for database access. I’m not necessarily like the conclusion to just use DynamoDB but it’s definitely something to keep in mind.

Have you ever seen an Agile process went really bad? Here is a long story on what looks like, how to detect it… and when to “run”.

The unmistakable signs you are participating in Fake Agile theater!
The unmistakable signs you are participating in Fake Agile theater!
You have 2 free member-only stories left this month. It’s 8.25 AM. I’m 5 minutes early for the Daily Scrum.
medium.com
The unmistakable signs you are participating in Fake Agile theater!
The unmistakable signs you are participating in Fake Agile theater!
You have 2 free member-only stories left this month. It’s 8.25 AM. I’m 5 minutes early for the Daily Scrum.
medium.com

I love the depth of technical articles that are published on CloudFlare blog. They are amazing. This one shows the kind of challenges and solutions they need to face and implement every day. I’m a fan.

The tale of a single register value
The tale of a single register value
“Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.” — Sherlock Holmes Intro
blog.cloudflare.com
The tale of a single register value
The tale of a single register value
“Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.” — Sherlock Holmes Intro
blog.cloudflare.com

A friend linked me this 2020 article about GraphQL directives, their history and usage. I think it’s a worth read:

GraphQL directives are underrated - LogRocket Blog
GraphQL directives are underrated - LogRocket Blog
The internet is lousy with articles about what sets GraphQL apart from other APIs, namely REST. They all tout it for its strong type system, excellent developer experience, premier tooling, and ability to iterate rapidly on the schema, all without under- or overfetching.
blog.logrocket.com

I often get asked how secure is GraphQL. It’s paramount that every GraphQL resolvers is wrapped to provide its own authorisations checks, similar to what we do with mercurius-auth. Read up at:

GraphQL's Greatest Strength is Also its Greatest Weakness - DevOps.com
GraphQL's Greatest Strength is Also its Greatest Weakness - DevOps.com
As a single doorway to many underlying systems, GraphQL requires added security forethought and careful application of user authorization.
devops.com
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn