<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Devang Bhagdev on Medium]]></title>
        <description><![CDATA[Stories by Devang Bhagdev on Medium]]></description>
        <link>https://medium.com/@devang.bhagdev?source=rss-6978c87bd07f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vAof8x2zBxtH60GF.</url>
            <title>Stories by Devang Bhagdev on Medium</title>
            <link>https://medium.com/@devang.bhagdev?source=rss-6978c87bd07f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:10:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devang.bhagdev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Express vs NestJS vs Fastify: API Performance Face-Off with 100 Concurrent Users]]></title>
            <link>https://medium.com/@devang.bhagdev/express-vs-nestjs-vs-fastify-api-performance-face-off-with-100-concurrent-users-22583222810d?source=rss-6978c87bd07f------2</link>
            <guid isPermaLink="false">https://medium.com/p/22583222810d</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[fastify]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[nestjs]]></category>
            <dc:creator><![CDATA[Devang Bhagdev]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 08:06:24 GMT</pubDate>
            <atom:updated>2025-06-11T18:40:30.967Z</atom:updated>
            <content:encoded><![CDATA[<h4>When building high-performance APIs in Node.js, developers often turn to frameworks like Express, NestJS, and Fastify. But which one truly performs best under load?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPcY8PDyao1-yQtRc-Gzqg.png" /></figure><p>In this blog, I’ll walk you through a simple benchmark comparing these three frameworks under the same load conditions using <strong>Autocannon</strong>, a powerful HTTP bench-marking tool.</p><h3>🛠 Test Setup</h3><p>To ensure a fair comparison, I created the same basic API endpoint (GET /) in all three frameworks. Each endpoint simply returned a small JSON response like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*P8uedYs-uewu3blasJmFGw.png" /></figure><h3>Environment:</h3><ul><li><strong>Machine</strong>: [8-core CPU, 16GB RAM]</li><li><strong>Node.js Version</strong>: v20.18.1</li><li><strong>Benchmarking Tool</strong>:<a href="https://github.com/mcollina/autocannon"> autocannon</a></li></ul><p><strong>Test Command</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*NqQqQZAKVY8H9bNx" /></figure><ul><li>100 concurrent users</li><li>30-second test duration</li></ul><h3>🧪 Benchmark Results</h3><p>Here are the results from the Autocannon tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Es2J1KGizccCHcIedsUL-A.png" /></figure><p><strong>Express.js</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*xr2KTi9cjBoqk8fL" /></figure><p><strong>NestJS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*KFtzMKWk_1fSnxaT" /></figure><p><strong>Fastify</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*dLUTNNQn52DfGGPN" /></figure><h3>🧩 Code Snippets</h3><p>Each server was kept as minimal as possible. Here’s what the basic route looked like in each:</p><h3>Express</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*21WwHNmwaOjfjF9n" /></figure><h3>NestJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*2Y9MByhxc3SvI-eP" /></figure><h3>Fastify</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*LYErtHYv-WwAa9LO" /></figure><h3>📊 Analysis</h3><p>Fastify <strong>blew the competition away</strong> with more than <strong>2.7x the requests</strong> compared to Express and NestJS. Why?</p><ul><li><strong>Fastify</strong>: Built from the ground up for speed with a focus on low overhead and optimized serialization.</li><li><strong>NestJS</strong>: A robust framework built on top of Express (or Fastify), with added abstraction layers like decorators and dependency injection, which slightly impacts performance.</li><li><strong>Express</strong>: Still a solid choice, but not optimized for extreme throughput or modern JS performance patterns.</li></ul><h3>✅ Conclusion</h3><p>Here’s the quick takeaway:</p><ul><li>✅ <strong>Use Fastify</strong> when raw performance is critical.</li><li>✅ <strong>Use NestJS</strong> for large, maintainable applications with a solid structure.</li><li>✅ <strong>Use Express</strong> for simple apps or when rapid prototyping is key.</li></ul><p>Fastify clearly wins the performance race, but all three have their place in the modern Node.js ecosystem.</p><h3>🔗 Bonus: GitHub Demo</h3><p>You can find all the demo code used in this test on my GitHub here. Feel free to clone it, run the tests, and see for yourself.</p><p><a href="https://github.com/devangbhagdev/express-nest-fastify-load-testing">https://github.com/devangbhagdev/express-nest-fastify-load-testing</a></p><h3>💬 What do you use?</h3><p>Which framework do you prefer and why? Have you faced any performance bottlenecks? Let’s talk in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22583222810d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>