#framework
#nestjs
#javascript
#comparison
Sun Sep 12 2021
Last year we started building our portal from the scratch and we had the luxury of using any technologies, framework or library that we wanted to.
We didn't have a lot of time so we just wanted to speed up and write the business logic rather than wasting time on the configuration of tools together. Our only restriction was the fact that we were all JS devs and we wanted to write JavaScript or TypeScript also from the DevOps side, we knew we'll use K8s (As much as I love Serverless, unfortunately, it was out from the picture - Maybe another blog for another time to talk about this).
We had a list of suggestions and in there we had frameworks or multiple libs working together. We decided to pull out the libraries since we wanted an opinionated framework to give us the power to focus on writing the code for logic from the first day. Of course, there's a trade-off between those approaches as you would have the freedom to choose the best libraries (or the ones that you're comfortable with) or you can just limit yourself to a framework and its conventions/patterns.
This was very controversial as some people believe in the convention over configurations and some people believe in the freedom of using whatever they want and configuring them as they want.
We prepared a list of features and considerations that we liked to have from the framework or library and gave them points.
Our final list of frameworks was:
The first decision that we made was around the first item on the list: Only Backend or Full-Stack
.
We wanted to scale and we knew we were going to have multiple web apps consuming our API so we decided to have our Frontend separated.
It was easy, Next.js was the winner since it offers a ton on the frontend and satisfies most of our items on the list.
Then we took out the ones that didn't have a production-ready version. Unfortunately Blitz
and Redwood
got eliminated and it was a pity honestly. I loved RedwoodJS so much that I started doing my side project just because I didn't want to miss learning it.
Later we got rid of Express + Prisma
because for making it ready we needed to have a lot of configuration and adding a lot of other libraries for future requirements.
So we had the final list of Frameworks which had 'Stable Version', 'Community Support' and good 'Documentation'. I'm not going to review those frameworks but as we researched and looked into them, not all of them had good tooling or CLI commands or DB migration management capability.
Between those we chose NestJS: it had almost all of the points that we wanted, the only issue at that time was Prisma which wasn't production-ready and its migration was experimental but right now after more than a year, we are super happy for the call that we made! We have scaled 10x on the product side and 4x on the dev side and NestJs scaled very well, plus Prisma released a lot of features and made it easier for us to scale on the DB side. Talking to devs on the team, they are super happy too. They have learned frameworks (both NextJs and NestJs) that are great for their career!
© Copyright 2022 Farmin Farzin