Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Coming from Express or Spring

A guide for Node.js (Express, NestJS) and Java (Spring, Spring Boot) developers - the PHP request model compared with an event loop and a servlet container, routing, middleware and interceptors, dependency injection…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/web-framework-developers/coming-from-express-and-spring.md

On this page

Coming from Express or Spring

This page is for developers who build web applications with Express or NestJS on Node.js, or with Spring and Spring Boot on the JVM. The biggest shift is not the language but the process model; after that, most concepts have a counterpart, and a few that Spring developers rely on (a DI container, annotations) do not.

Contents

  1. The process model
  2. Side by side
  3. Keeping your front end
  4. What you will miss

The process model

Express, NestJSSpringExponential 6
Processone long-running process, event looplong-running JVM, a thread per requestPHP-FPM: a fresh run per request; Velocity: persistent workers, one request at a time each
State between requestsin memory, sharedsingletons, sharednone under PHP-FPM; per worker under Velocity, which you must not rely on
Concurrency inside a requestasync I/Othreads, reactive stackssynchronous; slow work goes to a queue
Real-timeWebSocketsWebSocket supportVelocity's WebSockets and Server-Sent Events (Velocity WebSockets)

Under Velocity, the rules resemble those of a long-running process: reset per-request state, register listeners once (Servers and deployment).

Side by side

Express / NestJSSpringExponential 6Page
app.get(), controllers with decorators@RequestMappingmodule.php viewsRouting
middleware, guards, interceptorsfilters, HandlerInterceptorrequest rules, listeners, runnable eventsMiddleware
NestJS providersbeans, @Autowiredno container; handler classes from INIDependency injection
an ORM (TypeORM, Prisma, Sequelize)JPA, Hibernate, Spring Datacontent API; eZPersistentObjectORM
.env, config modulesapplication.yml, profilesINI files, EXP_ENVConfiguration
Passport.js, guardsSpring Securitylogin handlers, roles and policiesAuthentication, Authorization
template engines (EJS, Pug, Handlebars)Thymeleafthe template languageThe view layer
job queues (BullMQ)@Async, JMS, Spring Batchexpqueue, content jobsQueues
node-cron@Scheduledcronjob partsScheduled tasks
EventEmitterApplicationEventPublisherezpEventEvents
npm scripts, CLIsCommandLineRunnerbin/php/consoleCommand line
Jest, SupertestJUnit, MockMvcPHPUnit, HTTP checksTesting

Keeping your front end

Many teams from these ecosystems keep a JavaScript or Java front end and use Exponential as the content back end: the REST API for content, OAuth2 or API keys for credentials, editors in the administration (Headless and decoupled front ends, REST and JSON APIs).

What you will miss

  • Annotations or decorators for routes, security and transactions.
  • A DI container and typed configuration properties.
  • In-process async I/O; use queues for slow calls.
  • Generated API documentation (OpenAPI) for the REST API.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x