node.jstypescriptnestjsbackendadonis.js

NestJS VS AdonisJS


I am about to embark on a new project. So far, I have been working with ExpressJS for my backend, but I find that I am reinventing the wheel a bit too much. Since I always strive to improve my projects, I find myself spending a lot of time on technology decisions and project structure to ensure that it is clean and scalable. Therefore, I plan to switch to Nest JS or Adonis JS, as they are rather opinionated frameworks that require a certain structure and specific tools in their core.

My inclination leans more towards Adonis JS than Nest, and I would like to know if there are any members who have experience in this area or who could provide me with other information or remarks that could influence my choice of technology? (knowing that the backend of the new project I will be working on will be complex)

Thank you.


Solution

  • I don't know personally Adonis JS, but i've used Nest JS and it seems quite good as backend framework.

    Honestly i don't like opinionated frameworks since i prefer to have a full control of the architecture and libraries choice

    In the following i mark some points to consider between opinionated and non opinionated frameworks

    Advantages

    1. Batteries included: Usually opinionated frameworks comes batteries included, providing all necessary tools to achieve a good software architecture and product stabiity
    2. Automatic architecture: Your focus as developer will consist only to implement functionality and rely on the framework structure
    3. Speed up the project set up
    4. Fast Team onboarding: In future, if you plan to introduce new developers on the project you can look for people that already knows that specific framework and they will comfortably work on an unknown project as it follows standards which are pretty identical across projects
    5. Maintainability: Popular frameworks have large contributions and are in a constant evolution, although this could be a problem if you prefer to stick on a specific philosophy

    Disadvantages

    1. Borders: Is really difficult to cross the borders, if you need a particular behaviour that is not part of the framework philosophy, you're screwed, and forget to post an issue on the github of the framework, the most common answer will be:

    It's a design choice to keep it simple

    And commonly this is also correct, but you still remain with your issue

    1. Huge project: Full batteries included framework are really heavy, as they provide a lot of built-in libraries that are not necessary useful for all projects, so the question should be: Do i need all of this? and Can i handle all this complexity?

    2. Hard low level debugging: As you live constantly in the black box ifyou may have some sort of black magic issue and it will be very hard to perform a helpful investigation, generally creative and strange solutions comes in, sometimes you may even have to face a rollback of the framework version waiting for a final fix

    3. Vendor Lock: Even if we are speaking of open source framework you are bound, and if a day the framework changes philosophy or even worse if it is archived you are screwed

    How to choose the right framework?

    In my belief i think that you must consider just a few point and make a choice based on them

    A few minors point, but still relevant:

    I hope I have given you some pointers to help you make the wisest decision.

    Frameworks and libs if you consider to go on a non opinionated approach