How can I make tRPC+NextJs APIs faster? (db and functions region is already same)
Hi, I have migrated my website backend (https://clubofcoders.com) from NestJs + Prisma + Cloud Run to tRPC + Prisma + NextJs serverless functions. But I am not quite happy with the performance (screenshot is attached).
The requests are taking up to five sec on first loads and 2/3 secs. afterward; I am using the same region for serverless functions and the database (planetscale). Hosted on vercel.
Any ideas I can improve this?
ClubOfCoders - Learn to build production ready websites
Join ClubOfCoders and learn full stack development, Next.js, Tailwind CSS, Firebase, Supabase, TRPC, Prisma, TypeScript, React, AWS and more
![](https://utfs.io/f/213ab7a2-3408-42e5-a79e-979d72522509-r1z0dj.01.29_PM.png)
5 Replies
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Yep Iām gonna ditch vercel for self docker hosting. Less scalable for sure but I cannot accept my app is taking so long to display so few data
I can also say that Vercel has been surprisingly less performant than hosting it myself on digital ocean
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I have figured this out, now I have deployed it on aws using a server less server. Fargate and stuff, using a service flight control hq, they have built a platform where we can deploy our applications without worrying about all aws complex stuff.
Now website is 10 times faster š