<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Volodymyr Diachenko</title>
    <description>The latest articles on DEV Community by Volodymyr Diachenko (@v_diachenko).</description>
    <link>https://dev.to/v_diachenko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3826077%2F5c20251d-d108-41da-9c28-4a95ab3dac01.png</url>
      <title>DEV Community: Volodymyr Diachenko</title>
      <link>https://dev.to/v_diachenko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/v_diachenko"/>
    <language>en</language>
    <item>
      <title>Apollo vs Mercurius vs Yoga: I Benchmarked 10 Node.js GraphQL Setups (With and Without NestJS)</title>
      <dc:creator>Volodymyr Diachenko</dc:creator>
      <pubDate>Wed, 14 Oct 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/v_diachenko/apollo-vs-mercurius-vs-yoga-i-benchmarked-10-nodejs-graphql-setups-with-and-without-nestjs-4abg</link>
      <guid>https://dev.to/v_diachenko/apollo-vs-mercurius-vs-yoga-i-benchmarked-10-nodejs-graphql-setups-with-and-without-nestjs-4abg</guid>
      <description>&lt;p&gt;Choosing a GraphQL server for Node.js? I benchmarked &lt;strong&gt;Apollo, Mercurius and Yoga&lt;/strong&gt; on Express, Fastify and plain &lt;code&gt;node:http&lt;/code&gt;, each &lt;strong&gt;with and without NestJS&lt;/strong&gt;: 10 setups, same schema, same queries.&lt;/p&gt;

&lt;p&gt;This is a follow-up to my &lt;a href="https://dev.to/v_diachenko/i-benchmarked-nestjs-graphql-express-vs-fastify-vs-mercurius-heres-what-actually-won-47lh"&gt;NestJS GraphQL benchmark&lt;/a&gt; (Express vs Fastify, Apollo vs Mercurius). The most common question there was: &lt;strong&gt;"How much does NestJS itself cost? What if I drop it?"&lt;/strong&gt; So this time I added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;NestJS + GraphQL Yoga&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The same stacks without NestJS&lt;/strong&gt;: Express + Apollo, Fastify + Apollo, Fastify + Mercurius, Fastify + Yoga&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Yoga on Express&lt;/strong&gt; and &lt;strong&gt;Yoga standalone&lt;/strong&gt; on plain &lt;code&gt;node:http&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…and re-ran everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The GraphQL engine matters most.&lt;/strong&gt; Mercurius did &lt;strong&gt;1.3–1.8× the throughput&lt;/strong&gt; of Apollo in every query scenario, with about half the p99 latency on nested queries. Yoga landed in between on real queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The HTTP framework matters mostly for tiny queries.&lt;/strong&gt; With Apollo, Fastify beat Express by 18–29% on &lt;code&gt;health&lt;/code&gt; but only ~3% on &lt;code&gt;deep-nested&lt;/code&gt;. For Yoga, standalone, Express and Fastify were within a few percent on real queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NestJS adds no measurable overhead.&lt;/strong&gt; Each NestJS server is within −6% to +5% of the same stack without it, and which one wins flips from scenario to scenario.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mutations are the same everywhere&lt;/strong&gt; (~9,000–9,400 req/s).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📊 Interactive dashboard: &lt;a href="https://gql-bench.vercel.app/" rel="noopener noreferrer"&gt;https://gql-bench.vercel.app/&lt;/a&gt;&lt;br&gt;
💻 Code (run it yourself): &lt;a href="https://github.com/vovadyach/gql-bench" rel="noopener noreferrer"&gt;https://github.com/vovadyach/gql-bench&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What was tested
&lt;/h2&gt;

