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
The process model
| Express, NestJS | Spring | Exponential 6 | |
|---|---|---|---|
| Process | one long-running process, event loop | long-running JVM, a thread per request | PHP-FPM: a fresh run per request; Velocity: persistent workers, one request at a time each |
| State between requests | in memory, shared | singletons, shared | none under PHP-FPM; per worker under Velocity, which you must not rely on |
| Concurrency inside a request | async I/O | threads, reactive stacks | synchronous; slow work goes to a queue |
| Real-time | WebSockets | WebSocket support | Velocity'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 / NestJS | Spring | Exponential 6 | Page |
|---|---|---|---|
app.get(), controllers with decorators | @RequestMapping | module.php views | Routing |
| middleware, guards, interceptors | filters, HandlerInterceptor | request rules, listeners, runnable events | Middleware |
| NestJS providers | beans, @Autowired | no container; handler classes from INI | Dependency injection |
| an ORM (TypeORM, Prisma, Sequelize) | JPA, Hibernate, Spring Data | content API; eZPersistentObject | ORM |
.env, config modules | application.yml, profiles | INI files, EXP_ENV | Configuration |
| Passport.js, guards | Spring Security | login handlers, roles and policies | Authentication, Authorization |
| template engines (EJS, Pug, Handlebars) | Thymeleaf | the template language | The view layer |
| job queues (BullMQ) | @Async, JMS, Spring Batch | expqueue, content jobs | Queues |
| node-cron | @Scheduled | cronjob parts | Scheduled tasks |
| EventEmitter | ApplicationEventPublisher | ezpEvent | Events |
| npm scripts, CLIs | CommandLineRunner | bin/php/console | Command line |
| Jest, Supertest | JUnit, MockMvc | PHPUnit, HTTP checks | Testing |
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.
Related pages
- Concept dictionary
- When to choose Exponential
- PHP developers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
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.