Is Next.js a Good Choice for Backend Development?

0
6
Asked By Techie1234 On

I just came across some discussions claiming that using Next.js for backend development is a poor choice. I've already built a web app with a full stack using Next.js, and I'm now sitting at about 15,000 lines of code. Is it really worth the trouble to refactor and separate the backend? If so, what are some recommended alternatives? Thanks in advance!

4 Answers

Answered By CleverCoder99 On

Honestly, I think Next.js adds unnecessary complexity for backend roles. It feels like a push to keep you tied to Vercel’s ecosystem. If you want to keep it simple, there are better alternatives out there.

ProgrammerGal77 -

You can actually self-host Next.js if needed. You can deploy it as a Node.js server, in a Docker container, or even do a static export. Check their documentation for more on deploying options!

Answered By CodeMaster89 On

Next.js does have some advantages, like allowing for code sharing and reducing duplication. It really boils down to your needs and team size. I’m on a four-person team in a startup using Next.js for various frontend pages, webhooks, and API endpoints. We’re moving away from a lot of scattered lambdas to consolidate everything, and so far, it’s working fine. Personally, I like SPAs better, but Next.js has proven itself useful for us. Just keep in mind that if your app won't ever have frontend pages, you might be better off sticking with something like Express or Go.

Answered By WebWiz45 On

While Next.js isn’t your traditional backend framework, some people use it in a BFF capacity. Just be aware that it may not fit every use case.

Answered By DevGuru77 On

You can set up some BFF (Backend for Frontend) routes with Next.js, and they work okay. However, we eventually found that having a dedicated backend hosted separately scaled much better. Nowadays, we run our frontend on Next.js and keep our backend on a different service.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.