&lt;p&gt;Every server implements the same schema, data and resolvers. Only the stack changes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;NestJS 10&lt;/th&gt;
&lt;th&gt;Direct (no NestJS)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Express + Apollo&lt;/td&gt;
&lt;td&gt;Express + Apollo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Apollo&lt;/td&gt;
&lt;td&gt;Fastify + Apollo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;Fastify + Mercurius&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Yoga&lt;/td&gt;
&lt;td&gt;Fastify + Yoga&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Express + Yoga&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Yoga standalone (&lt;code&gt;node:http&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Scenarios:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;health&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tiny query: pure framework + GraphQL engine overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;single-user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1 user + posts + comments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;user-list&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10 users, nested&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deep-nested&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5 × 10 × 8 nested objects + some CPU work (~90 KB responses)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mutation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Write with body parsing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixed traffic&lt;/td&gt;
&lt;td&gt;Production-like query mix: 30% health, 25% single-user, 20% mutation, 15% user-list, 10% deep-nested&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Requests per second, &lt;strong&gt;median of 3 full runs&lt;/strong&gt; (higher is better):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;health&lt;/th&gt;
&lt;th&gt;single-user&lt;/th&gt;
&lt;th&gt;user-list&lt;/th&gt;
&lt;th&gt;deep-nested&lt;/th&gt;
&lt;th&gt;mutation&lt;/th&gt;
&lt;th&gt;mixed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NestJS Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;30,631&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;13,047&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4,397&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;902&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;9,065&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6,862&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;29,489&lt;/td&gt;
&lt;td&gt;12,889&lt;/td&gt;
&lt;td&gt;4,226&lt;/td&gt;
&lt;td&gt;887&lt;/td&gt;
&lt;td&gt;9,004&lt;/td&gt;
&lt;td&gt;6,769&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Yoga standalone&lt;/td&gt;
&lt;td&gt;20,994&lt;/td&gt;
&lt;td&gt;11,050&lt;/td&gt;
&lt;td&gt;3,562&lt;/td&gt;
&lt;td&gt;731&lt;/td&gt;
&lt;td&gt;9,072&lt;/td&gt;
&lt;td&gt;5,436&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Express + Yoga&lt;/td&gt;
&lt;td&gt;19,575&lt;/td&gt;
&lt;td&gt;11,109&lt;/td&gt;
&lt;td&gt;3,625&lt;/td&gt;
&lt;td&gt;730&lt;/td&gt;
&lt;td&gt;9,162&lt;/td&gt;
&lt;td&gt;5,388&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Fastify + Yoga&lt;/td&gt;
&lt;td&gt;17,854&lt;/td&gt;
&lt;td&gt;10,525&lt;/td&gt;
&lt;td&gt;3,548&lt;/td&gt;
&lt;td&gt;731&lt;/td&gt;
&lt;td&gt;8,988&lt;/td&gt;
&lt;td&gt;5,214&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NestJS Fastify + Yoga&lt;/td&gt;
&lt;td&gt;16,966&lt;/td&gt;
&lt;td&gt;10,084&lt;/td&gt;
&lt;td&gt;3,533&lt;/td&gt;
&lt;td&gt;753&lt;/td&gt;
&lt;td&gt;8,984&lt;/td&gt;
&lt;td&gt;5,151&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NestJS Fastify + Apollo&lt;/td&gt;
&lt;td&gt;21,937&lt;/td&gt;
&lt;td&gt;10,191&lt;/td&gt;
&lt;td&gt;2,831&lt;/td&gt;
&lt;td&gt;493&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9,444&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3,974&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Fastify + Apollo&lt;/td&gt;
&lt;td&gt;21,075&lt;/td&gt;
&lt;td&gt;9,560&lt;/td&gt;
&lt;td&gt;2,781&lt;/td&gt;
&lt;td&gt;484&lt;/td&gt;
&lt;td&gt;9,423&lt;/td&gt;
&lt;td&gt;4,055&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NestJS Express + Apollo&lt;/td&gt;
&lt;td&gt;17,032&lt;/td&gt;
&lt;td&gt;9,080&lt;/td&gt;
&lt;td&gt;2,703&lt;/td&gt;
&lt;td&gt;480&lt;/td&gt;
&lt;td&gt;9,378&lt;/td&gt;
&lt;td&gt;3,706&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct Express + Apollo&lt;/td&gt;
&lt;td&gt;17,856&lt;/td&gt;
&lt;td&gt;9,036&lt;/td&gt;
&lt;td&gt;2,706&lt;/td&gt;
&lt;td&gt;472&lt;/td&gt;
&lt;td&gt;9,145&lt;/td&gt;
&lt;td&gt;3,832&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;p99 latency on &lt;code&gt;deep-nested&lt;/code&gt;: &lt;strong&gt;68 ms&lt;/strong&gt; for Mercurius vs &lt;strong&gt;123 ms&lt;/strong&gt; for Fastify + Apollo.&lt;/p&gt;

&lt;h3&gt;
  
  
  NestJS vs direct, pair by pair
&lt;/h3&gt;

&lt;p&gt;Throughput of the direct version relative to the NestJS version:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pair&lt;/th&gt;
&lt;th&gt;health&lt;/th&gt;
&lt;th&gt;single-user&lt;/th&gt;
&lt;th&gt;user-list&lt;/th&gt;
&lt;th&gt;deep-nested&lt;/th&gt;
&lt;th&gt;mutation&lt;/th&gt;
&lt;th&gt;mixed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Express + Apollo&lt;/td&gt;
&lt;td&gt;+4.8%&lt;/td&gt;
&lt;td&gt;−0.5%&lt;/td&gt;
&lt;td&gt;+0.1%&lt;/td&gt;
&lt;td&gt;−1.8%&lt;/td&gt;
&lt;td&gt;−2.5%&lt;/td&gt;
&lt;td&gt;+3.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Apollo&lt;/td&gt;
&lt;td&gt;−3.9%&lt;/td&gt;
&lt;td&gt;−6.2%&lt;/td&gt;
&lt;td&gt;−1.8%&lt;/td&gt;
&lt;td&gt;−1.9%&lt;/td&gt;
&lt;td&gt;−0.2%&lt;/td&gt;
&lt;td&gt;+2.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;−3.7%&lt;/td&gt;
&lt;td&gt;−1.2%&lt;/td&gt;
&lt;td&gt;−3.9%&lt;/td&gt;
&lt;td&gt;−1.6%&lt;/td&gt;
&lt;td&gt;−0.7%&lt;/td&gt;
&lt;td&gt;−1.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Yoga&lt;/td&gt;
&lt;td&gt;+5.2%&lt;/td&gt;
&lt;td&gt;+4.4%&lt;/td&gt;
&lt;td&gt;+0.4%&lt;/td&gt;
&lt;td&gt;−3.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;td&gt;+1.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No consistent winner. NestJS adds dependency injection and a resolver layer, but once a request reaches the GraphQL engine, that layer costs about as much as run-to-run noise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Methodology
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Apple M1 Max, Node.js 24, single process per server, one server at a time&lt;/li&gt;
&lt;li&gt;k6, ramping to 50 virtual users, 30 s sustained load per scenario&lt;/li&gt;
&lt;li&gt;3,000 warmup requests per server (discarded), 5 s cooldown between servers&lt;/li&gt;
&lt;li&gt;Every GraphQL response validated; response sizes verified identical across servers&lt;/li&gt;
&lt;li&gt;All runs passed thresholds (&amp;lt;1% HTTP failures, &amp;lt;1% GraphQL errors)&lt;/li&gt;
&lt;li&gt;3 full runs, median reported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limits:&lt;/strong&gt; in-memory data (no database), one machine, single process. Absolute numbers will differ on your hardware; the ratios between servers are the useful part. With a real database, these differences shrink because I/O dominates.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what should you use?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Not using NestJS?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fastest:&lt;/strong&gt; Fastify + Mercurius, in every query scenario.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Like Yoga?&lt;/strong&gt; Its HTTP layer barely matters on real queries: standalone, on Express or on Fastify all landed within a few percent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On Apollo?&lt;/strong&gt; Prefer Fastify over Express for light queries, and expect Apollo to fall behind as queries get more nested.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Using NestJS?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Need more throughput?&lt;/strong&gt; Switch the driver to &lt;code&gt;@nestjs/mercurius&lt;/code&gt; on Fastify; it gave the biggest gain in every query scenario.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nestjs</category>
      <category>graphql</category>
      <category>node</category>
      <category>performance</category>
    </item>
    <item>
      <title>I Benchmarked NestJS GraphQL: Express vs Fastify vs Mercurius — Here's What Actually Won</title>
      <dc:creator>Volodymyr Diachenko</dc:creator>
      <pubDate>Mon, 16 Mar 2026 03:24:05 +0000</pubDate>
      <link>https://dev.to/v_diachenko/i-benchmarked-nestjs-graphql-express-vs-fastify-vs-mercurius-heres-what-actually-won-224m</link>
      <guid>https://dev.to/v_diachenko/i-benchmarked-nestjs-graphql-express-vs-fastify-vs-mercurius-heres-what-actually-won-224m</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Under sustained load, Mercurius is the clear winner, outperforming the other setups by 60–89% across all tested scenarios. But low-concurrency benchmarks tell a different story. The “best” choice depends heavily on how you test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://gql-bench.vercel.app" rel="noopener noreferrer"&gt;Live Dashboard&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://github.com/vovadyach/gql-bench" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;I benchmarked three NestJS GraphQL server configurations using the same schema, resolvers, and in-memory data generators. The only differences were the HTTP transport and GraphQL engine.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;HTTP Transport&lt;/th&gt;
&lt;th&gt;GraphQL Engine&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Express + Apollo&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-express&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Apollo Server 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Apollo&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-fastify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Apollo Server 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-fastify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mercurius 14&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All tests were run with k6 in sequential mode — one server at a time, using the full machine. Each run included 500 warmup requests, and every GraphQL response was validated.&lt;/p&gt;

&lt;p&gt;I used two benchmark profiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Quick: 10 VUs, ~3 minutes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standard: 50 VUs, ~20 minutes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Standard Results (50 VUs)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                        Express      Fastify        Mercurius
Health (light):         6,491        8,729 (+34%)   12,238 (+89%)
Single User (medium):   4,328        5,128 (+18%)    7,772 (+80%)
Paginated (heavy):      1,423        1,501  (+6%)    2,549 (+79%)
Deep Nested (extreme):    267          272  (+2%)      496 (+86%)
Mutation (medium):      5,598        7,000 (+25%)    8,930 (+60%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mercurius came out on top in every scenario.&lt;/p&gt;

&lt;p&gt;The most interesting result was not that Mercurius won — it was how little Fastify + Apollo improved over Express on heavy queries. In the more expensive scenarios, the gap was only around 2–6%, much smaller than I expected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3f83eylpcle0jzp85pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3f83eylpcle0jzp85pf.png" alt="Throughput comparison chart for Express, Fastify, and Mercurius across five GraphQL scenarios, showing Mercurius leading in every test"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Interesting Part: Quick vs Standard
&lt;/h2&gt;

&lt;p&gt;Same code, same machine, different load profile — different results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mutation (quick, 10 VUs):    Mercurius +2%    (barely wins)
Mutation (standard, 50 VUs): Mercurius +60%   (dominates)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mercurius scales better as concurrency increases. A low-concurrency benchmark doesn’t tell the full story.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reality Check
&lt;/h2&gt;

&lt;p&gt;These benchmarks focus on framework overhead, not full application behavior.&lt;/p&gt;

&lt;p&gt;There’s no database, no Redis, no external API calls, and no network latency. Everything runs against in-memory data so the comparison isolates the framework stack as much as possible.&lt;/p&gt;

&lt;p&gt;In a real application, resolvers often spend most of their time elsewhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PostgreSQL queries: +5–50ms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;external API calls: +50–200ms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;uncached or complex operations: often much more&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In that context, framework overhead may be only a small fraction of total latency.&lt;/p&gt;

&lt;p&gt;So while framework choice does matter, it matters most when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;your app is already well optimized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;throughput at scale is important&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;framework overhead is one of the remaining bottlenecks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your API feels slow today, your first win probably won’t come from switching frameworks. It will usually come from fixing query design, eliminating N+1 problems with DataLoader, improving caching, or reducing database and external API latency.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recommendation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mercurius&lt;/strong&gt; — if you want the best throughput and p99 latency under load. In these tests, it was the clear winner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Express + Apollo&lt;/strong&gt; — if you want the most familiar ecosystem or are optimizing for compatibility and fast prototyping.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fastify + Apollo&lt;/strong&gt; — if you need Apollo-specific features like federation and still want a moderate boost over Express (+6–34%).&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/vovadyach/gql-bench
&lt;span class="nb"&gt;cd &lt;/span&gt;gql-bench
npm run setup           &lt;span class="c"&gt;# ~20 min&lt;/span&gt;
npm run bench:quick     &lt;span class="c"&gt;# ~3 min&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or explore the &lt;a href="https://gql-bench.vercel.app" rel="noopener noreferrer"&gt;Live Dashboard&lt;/a&gt; — toggle frameworks, switch profiles, dive into scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;I’m extending this benchmark beyond Node.js to compare Go, C#, and Java against the same workload.&lt;/p&gt;

&lt;p&gt;The NestJS results were already interesting. The cross-language comparison should be even more revealing.&lt;/p&gt;

&lt;p&gt;Follow the &lt;a href="https://github.com/vovadyach/gql-bench" rel="noopener noreferrer"&gt;repo&lt;/a&gt;  if you want to see the next round of results.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with k6, NestJS 10, Apollo Server 4, Mercurius 14. Dashboard: Next.js + shadcn/ui + Recharts.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>graphql</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Benchmarked NestJS GraphQL: Express vs Fastify vs Mercurius — Here's What Actually Won</title>
      <dc:creator>Volodymyr Diachenko</dc:creator>
      <pubDate>Mon, 16 Mar 2026 03:24:05 +0000</pubDate>
      <link>https://dev.to/v_diachenko/i-benchmarked-nestjs-graphql-express-vs-fastify-vs-mercurius-heres-what-actually-won-47lh</link>
      <guid>https://dev.to/v_diachenko/i-benchmarked-nestjs-graphql-express-vs-fastify-vs-mercurius-heres-what-actually-won-47lh</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Under sustained load, Mercurius is the clear winner, outperforming the other setups by 60–89% across all tested scenarios. But low-concurrency benchmarks tell a different story. The “best” choice depends heavily on how you test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://gql-bench.vercel.app" rel="noopener noreferrer"&gt;Live Dashboard&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://github.com/vovadyach/gql-bench" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;I benchmarked three NestJS GraphQL server configurations using the same schema, resolvers, and in-memory data generators. The only differences were the HTTP transport and GraphQL engine.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;HTTP Transport&lt;/th&gt;
&lt;th&gt;GraphQL Engine&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Express + Apollo&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-express&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Apollo Server 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Apollo&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-fastify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Apollo Server 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fastify + Mercurius&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@nestjs/platform-fastify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mercurius 14&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All tests were run with k6 in sequential mode — one server at a time, using the full machine. Each run included 500 warmup requests, and every GraphQL response was validated.&lt;/p&gt;

&lt;p&gt;I used two benchmark profiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Quick: 10 VUs, ~3 minutes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standard: 50 VUs, ~20 minutes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Standard Results (50 VUs)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                        Express      Fastify        Mercurius
Health (light):         6,491        8,729 (+34%)   12,238 (+89%)
Single User (medium):   4,328        5,128 (+18%)    7,772 (+80%)
Paginated (heavy):      1,423        1,501  (+6%)    2,549 (+79%)
Deep Nested (extreme):    267          272  (+2%)      496 (+86%)
Mutation (medium):      5,598        7,000 (+25%)    8,930 (+60%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mercurius came out on top in every scenario.&lt;/p&gt;

&lt;p&gt;The most interesting result was not that Mercurius won — it was how little Fastify + Apollo improved over Express on heavy queries. In the more expensive scenarios, the gap was only around 2–6%, much smaller than I expected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3f83eylpcle0jzp85pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3f83eylpcle0jzp85pf.png" alt="Throughput comparison chart for Express, Fastify, and Mercurius across five GraphQL scenarios, showing Mercurius leading in every test" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Interesting Part: Quick vs Standard
&lt;/h2&gt;

&lt;p&gt;Same code, same machine, different load profile — different results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mutation (quick, 10 VUs):    Mercurius +2%    (barely wins)
Mutation (standard, 50 VUs): Mercurius +60%   (dominates)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mercurius scales better as concurrency increases. A low-concurrency benchmark doesn’t tell the full story.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reality Check
&lt;/h2&gt;

&lt;p&gt;These benchmarks focus on framework overhead, not full application behavior.&lt;/p&gt;

&lt;p&gt;There’s no database, no Redis, no external API calls, and no network latency. Everything runs against in-memory data so the comparison isolates the framework stack as much as possible.&lt;/p&gt;

&lt;p&gt;In a real application, resolvers often spend most of their time elsewhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PostgreSQL queries: +5–50ms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;external API calls: +50–200ms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;uncached or complex operations: often much more&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In that context, framework overhead may be only a small fraction of total latency.&lt;/p&gt;

&lt;p&gt;So while framework choice does matter, it matters most when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;your app is already well optimized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;throughput at scale is important&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;framework overhead is one of the remaining bottlenecks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your API feels slow today, your first win probably won’t come from switching frameworks. It will usually come from fixing query design, eliminating N+1 problems with DataLoader, improving caching, or reducing database and external API latency.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recommendation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mercurius&lt;/strong&gt; — if you want the best throughput and p99 latency under load. In these tests, it was the clear winner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Express + Apollo&lt;/strong&gt; — if you want the most familiar ecosystem or are optimizing for compatibility and fast prototyping.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fastify + Apollo&lt;/strong&gt; — if you need Apollo-specific features like federation and still want a moderate boost over Express (+6–34%).&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/vovadyach/gql-bench
&lt;span class="nb"&gt;cd &lt;/span&gt;gql-bench
npm run setup           &lt;span class="c"&gt;# ~20 min&lt;/span&gt;
npm run bench:quick     &lt;span class="c"&gt;# ~3 min&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or explore the &lt;a href="https://gql-bench.vercel.app" rel="noopener noreferrer"&gt;Live Dashboard&lt;/a&gt; — toggle frameworks, switch profiles, dive into scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;I’m extending this benchmark beyond Node.js to compare Go, C#, and Java against the same workload.&lt;/p&gt;

&lt;p&gt;The NestJS results were already interesting. The cross-language comparison should be even more revealing.&lt;/p&gt;

&lt;p&gt;Follow the &lt;a href="https://github.com/vovadyach/gql-bench" rel="noopener noreferrer"&gt;repo&lt;/a&gt;  if you want to see the next round of results.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with k6, NestJS 10, Apollo Server 4, Mercurius 14. Dashboard: Next.js + shadcn/ui + Recharts.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>graphql</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
