<?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.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>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>
