NO, you most probably don’t need Express in your Node.js REST API

Do you really need express?


Express is the simple, well documented and well supported, best sponsored, most downloaded… Web Framework in the Node.js ecosystem.

If you search for a “hello world” HTTP server example in node.js, you will usually find out something like this:

const server = require('express')({})

server.get('/', (req, res) => {
  res.send('Hello World!')

Yes, it feels magic, and we all love it!!!


In today’s enterprise software architectures, REST based APIs/services continue to play a fundamental role, because the HTTP protocol is still massively used as an external and internal communication protocol.
This means, software engineers will most likely prefer to implement the next “service” using a REST API instead of a “queue or event” based approach.

With the adoption of the best “micro-services design” patterns, REST APIs tend to be tiny, stateless, highly decoupled…, usually in charge of atomic business work-flows. This means, commonly multiple API endpoints are invoked to satisfy even the simplest customer interaction with our application features.

Yes, REST APIs have to be fast, REST APIs are required to be fast!

Also, more sophisticated architectures now rely on API-Gateways (like fast-gateway) as a main “app” entry point, where the majority of the non-functional requirements are performed before the request is even proxied to the target REST API. Usually, the following aspects are handled in this level:

  • SSL Termination
  • Logging
  • Load Balancing
  • Authentication & Authorization
  • Content Negotiation
  • Caching
  • Content Compression
  • Rates Limit

Yes, REST API endpoints are very stupid nowadays!

However, Express is too heavy and slow

Express is great, fully featured…, but is also too heavy and slow for minimalist use cases, such as RESTful micro-services commonly are.

Express version (4.16.3) depends of other 30 direct modules, the complete production dependency tree is about 50 modules.

Latest express version execution time is too slow for minimalist use cases. See how it compares to other Node.js Frameworks:

The previous measurements do not only show that express is slow, it means that you need double CPU utilization to perform simple operations, … ultimately causing a considerable impact on your monthly billing; although AWS, GCloud, Azure… might be happy $$$ 😉


In the Node.js ecosystem, there are plenty of flavours when it comes to REST oriented development frameworks. Those are there for a reason.

If maximising performance is your priority, express is clearly not your option; meet the challenge: and checkout fastify and enjoy the next level. When being tiny and minimal is your priority, checkout restanarestifykoa or polka.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.