r/Nestjs_framework

▲ 1 r/Nestjs_framework+1 crossposts

NestJS Vs Symfony: Thoughts and opinions

I am about to embark on a large multi application project, and am back to weighing the pros and cons of each framework.

In my opinion, Nest is the only Node backend worth running, due to its strictly typed, opinionated nature. It keeps things organized and maintainable. Native GraphQL support is super nice as well.
That said, Symfony is so good, predictable, and honestly relaxing to use and maintain due to it's debugging capabilities.

Here are my two cents for the pros and cons. I am curious to hear what you all have to say on the topic.

NestJS

Pros:

  • Database connections remain open over multiple requests, managing connection limits.
  • Background task processing without Supervisor.
  • Written with Typescript.
  • Native GraphQL support.
  • Dynamic type definition with class inheritance, allowing for strictly typed dynamic inheritance.
  • Elegant, Rails like event and request interception.
  • Modules based approach feels organized, and easy to navigate.

Cons:

  • Module import and exports are both confusing and tedious.
  • Needs dedicated processor (Not a bad thing, just has a slightly increased cost).
  • Confusing and/or incomplete documentation.
  • Smaller community.
  • Async processing can cause database lockups if not careful.
  • Errors will take down the entire thread. One funny request and the process goes down for everyone potentially.
  • Debugging and logging. While there, I find them to be not quite as nice as Symfony.

Symfony

Pros:

  • Can be cheap as chips to host.
  • Doctrine.
  • Independent service definitions that can easily be injected.
  • Auto-wiring & dependency injection is an absolute pleasure to work with.
  • Well written, highly complete, and easy to understand documentation.
  • Native third party bundles, and well defined ways to create your own bundles.
  • Native "dump" feature.
  • Logging and Debugging is super clear, controllable, and provides useful information without clutter.

Cons:

  • PHP (While I love, Javascript is arguably much nicer to write)
  • Higher memory requirements for a single instance
  • Non-devs sticking their nose up at you because you use PHP. It's a real concern if you are trying to sell the service. Business folks like hiring a person that knows Javascript for both front and back.
  • Event listeners and subscribers feel detached, and are non-intuitive.
reddit.com
u/Outrageous-Gear4858 — 2 days ago