Stacks vs Express and Fastify

A router is not a framework, and sometimes a router is all you want.

Express and Fastify do one job well: take a request, run some middleware, return a response. That minimalism is why they are everywhere and why every Express codebase is different. Stacks is the opposite trade: conventions and batteries, at the cost of doing things its way.

What Express and Fastify is.

In its own terms, not ours.

Express is the most deployed HTTP framework in JavaScript and the reference implementation of the middleware pattern. Fastify is the modern take: faster, schema-driven, with a well-designed plugin system and first-class TypeScript. Neither has an opinion about data, auth, jobs, or views, and both are excellent when that is what you want.

Where each one wins.

Same amount of room on both sides, on purpose.

Pick Express and Fastify for

  • Ubiquity

    Every engineer knows Express, every integration documents it, and it will still be maintained long after most of this page is out of date.

  • Nothing in the way

    For a proxy, a webhook receiver, or a small service, a framework with opinions is overhead you do not need.

  • Fastify performance and schemas

    JSON schema validation and serialisation make Fastify both fast and strict, which is a good combination for high-volume APIs.

  • Plugin ecosystems

    Decades of middleware for anything you might bolt on.

Pick Stacks for

  • The application above the router

    Models, migrations, validation, auth, queues, mail, storage, search, and admin, rather than a directory structure you invent.

  • Consistency across projects

    Two Stacks applications look alike. Two Express applications rarely do, and that cost is paid at every handover.

  • Typed end to end

    The route, the action, the model, and the client share types by construction.

  • Deploy included

    Infrastructure in config, applied by the CLI, instead of a bespoke pipeline per service.

Side by side.

The dimensions teams actually decide on.

Dimension Stacks Express and Fastify
Scope Full application framework HTTP routing and middleware
Structure Prescribed by the framework Whatever the team decides
Data layer Included Choose your own
Validation On the model, reused everywhere Zod, JSON schema, or your own
Background work Included Choose your own
Views STX in the same project Add a template engine or a separate front end
Best fit Products and platforms Small services and glue
Runtime Bun Node.js, Bun compatible

If you did move.

What ports cleanly, what does not, and where to start.

Handlers become actions

Each route handler becomes an action, and shared middleware moves into app/Middleware/.

Adopt the ORM last

A Stacks application can keep talking to your existing database and query builder while routes move over.

Move one route group at a time

Run both, put Stacks behind the new endpoints, and retire the old service when the last route has moved.

The verdict.

Both answers are real. Most teams already know which paragraph is theirs.

Choose Express and Fastify when

The service is small, its job is narrow, or you have strong reasons to control every layer yourself.

Choose Stacks when

It is a product rather than a service, and the structure you would otherwise invent is structure you would rather inherit.

The frameworks that usually come up in the same conversation.