Technology · Runtime

Node.js — a tool first, a service second

Node.js runs in almost every project we do, but usually on the development machine and in the build. It is the runtime that builds and checks: Vite, bundling, asset pipelines, tests, scripts for imports and migrations. As a permanently running service we use it selectively — when event processing or websockets are genuinely needed.

runtime for builds and tooling

What is Node.js?

For us Node.js is above all a tooling runtime. A Node service of its own is built only when it gives the project more than it costs to run.

What we use Node.js for

The build comes first. Every modern front end needs a runtime that bundles assets, compiles TypeScript, processes CSS and prepares images. For us that is Vite, in Shopware 6 its own build process, and in TYPO3 and WordPress themes a lean configuration of our own. Tests, linting and formatting run in the same runtime. Set this part up carelessly and you find out with the first colleague whose build turns out differently.

The second use is scripts that do not belong in the application: data imports, migrations between systems, preparing media, calling third-party APIs. Whether something is written in Node or in Python depends on the task — if it hangs off the front-end ecosystem it stays in Node; if it is about analysing and preparing data, Python is the better choice. Third, and less often, actual services: small APIs, websocket connections, event processing.

How we work with it

The Node version is fixed in the project, not left to whatever happens to sit on the machine. Dependencies live in the repository with a lockfile, builds run in a container so that local machines and continuous integration produce the same result. We are restrained about packages: every dependency is code someone has to keep updated, and an attack surface through the supply chain. An npm tree that drags in half an ecosystem for a handful of functions is not progress.

If a service does run permanently, we treat it like any other application in operation: process management, restart behaviour, logs, monitoring, and an update path for Node itself. Hosting is on our own servers in Germany, in the Proxmox cluster, with support Monday to Friday, 9:00 to 16:00 CET. We settle the question of who runs it before the first line of code, not at handover — it often decides whether the service gets built at all.

Limits: when no Node service gets built

A Node service is quick to write and long to look after. So we first ask whether the task belongs in the existing Symfony application — as a command, as a message handler, as an endpoint. Deployment, permissions, database access and someone who knows their way around are already there. An extra service means a second update cycle, a second log, and, in case of doubt, the one process nobody remembers two years later.

Compute-heavy work does not belong in Node either. The event loop is strong with many simultaneous connections and weak as soon as a single operation occupies the CPU for any length of time — then everything else waits. Image processing, large analyses and bulk data transformation run in Python here, or in a queue outside. And for classic web applications PHP 8 with Symfony stays the choice. Node is no improvement there, only a different language.

Frequently asked questions

When is a Node.js service the right choice?

A Node.js service of its own pays off when many connections have to stay open at the same time — websockets, notifications, real-time event processing. In those cases the event loop plays to its strength. For anything that already happens inside a Symfony application, an extra service is usually the more expensive answer: it brings its own deployment, its own monitoring and its own ownership. The question is not whether it can be done, but whether it is worth doing.

Do you host Node.js applications yourselves?

Yes, Node.js applications run at Sharpness on our own servers in Germany, in a Proxmox PVE cluster. Running them includes process management, restart behaviour, logs, monitoring and a plan for keeping the Node version current. Support is available Monday to Friday, 9:00 to 16:00 CET, by phone on +49 441 21 21 63 0. Who is responsible for running the service is settled before the first line of code.

Will Node.js replace our PHP back end?

No, Node.js does not as a rule replace a PHP back end. We build shops, portals and business applications with PHP 8 and Symfony, because that is where the ecosystem, the operational experience and our own practice sit — Shopware 6 and TYPO3 are built on it anyway. Node.js adds to that at clearly defined points: in the build, in scripts and in services for events. Two runtimes side by side are defensible as long as each has a job.

Node.js: existing system or new build?

We also take over systems that were built elsewhere — after a look at the code and the hosting.

What else we build with

Call Start a project