performance of running a hono server vs next app router route handlers
artivilla
HOBBYOP

a year ago

How does hosting nextjs app router route handlers work vs hosting on a serverless platform? I'm building my app using a hono/bun server and nextjs frontend and Im' curious if there is any benefit, advantage over nextjs route handlers?

Solved

2 Replies

Hey!

Nextjs server route handlers are intended for serverless runtimes, but you can run them on a "serverful" runtimes (like Railway) without any penalties whatsoever in most cases (unless you're relying on edge/cdn cache from Vercel etc.)

A standalone hono/bun server gives you better separation of concerns (no frontend-intermingling-with-backend) and it's scalable on its own. I'd personally recommend this over Next but this is more of a general architecture decision you have to make for your own setup.


Status changed to Awaiting User Response Railway about 1 year ago


artivilla
HOBBYOP

a year ago

Got it. Yeah I was mostly curious. I'm early enough I can go either route. but thinking on this more you can scale backends easier. so sticking to as is.


Status changed to Awaiting Railway Response Railway about 1 year ago


Status changed to Solved chandrika about 1 year ago


Loading...